/* ==========================================================================
   Сервизна книжка — дизайн
   ========================================================================== */

:root {
  --ink: #0a0f24;
  --ink-2: #121a3a;
  --bg: #f3f5fb;
  --surface: #ffffff;
  --text: #0e1530;
  --muted: #63708a;
  --border: #e4e8f2;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --cyan: #06b6d4;
  --grad: linear-gradient(135deg, #6366f1 0%, #3b82f6 55%, #06b6d4 100%);
  --grad-light: linear-gradient(90deg, #a5b4fc 0%, #67e8f9 100%);
  --danger: #e11d48;
  --success-bg: #e7f8ef;
  --success-text: #157347;
  --error-bg: #fdecef;
  --error-text: #b4123c;
  --warn-bg: #fff6e5;
  --warn-border: #f8dca6;
  --warn-text: #8a5300;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(14, 21, 48, .04), 0 10px 30px -14px rgba(14, 21, 48, .16);
  --shadow-lg: 0 40px 80px -30px rgba(10, 15, 36, .45);
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.is-public {
  background:
    radial-gradient(1100px 520px at 0% -10%, #e6e8ff 0, transparent 60%),
    radial-gradient(900px 420px at 100% 0%, #dff6fb 0, transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
}

main { flex: 1; }
.main-pad { padding-top: 36px; padding-bottom: 72px; }
input.mono::placeholder { font-family: var(--font); letter-spacing: 0; }
.list a, td a, .details a { text-decoration: none; font-weight: 600; }
.list a:hover, td a:hover, .details a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; font-weight: 800; margin: 0 0 12px; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 32px 0 14px; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 10px; }
.card > h2:first-child, .card > h1:first-child, .card > h3:first-child { margin-top: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { flex: none; vertical-align: -3px; }

/* ---------- Горна лента ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(228, 232, 242, .8);
}
.topbar-dark {
  position: absolute; left: 0; right: 0;
  background: transparent; border-bottom-color: rgba(255, 255, 255, .08);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .7);
}
.brand-text { font-family: var(--display); font-weight: 600; font-size: .98rem; letter-spacing: -.01em; }
.brand-text b {
  font-weight: 600;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-dark .brand { color: #fff; }
.topbar-dark .brand-text b { background: var(--grad-light); -webkit-background-clip: text; background-clip: text; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav-link { padding: 8px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem; }
.topnav-link:hover { background: rgba(14, 21, 48, .05); }
.topbar-dark .topnav-link { color: #d5dbf0; }
.topbar-dark .topnav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topnav-user { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; }
.topnav-user:hover { background: rgba(14, 21, 48, .05); }
.topbar-dark .topnav-user { color: #fff; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: .9rem; }
.flash-float { position: relative; z-index: 5; padding-top: 88px; margin-bottom: -76px; }

/* ---------- Бутони ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.3;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .75); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .8); }
.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-secondary:hover { background: #e2e5ff; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: #cdd3e3; background: #fafbff; }
.topbar-dark .btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }
.btn-danger { background: var(--surface); border-color: #f6c6d1; color: var(--danger); }
.btn-danger:hover { background: var(--error-bg); }
.btn-light { background: #fff; color: var(--ink); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.btn-light:hover { transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: .86rem; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
form.inline { display: inline; margin: 0; }

/* ---------- Форми ---------- */
input, textarea, select {
  width: 100%; padding: 11px 14px; margin-top: 6px;
  border: 1.5px solid #dde2ee; border-radius: var(--radius-sm); background: #fbfcff;
  font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, textarea:hover, select:hover { border-color: #c9cfe0; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .15); }
input:disabled { background: #f0f2f7; color: var(--muted); }
label { display: block; font-weight: 600; font-size: .92rem; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack h2 { margin: 6px 0 0; }
.row, .row-3 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 2fr 2fr 1fr; }
.hint { color: var(--muted); font-size: .86rem; margin: 0; }
.field-error { color: var(--error-text); margin: 10px 0 0; font-weight: 500; }
.req { color: var(--danger); }
details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }

/* ---------- Карти и известия ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.empty { text-align: center; padding: 40px 24px; }
.empty-big { padding: 56px 24px; }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.alert { border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 20px; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: #c4ecd5; }
.alert-error { background: var(--error-bg); color: var(--error-text); border-color: #f7c9d4; }
.alert-warning { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.alert-icon { display: flex; gap: 12px; align-items: flex-start; }
.alert-icon .icon { margin-top: 2px; }
.badge { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .85rem; text-align: center; vertical-align: middle; }

/* ==========================================================================
   Начална страница
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--ink); color: #fff;
  padding: 150px 0 150px;
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; z-index: -1; pointer-events: none; }
.hero-glow-1 { width: 560px; height: 560px; background: #6366f1; top: -180px; left: -140px; }
.hero-glow-2 { width: 480px; height: 480px; background: #06b6d4; bottom: -220px; right: 6%; opacity: .45; }
.hero-glow-3 { width: 380px; height: 380px; background: #8b5cf6; top: -140px; right: -100px; opacity: .5; }
.hero-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  color: #c7d2fe; font-size: .82rem; font-weight: 600; letter-spacing: .02em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); animation: pulse 2.4s ease-in-out infinite; }
.hero h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.08; letter-spacing: -.03em; margin: 22px 0 18px;
}
.grad-text { background: var(--grad-light); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { color: #b8c1dc; font-size: 1.12rem; max-width: 560px; margin: 0 0 30px; }

.search-hero {
  display: flex; align-items: center; gap: 6px; max-width: 620px;
  background: #fff; border-radius: 999px; padding: 6px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .06), 0 30px 60px -20px rgba(0, 0, 0, .6);
}
.search-icon { display: grid; place-items: center; padding-left: 14px; color: var(--muted); }
.search-hero input {
  flex: 1; min-width: 0; margin: 0; border: 0; background: transparent; box-shadow: none;
  padding: 12px 6px; font-family: var(--mono); font-size: 1.05rem; letter-spacing: .05em; text-transform: uppercase;
}
.search-hero input:focus { box-shadow: none; background: transparent; }
.search-hero input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font); color: #8d97ae; }
/* Бърза проверка по рег. номер — на началния екран */
.plate-hero {
  max-width: 620px; margin-top: 26px; padding: 16px 18px; border-radius: 22px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
}
.plate-hero-text strong { display: block; color: #fff; font-size: 1rem; }
.plate-hero-text span { color: #b8c1dc; font-size: .88rem; }
.plate-hero-input { display: flex; align-items: center; gap: 6px; margin-top: 12px; background: #fff; border-radius: 14px; padding: 5px; }
.plate-flag {
  display: grid; place-items: center; align-self: stretch; padding: 0 9px; border-radius: 9px;
  background: #1d4ed8; color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .04em;
}
.plate-hero-input input {
  flex: 1; min-width: 0; margin: 0; border: 0; background: transparent; box-shadow: none;
  padding: 10px 6px; font-family: var(--mono); font-size: 1.05rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.plate-hero-input input:focus { box-shadow: none; background: transparent; }
.plate-hero-input input::placeholder { color: #a3acc2; font-weight: 500; }
.plate-step2 { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
.plate-step2 > p { margin: 0 0 10px; color: #dfe4f3; font-size: .92rem; }
.plate-step2-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plate-step2-row img { width: 108px; height: 58px; border-radius: 10px; background: #fff; flex: none; }
.plate-reload { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #fff; font-size: 1.1rem; cursor: pointer; flex: none; }
.plate-reload:hover { background: rgba(255, 255, 255, .1); }
.plate-step2-row input {
  width: 110px; margin: 0; padding: 10px 12px; border-radius: 12px; border: 0;
  font-family: var(--mono); font-size: 1.1rem; font-weight: 700; letter-spacing: .25em; text-transform: lowercase;
}
.plate-step2-wait { margin: 10px 0 0 !important; min-height: 1.2em; color: #a5f3fc !important; }
@media (max-width: 520px) { .plate-step2-row .btn { width: 100%; } }

.hero-error {
  display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 8px 14px; border-radius: 12px;
  background: rgba(225, 29, 72, .16); color: #fecdd6; font-weight: 500; font-size: .93rem;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 22px 0 0; color: #cbd2ea; font-size: .92rem; }
.hero-chips li { display: inline-flex; align-items: center; gap: 6px; }
.hero-chips .icon { color: #34d399; }

/* Примерна книжка */
.hero-visual { position: relative; min-height: 430px; display: grid; place-items: center; }
.mock-book {
  width: 100%; max-width: 410px; padding: 24px; border-radius: 24px;
  background: #fff; color: var(--text); box-shadow: var(--shadow-lg);
  transform: rotate(-4deg); animation: floaty 7s ease-in-out infinite;
}
.mock-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.mock-title { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.mock-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.mock-badge { padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.mock-timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px dashed #dfe3f0; margin-left: 6px; }
.mock-timeline li { position: relative; padding-bottom: 16px; }
.mock-timeline li:last-child { padding-bottom: 0; }
.mock-timeline li::before {
  content: ''; position: absolute; left: -27px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 0 4px #fff;
}
.mock-date { display: block; font-size: .76rem; font-weight: 700; color: var(--primary); letter-spacing: .02em; }
.mock-timeline b { display: block; font-size: .95rem; margin: 2px 0; }
.mock-meta { font-size: .8rem; color: var(--muted); }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  background: rgba(255, 255, 255, .96); color: var(--text); font-size: .84rem; font-weight: 600;
  box-shadow: 0 18px 36px -14px rgba(0, 0, 0, .55); white-space: nowrap;
}
.float-chip-1 { top: -5%; right: 0; transform: rotate(5deg); animation: floaty 6s ease-in-out infinite .6s; }
.float-chip-1 .icon { color: #10b981; }
.float-chip-2 { top: 56%; left: -15%; transform: rotate(-6deg); animation: floaty 8s ease-in-out infinite 1.2s; }
.float-chip-2 .icon { color: #f59e0b; }
.float-chip-3 { bottom: -4%; right: 6%; transform: rotate(3deg); animation: floaty 7s ease-in-out infinite .3s; }
.float-chip-3 .icon { color: var(--primary); }

@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); } 50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, .05); } }

/* Лента с числа (застъпва героя) */
.strip {
  position: relative; z-index: 2; margin-top: -64px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: #fff; border-radius: 24px; padding: 8px; box-shadow: 0 30px 60px -30px rgba(10, 15, 36, .35), 0 0 0 1px var(--border);
  max-width: 1080px;
}
.strip-item { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 20px 26px; }
.strip-item + .strip-item { border-left: 1px solid var(--border); }
.strip-item strong {
  font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.strip-item span { color: var(--muted); }
.strip-item:has(.strip-icon) { flex-direction: row; align-items: center; gap: 14px; }
.strip-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); flex: none; }
.strip-item b { color: var(--text); }

/* Секции */
.section { padding-top: 96px; }
.section-head-center { text-align: center; margin-bottom: 44px; }
.kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.kicker-light { color: #a5b4fc; }
.section-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.18; letter-spacing: -.02em; margin: 10px 0 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.step {
  position: relative; overflow: hidden; padding: 30px 28px 32px; border-radius: 24px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.step h3 { font-size: 1.12rem; margin: 18px 0 8px; }
.step p { color: var(--muted); margin: 0; }
.step-num { position: absolute; top: 10px; right: 18px; font-family: var(--display); font-weight: 700; font-size: 3.4rem; color: #eef0f8; line-height: 1; }
.step-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: var(--grad); color: #fff; box-shadow: 0 10px 20px -10px rgba(79, 70, 229, .8); position: relative; }
.step-offset { transform: translateY(36px); background: var(--ink); border-color: var(--ink); color: #fff; }
.step-offset p { color: #b3bcd8; }
.step-offset .step-num { color: rgba(255, 255, 255, .07); }

.bento { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; margin-bottom: 96px; }
.bento-main {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 46px; border-radius: 30px; background: var(--ink); color: #fff;
}
.bento-main .section-title { max-width: 520px; margin-bottom: 26px; }
.benefits { list-style: none; padding: 0; margin: 0 0 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.benefits li { display: flex; align-items: center; gap: 12px; color: #dfe4f3; }
.benefits .icon { box-sizing: content-box; padding: 9px; border-radius: 11px; background: rgba(255, 255, 255, .08); color: #67e8f9; }
.bento-note { color: #8e9bbd; font-size: .86rem; margin: 16px 0 0; }
.bento-side { padding: 32px; border-radius: 30px; transform: translateY(40px); }
.forgot { margin: 14px 0 0; text-align: center; }

/* Често задавани въпроси */
.faq-section { padding-bottom: 96px; }
.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 4px 22px; box-shadow: var(--shadow); transition: border-color .15s; }
.faq details[open] { border-color: #c9cff5; }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 700; font-size: 1.04rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 1.2rem; font-weight: 600; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); }

/* Тесни телефони: в горната лента остава само иконката на логото (надписът е за четци на екран) */
@media (max-width: 440px) {
  .topbar .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topnav { gap: 4px; }
  .topnav .btn-sm { padding: 6px 12px; }
}

/* Страница за вход */
.auth { display: grid; place-items: center; padding: 24px 0 40px; }
.auth-card { width: 100%; max-width: 440px; padding: 34px 32px; }
.auth-card h1 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.02em; margin: 10px 0 6px; }
.auth-card > p.muted { margin: 0 0 20px; }
.auth-alt { text-align: center; margin: 6px 0 0; }

/* Правни страници и контакти */
.legal { max-width: 860px; margin: 0 auto; }
.legal-head { margin-bottom: 22px; }
.legal-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -.02em; margin: 10px 0 6px; }
.legal-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; padding: 18px 22px; margin-bottom: 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.legal-toc a { text-decoration: none; font-weight: 500; font-size: .93rem; padding: 3px 0; }
.legal section { padding: 4px 0 8px; scroll-margin-top: 90px; }
.legal h2 { font-size: 1.22rem; margin: 26px 0 10px; }
.legal p, .legal li { line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal-defs { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; }
.legal-defs dt { font-weight: 700; }
.legal-defs dd { margin: 0; color: var(--muted); }
.legal-table td, .legal-table th { font-size: .92rem; }
.legal-table td:first-child { font-weight: 600; white-space: nowrap; }
.legal-annex { margin-top: 30px; padding: 22px 26px !important; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.legal-annex h2 { margin-top: 4px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-card h2 { margin: 6px 0 8px; font-size: 1.1rem; }
.contact-card ul { margin: 0 0 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: .92rem; line-height: 1.55; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
@media (max-width: 720px) {
  .contact-grid { grid-template-columns: 1fr; }
  .legal-defs { grid-template-columns: 1fr; gap: 2px; }
  .legal-defs dd { margin-bottom: 8px; }
  .legal-table td:first-child { white-space: normal; }
}

/* ==========================================================================
   Публична история на автомобила
   ========================================================================== */
.search-compact { margin: 0 0 26px; max-width: 560px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.search-compact input { font-size: .98rem; padding: 9px 6px; }

.vhero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end;
  padding: 36px 40px; border-radius: 30px; background: var(--ink); color: #fff; margin-bottom: 26px;
}
.vhero .hero-glow-1 { width: 420px; height: 420px; top: -200px; left: auto; right: -80px; opacity: .5; }
.vhero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3.6vw, 2.6rem); letter-spacing: -.02em; margin: 16px 0 12px; }
.vhero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vhero-chips span { padding: 4px 13px; border-radius: 999px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); font-size: .9rem; }
.vhero-vin { margin: 16px 0 0; color: #9aa6c7; font-size: .9rem; }
.vhero-print { margin-top: 16px; }
.vhero-vin .mono { color: #dfe4f3; }
.vhero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 10px; }
.vhero-stats div { display: flex; flex-direction: column; align-items: center; min-width: 108px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); }
.vhero-stats strong { font-family: var(--display); font-size: 1.4rem; font-weight: 600; }
.vhero-stats span { color: #9aa6c7; font-size: .8rem; }

/* Зигзаг хронология */
.timeline { position: relative; list-style: none; margin: 8px 0 0; padding: 6px 0; }
.timeline::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, #6366f1, #06b6d4 70%, transparent);
}
.tl-item { position: relative; width: 50%; padding: 0 40px 22px 0; }
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 22px 40px; }
.tl-item:nth-child(n+2) { margin-top: -36px; }
.tl-dot {
  position: absolute; top: 24px; right: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 4px solid var(--primary); box-shadow: 0 0 0 5px rgba(99, 102, 241, .14);
}
.tl-item:nth-child(even) .tl-dot { right: auto; left: -8px; }
.tl-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.tl-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -18px rgba(14, 21, 48, .3); }
.tl-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.tl-date { font-family: var(--display); font-weight: 600; font-size: 1rem; }
.tl-km { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.tl-card p { margin: 0 0 8px; }
.tl-card .work { white-space: pre-line; font-weight: 500; }
.tl-card .parts { white-space: pre-line; font-size: .93rem; color: #3b4560; }
.tl-card .by { margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 6px; }

/* Записи под съмнение (от блокиран сервиз) */
.record-suspicious .tl-card { background: #fffaf0; border-color: var(--warn-border); }
.record-suspicious .tl-dot { border-color: #f59e0b; box-shadow: 0 0 0 5px rgba(245, 158, 11, .15); }
.record-suspicious .work, .record-suspicious .parts { color: #5c5346; }
.suspicious-tag {
  display: inline-flex !important; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  background: #fff1d6; color: var(--warn-text); font-size: .8rem; font-weight: 700;
}
tr.row-suspicious td { background: #fffaf0; }

/* ==========================================================================
   Кандидатстване и малки страници
   ========================================================================== */
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 36px; align-items: start; }
.split-aside {
  position: sticky; top: 92px; overflow: hidden; isolation: isolate;
  padding: 40px; border-radius: 30px; background: var(--ink); color: #fff;
}
.split-aside h1 { font-family: var(--display); font-weight: 700; font-size: 1.9rem; letter-spacing: -.02em; margin: 12px 0 12px; }
.split-aside > p { color: #b8c1dc; margin: 0 0 26px; }
.split-aside .benefits { grid-template-columns: 1fr; }
.split-steps { display: grid; gap: 10px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); }
.split-steps div { display: flex; align-items: center; gap: 12px; color: #dfe4f3; }
.split-steps span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); font-weight: 700; font-size: .85rem; flex: none; }
.form-title { font-family: var(--display); font-weight: 600; font-size: 1.5rem; margin: 6px 0 4px; }
.form-section { font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); margin: 8px 0 0; }

.narrow { max-width: 640px; margin: 8px auto 0; }
.narrow > h1, .narrow.card h1 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; letter-spacing: -.02em; }
.narrow-left { max-width: 760px; }
.narrow-left .card + .card, .narrow-left form.card + .card, .narrow-left form.card + form.card { margin-top: 18px; }

/* ==========================================================================
   Панели (администратор и сервиз)
   ========================================================================== */
.panel { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 30px; align-items: start; }
.panel-main { min-width: 0; }
.panel-main > h1:first-child { margin-bottom: 22px; }
.sidebar {
  position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px;
  padding: 16px 12px; border-radius: 24px; background: var(--ink); color: #c7cde0;
  box-shadow: 0 30px 50px -30px rgba(10, 15, 36, .6);
}
.sidebar-cta { width: 100%; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #6b7699; font-weight: 700; padding: 6px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  color: #c7cde0; text-decoration: none; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item .icon { color: #8590b3; transition: color .15s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item:hover .icon { color: #fff; }
.nav-item.active { background: linear-gradient(135deg, rgba(99, 102, 241, .95), rgba(6, 182, 212, .8)); color: #fff; box-shadow: 0 10px 20px -12px rgba(99, 102, 241, .9); }
.nav-item.active .icon { color: #fff; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #dfe4f3; font-size: .75rem; font-weight: 600; text-align: center; line-height: 20px; }
.nav-badge-alert { background: #f43f5e; color: #fff; }

.stats { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); margin-bottom: 26px; }
.stat-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px;
  padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s;
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -18px rgba(14, 21, 48, .35); }
.stat-card span { color: var(--muted); font-size: .88rem; }
.stat-card small { font-size: .76rem; }
.stat-card strong { font-size: 2rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary) !important; margin-bottom: 10px; }
.stat-card.featured { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 20px 36px -18px rgba(79, 70, 229, .8); }
.stat-card.featured span { color: rgba(255, 255, 255, .85); }
.stat-card.featured .stat-icon { background: rgba(255, 255, 255, .2); color: #fff !important; }
.stat-card.featured::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -40px; bottom: -60px; }

.callout {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 18px;
  border-radius: 16px; background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); text-decoration: none;
  transition: transform .15s;
}
.callout:hover { transform: translateX(2px); }
.callout-go { margin-left: auto; font-weight: 700; white-space: nowrap; }

.quick { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.quick .filter { flex: 1; max-width: 460px; margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.list { list-style: none; margin: 0; padding: 4px 20px; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list-flat { padding: 0; margin: 0 0 12px; }
.clip-wrap { min-width: 0; }
.clip-wrap .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.grid-2 { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.panel .grid-2 { margin-bottom: 8px; }

.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill-overdue { background: var(--error-bg); color: var(--error-text); }
.pill-soon { background: #fff1d6; color: var(--warn-text); }
.pill-later { background: var(--primary-soft); color: var(--primary); }
.pill-km { background: #eef0f5; color: var(--muted); }
.pill-ok { background: var(--success-bg); color: var(--success-text); }
a.pill { text-decoration: none; margin-top: 4px; }

.filter { display: flex; gap: 8px; margin-bottom: 18px; max-width: 640px; }
.filter input { margin: 0; border-radius: 999px; padding-left: 18px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #f8f9fd; font-weight: 700; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fafbff; }
tr:last-child td { border-bottom: 0; }
td.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.wrap-text { max-width: 380px; white-space: pre-line; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }

.details { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: .95rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details-wide { grid-template-columns: 140px 1fr; }
.status { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; vertical-align: middle; }
.status-approved { background: var(--success-bg); color: var(--success-text); }
.status-blocked, .status-rejected { background: var(--error-bg); color: var(--error-text); }
.status-pending { background: #eef0f5; color: var(--muted); }
.delete-form { margin-top: 16px; text-align: right; }
.notes { white-space: pre-line; background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 0; }
.decision { margin-bottom: 18px; border-color: var(--warn-border); background: var(--warn-bg); }
.decision p { margin-top: 0; }
.temp-password {
  font-family: var(--mono); font-size: 1.7rem; font-weight: 700; letter-spacing: .14em; text-align: center;
  padding: 18px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); user-select: all;
}

/* Автомобил: карта, консумативи, избор на клиент */
.vehicle-summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--bg); }
.oil-box { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 16px; }
.oil-box > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--grad); color: #fff; }
.oil-box > div:last-child { background: var(--ink); }
.oil-box .muted { color: rgba(255, 255, 255, .75); }
.oil-box strong { font-size: 1.1rem; }
details.consumables { border: 1.5px dashed #d6dbea; border-radius: 14px; padding: 12px 16px; }
details.consumables[open] { border-style: solid; border-color: var(--border); }
details.consumables[open] > summary { margin-bottom: 12px; }
.client-picker { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 14px; background: var(--bg); }

/* ---------- Долна част ---------- */
.footer { background: var(--ink); color: #8e9bbd; padding: 52px 0 26px; margin-top: 0; }
.is-panel .footer, .main-pad + .footer { margin-top: 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand .brand-text { color: #fff; font-size: 1.05rem; }
.footer-brand .brand-text b { background: var(--grad-light); -webkit-background-clip: text; background-clip: text; }
.footer-brand p { max-width: 380px; margin: 12px 0 0; font-size: .92rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #c7cde0; text-decoration: none; font-size: .93rem; }
.footer-links a:hover { color: #fff; }
.footer-suggest {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 40px; padding: 22px 26px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(6, 182, 212, .12)); border: 1px solid rgba(129, 140, 248, .25);
}
.footer-suggest strong { display: block; color: #fff; font-size: 1.05rem; margin-bottom: 4px; }
.footer-suggest span { font-size: .92rem; }
.footer-suggest .btn { flex: none; }

/* Страница с резултата от проверката по номер */
.plate-page { padding: 34px 0 60px; }
.plate-page .page-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; margin: 6px 0 0; }
.plate-tag {
  display: inline-block; padding: 2px 14px; border-radius: 10px; border: 2px solid var(--text);
  font-family: var(--mono); letter-spacing: .08em; background: var(--surface); white-space: nowrap;
}
.plate-form { max-width: 460px; }
.plate-form input { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.check-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.check-card { display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--border); }
.check-card h2 { margin: 0; font-size: 1.08rem; }
.check-card .details { margin: 4px 0 0; grid-template-columns: 110px 1fr; }
.check-head { display: flex; align-items: center; gap: 10px; }
.check-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.check-status { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-weight: 700; }
.check-status.ok { color: var(--success-text); }
.check-status.bad { color: var(--error-text); }
.check-status.warn { color: var(--warn-text); }
.check-status.wait { color: var(--muted); }
.check-big { margin: 0; font-size: 1.05rem; }
.check-big strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.check-valid { border-top-color: #10b981; }
.check-none { border-top-color: #f43f5e; }
.check-error, .check-unknown { border-top-color: #f59e0b; }
.check-source { margin: auto 0 0; padding-top: 8px; font-size: .78rem; color: var(--muted); }
.check-card p { margin-top: 0; margin-bottom: 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gtp-form { display: flex; flex-direction: column; gap: 10px; }
.gtp-captcha { display: flex; align-items: center; gap: 8px; }
.gtp-captcha img { width: 108px; height: 58px; border-radius: 8px; border: 1px solid var(--border); background: #fff; image-rendering: auto; }
.gtp-row { display: flex; gap: 8px; }
.gtp-row input { margin: 0; flex: 1; min-width: 0; font-family: var(--mono); letter-spacing: .2em; text-transform: lowercase; }
.gtp-msg { margin: 0; min-height: 1.2em; color: var(--error-text); }
.mono { font-family: var(--mono); }
.plate-note { margin-top: 18px; }
@media (max-width: 960px) { .check-grid { grid-template-columns: 1fr; } }

/* Форма за предложения */
.choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.choice legend { font-weight: 600; font-size: .92rem; margin-bottom: 8px; padding: 0; }
.choice-item { position: relative; font-weight: 500; }
.choice-item input { position: absolute; opacity: 0; pointer-events: none; }
.choice-item span { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: background .12s, border-color .12s; }
.choice-item span:hover { border-color: var(--primary); }
.choice-item input:checked + span { background: var(--grad); color: #fff; border-color: transparent; }
.choice-item input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.suggestion-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.suggestion-head .muted { margin-left: auto; }
.suggestion-text { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 16px; }
.suggestion-new { border-color: var(--primary); }

.footer-bottom { margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .84rem; }

/* ==========================================================================
   Адаптивност
   ========================================================================== */
@media (max-width: 1080px) {
  .float-chip-2 { left: -4%; top: auto; bottom: 14%; }
}

@media (max-width: 960px) {
  .hero { padding: 120px 0 130px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { min-height: 380px; }
  .steps { grid-template-columns: 1fr; }
  .step-offset { transform: none; }
  .bento { grid-template-columns: 1fr; }
  .bento-side { transform: none; }
  .split { grid-template-columns: 1fr; }
  .split-aside { position: relative; top: 0; }

  .panel { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sidebar { position: static; min-width: 0; flex-direction: row; align-items: center; padding: 10px; border-radius: 18px; }
  .sidebar-cta { width: auto; flex: none; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .nav-group { flex-direction: row; margin: 0; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .topnav-link { display: none; }
  .hero h1 { font-size: 2rem; }
  .search-hero { flex-wrap: wrap; border-radius: 22px; }
  .search-hero input { flex-basis: calc(100% - 50px); }
  .search-hero .btn { width: 100%; }
  .search-compact { border-radius: 999px; flex-wrap: nowrap; }
  .search-compact .btn { width: auto; }
  .mock-book { transform: rotate(-2deg); }
  .float-chip-2 { left: 4%; top: auto; bottom: -3%; }
  .float-chip-3 { display: none; }
  .strip { grid-template-columns: 1fr; margin-top: -56px; }
  .strip-item + .strip-item { border-left: 0; border-top: 1px solid var(--border); }
  .section { padding-top: 72px; }
  .bento-main { padding: 30px 24px; }
  .benefits { grid-template-columns: 1fr; }
  .bento { margin-bottom: 72px; }

  .vhero { grid-template-columns: 1fr; padding: 28px 24px; }
  .vhero-stats { grid-template-columns: repeat(3, 1fr); }
  .vhero-stats div { min-width: 0; padding: 12px 8px; }
  .timeline::before { left: 8px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 16px 34px; }
  .tl-item:nth-child(n+2) { margin-top: 0; }
  .tl-dot, .tl-item:nth-child(even) .tl-dot { left: 0; right: auto; }

  .split-aside { padding: 28px 24px; }
  .grid-2, .row, .row-3 { grid-template-columns: 1fr; }
  .record-meta { flex-direction: row; }
  .clip-wrap .clip { max-width: 200px; }
}

@media (max-width: 520px) {
  .topnav-name { display: none; }
  .brand-text { font-size: .86rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 1.6rem; }
}

/* ==========================================================================
   График
   ========================================================================== */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: 6px; }
.dash-side > .card:first-child { margin-bottom: 8px; }
.sched-block { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.sched-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.sched-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.sched-head-out { margin: 28px 0 12px; }
.sched-today { border: 0; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.sched-overdue { background: var(--warn-bg); border-color: var(--warn-border); }
.sched-overdue h2 { color: var(--warn-text); }
.sched-overdue .hint { margin: -6px 0 12px; }
.sched-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 10px; color: var(--muted); text-align: center; }
.sched-empty p { margin: 0; }
.badge-alert { background: #f43f5e; color: #fff; }
.alert-info { background: var(--primary-soft); color: var(--text); border-color: transparent; }
.alert-info .icon { color: var(--primary); }

.appt-list { display: flex; flex-direction: column; gap: 10px; }
.appt-list-card { padding: 14px; }
.appt {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: start;
  padding: 14px 16px; border-radius: 16px; background: var(--bg); border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.appt:hover { border-color: var(--border); }
.appt-time { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); padding: 4px; }
.appt-time strong { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.appt-date { font-size: .72rem; color: var(--muted); font-weight: 600; }
.appt-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appt-title a { color: var(--text); }
.chip-mech { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .78rem; font-weight: 600; }
.appt-work { margin: 3px 0 4px; white-space: pre-line; }
.appt-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; color: var(--muted); }
.appt-meta .mono { font-size: .8rem; }
.appt-notes { margin-top: 6px; font-size: .85rem; color: var(--muted); font-style: italic; }
.appt-actions { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.appt-late { background: var(--surface); }
.appt-late .appt-time { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.appt-done, .appt-cancelled { opacity: .82; }
.appt-cancelled .appt-work { text-decoration: line-through; color: var(--muted); }

.days { display: flex; flex-direction: column; gap: 18px; }
.days .appt { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.day-head { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 8px; font-weight: 700; }
.day-actions { display: inline-flex; align-items: center; gap: 10px; }
.day-today .day-head > span:first-child { color: var(--primary); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.tab { padding: 7px 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad); color: #fff; }

/* Посещения */
.chart-card { margin-bottom: 22px; }
.chart-card h2, .visits-grid h2 { display: flex; align-items: center; gap: 8px; margin-top: 0; font-size: 1.05rem; }
.visits-grid h2 .icon { color: var(--primary); }
.visits-grid { margin-bottom: 26px; }
.vchart { display: flex; align-items: stretch; gap: 3px; height: 170px; padding-top: 6px; }
.vcol { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.vbar { width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: var(--grad); transition: opacity .12s; }
.vcol:hover .vbar { opacity: .75; }
.vbar-zero { height: 2px !important; background: var(--border); }
.vlabel { height: 18px; margin-top: 6px; font-size: .7rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; border-radius: 10px; overflow: hidden; }
.rank-bar { position: absolute; inset: 0 auto 0 0; background: var(--primary-soft); border-radius: 10px; }
.rank-label, .rank-value { position: relative; }
.rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.geo-credit { margin-top: 18px; }
.page-head .tabs { margin-bottom: 0; max-width: 100%; overflow-x: auto; }
.page-head .tab { white-space: nowrap; }
@media (max-width: 520px) {
  .vchart { gap: 2px; height: 140px; }
  .vlabel { font-size: .62rem; }
  .page-head .tabs { display: flex; width: 100%; overflow: visible; }
  .page-head .tab { flex: 1; text-align: center; padding: 7px 2px; font-size: .8rem; }
}
.email-hint { margin: -8px 0 0; }

.filter-stack { flex-direction: column; margin-bottom: 14px; }
.quick-links { display: flex; flex-direction: column; gap: 2px; }
.quick-links a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.quick-links a:hover { background: var(--bg); }
.quick-links .icon { color: var(--primary); }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .appt { grid-template-columns: 56px minmax(0, 1fr); }
  .appt-actions { grid-column: 1 / -1; }
  .sched-block { padding: 14px; }
}

/* ==========================================================================
   Тъмна тема (само за панелите)
   ========================================================================== */
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: #cdd3e3; }
.theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: block; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }

html[data-theme="dark"] body.is-panel {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #131a33;
  --text: #e6e9f5;
  --muted: #8f99b8;
  --border: #242e52;
  --primary: #8f93fb;
  --primary-soft: rgba(129, 140, 248, .15);
  --success-bg: rgba(16, 185, 129, .15);
  --success-text: #6ee7b7;
  --error-bg: rgba(244, 63, 94, .15);
  --error-text: #fda4af;
  --warn-bg: rgba(245, 158, 11, .1);
  --warn-border: rgba(245, 158, 11, .3);
  --warn-text: #fcd34d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .7);
}
html[data-theme="dark"] .is-panel .topbar { background: rgba(11, 16, 32, .78); border-bottom-color: #1c2547; }
html[data-theme="dark"] .is-panel .topnav-user:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .is-panel .theme-toggle:hover { border-color: #3a4672; }
html[data-theme="dark"] .is-panel input,
html[data-theme="dark"] .is-panel textarea,
html[data-theme="dark"] .is-panel select { background: #0e1530; border-color: #2a3459; color: var(--text); }
html[data-theme="dark"] .is-panel input:hover,
html[data-theme="dark"] .is-panel textarea:hover,
html[data-theme="dark"] .is-panel select:hover { border-color: #3a4672; }
html[data-theme="dark"] .is-panel input:focus,
html[data-theme="dark"] .is-panel textarea:focus,
html[data-theme="dark"] .is-panel select:focus { background: #101938; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(129, 140, 248, .18); }
html[data-theme="dark"] .is-panel input:disabled { background: #18203f; color: var(--muted); }
html[data-theme="dark"] .is-panel input::placeholder,
html[data-theme="dark"] .is-panel textarea::placeholder { color: #5f6a8c; }
html[data-theme="dark"] .is-panel th { background: #161e3c; }
html[data-theme="dark"] .is-panel tbody tr:hover td { background: #172045; }
html[data-theme="dark"] .is-panel .btn-ghost { background: #161e3c; border-color: #2a3459; color: var(--text); }
html[data-theme="dark"] .is-panel .btn-ghost:hover { background: #1b2448; border-color: #3a4672; }
html[data-theme="dark"] .is-panel .btn-secondary:hover { background: rgba(129, 140, 248, .24); }
html[data-theme="dark"] .is-panel .btn-danger { background: transparent; border-color: rgba(244, 63, 94, .4); color: #fb7185; }
html[data-theme="dark"] .is-panel .alert-success,
html[data-theme="dark"] .is-panel .alert-error { border-color: transparent; }
html[data-theme="dark"] .is-panel .pill-soon { background: rgba(245, 158, 11, .16); }
html[data-theme="dark"] .is-panel .pill-km,
html[data-theme="dark"] .is-panel .status-pending { background: #1d2547; }
html[data-theme="dark"] .is-panel tr.row-suspicious td { background: rgba(245, 158, 11, .07); }
html[data-theme="dark"] .is-panel details.consumables { border-color: #2a3459; }
html[data-theme="dark"] .is-panel .sidebar { background: #0e1430; border: 1px solid #1f2950; }
html[data-theme="dark"] .is-panel .oil-box > div:last-child { background: #1d2547; }
html[data-theme="dark"] .is-panel .footer { border-top: 1px solid #1c2547; }
html[data-theme="dark"] .is-panel .appt-time { background: #0e1530; }
html[data-theme="dark"] .is-panel .appt-late { background: #131a33; }
html[data-theme="dark"] .is-panel .appt-late .appt-time { background: rgba(245, 158, 11, .1); }
html[data-theme="dark"] .is-panel .sched-today { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; }
html[data-theme="dark"] .is-panel .brand-text b { background: var(--grad-light); -webkit-background-clip: text; background-clip: text; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
