/* ==========================================================================
   Billplix Motors - design system
   ========================================================================== */
:root {
  --font: "Plus Jakarta Sans", "Noto Sans Devanagari", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
}
/* ---- 4 themes (Figma: "Billplix Motors - Premium Themes") ---- */
:root, :root[data-theme="ivory"] {
  --bg: #F5F3EE;
  --bg-soft: #EEEAE1;
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --text: #15171C;
  --text-2: #3C4049;
  --muted: #7B7F88;
  --line: #E7E2D7;
  --line-strong: #D6D0C2;
  --primary: #1E3557;
  --primary-600: #162843;
  --primary-50: #E8EDF4;
  --primary-100: #D3DCE8;
  --on-primary: #FFFFFF;
  --accent: #B8893B;
  --accent-soft: #F6EEDF;
  --success: #1E8A5A;
  --success-50: #E5F3EC;
  --danger: #C0392B;
  --danger-50: #FBEAE7;
  --warning: #B7791F;
  --warning-50: #FBF1E0;
  --info: #2F6690;
  --info-50: #E6EFF6;
  --side: #12151C;
  --side-text: #A3A9B6;
  --side-active-bg: #232833;
  --side-active: #FFFFFF;
  --side-line: #1E222B;
  --hero-1: #1E3557;
  --hero-2: #0E1B30;
  --hero-text: #FFFFFF;
  --mark-a: #1E3557;
  --mark-b: #B8893B;
  --mark-text: #FFFFFF;
  --chart-1: #3A6EA5;
  --chart-2: #B8893B;
  --ring: rgba(30,53,87,.18);
  --violet: var(--accent);
  --violet-50: var(--accent-soft);
  --shadow-sm: 0 1px 2px rgba(16,18,24,.04);
  --shadow: 0 1px 2px rgba(16,18,24,.04), 0 12px 32px -12px rgba(16,18,24,.12);
  --shadow-lg: 0 24px 60px -16px rgba(16,18,24,.22);
  color-scheme: light;
}
:root[data-theme="sapphire"] {
  --bg: #F3F5FA;
  --bg-soft: #EBEFF7;
  --surface: #FFFFFF;
  --surface-2: #F7F9FD;
  --text: #0D1324;
  --text-2: #39425A;
  --muted: #6B7590;
  --line: #E3E8F2;
  --line-strong: #CDD5E4;
  --primary: #3B5BDB;
  --primary-600: #2F4AC0;
  --primary-50: #EDF1FF;
  --primary-100: #DBE3FF;
  --on-primary: #FFFFFF;
  --accent: #7C5CFF;
  --accent-soft: #F1EDFF;
  --success: #0CA678;
  --success-50: #E3F7F0;
  --danger: #E03131;
  --danger-50: #FDECEC;
  --warning: #E67700;
  --warning-50: #FFF3E0;
  --info: #1C7ED6;
  --info-50: #E7F2FC;
  --side: #FFFFFF;
  --side-text: #5B6476;
  --side-active-bg: #EEF2FF;
  --side-active: #3B5BDB;
  --side-line: #E3E8F2;
  --hero-1: #3B5BDB;
  --hero-2: #7048E8;
  --hero-text: #FFFFFF;
  --mark-a: #3B5BDB;
  --mark-b: #7C5CFF;
  --mark-text: #FFFFFF;
  --chart-1: #3B5BDB;
  --chart-2: #0CA678;
  --ring: rgba(59,91,219,.18);
  --violet: var(--accent);
  --violet-50: var(--accent-soft);
  --shadow-sm: 0 1px 2px rgba(16,18,24,.04);
  --shadow: 0 1px 2px rgba(16,18,24,.04), 0 12px 32px -12px rgba(16,18,24,.12);
  --shadow-lg: 0 24px 60px -16px rgba(16,18,24,.22);
  color-scheme: light;
}
:root[data-theme="midnight"] {
  --bg: #0A0F1E;
  --bg-soft: #131B30;
  --surface: #111A2E;
  --surface-2: #0E1628;
  --text: #E8EDF7;
  --text-2: #B9C4DA;
  --muted: #8592AD;
  --line: #1E2A44;
  --line-strong: #2A3858;
  --primary: #6E8BFF;
  --primary-600: #5C79F0;
  --primary-50: #1A2547;
  --primary-100: #22305C;
  --on-primary: #0A0F1E;
  --accent: #22D3EE;
  --accent-soft: #0E2B36;
  --success: #34D399;
  --success-50: #0F2A24;
  --danger: #F87171;
  --danger-50: #33181C;
  --warning: #FBBF24;
  --warning-50: #2F2612;
  --info: #38BDF8;
  --info-50: #0C2A3A;
  --side: #070B16;
  --side-text: #8592AD;
  --side-active-bg: #141E3A;
  --side-active: #FFFFFF;
  --side-line: #151E33;
  --hero-1: #1D2A5C;
  --hero-2: #3A2470;
  --hero-text: #FFFFFF;
  --mark-a: #6E8BFF;
  --mark-b: #22D3EE;
  --mark-text: #0A0F1E;
  --chart-1: #6E8BFF;
  --chart-2: #0FA697;
  --ring: rgba(110,139,255,.25);
  --violet: var(--accent);
  --violet-50: var(--accent-soft);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}
:root[data-theme="obsidian"] {
  --bg: #0B0B0D;
  --bg-soft: #18181B;
  --surface: #151517;
  --surface-2: #1B1B1E;
  --text: #F3EFE6;
  --text-2: #CFC9BC;
  --muted: #8F8A80;
  --line: #27262B;
  --line-strong: #38363C;
  --primary: #D4A85A;
  --primary-600: #C29340;
  --primary-50: #2A2419;
  --primary-100: #3A3020;
  --on-primary: #141210;
  --accent: #E7C98A;
  --accent-soft: #2A2419;
  --success: #5FC79A;
  --success-50: #15261F;
  --danger: #E2725B;
  --danger-50: #2E1815;
  --warning: #E7B24A;
  --warning-50: #2C2414;
  --info: #7FB7D9;
  --info-50: #16232B;
  --side: #08080A;
  --side-text: #8F8A80;
  --side-active-bg: #1E1A12;
  --side-active: #E7C98A;
  --side-line: #1A191C;
  --hero-1: #2B2216;
  --hero-2: #121010;
  --hero-text: #F3E6C8;
  --mark-a: #E7C98A;
  --mark-b: #B8893B;
  --mark-text: #141210;
  --chart-1: #C29340;
  --chart-2: #3AA68F;
  --ring: rgba(212,168,90,.25);
  --violet: var(--accent);
  --violet-50: var(--accent-soft);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1 { font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: -.03em; font-weight: 800; }
h2 { font-size: 16px; margin: 0 0 14px; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }

/* ------------------------------------------------------------------ shell */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; background: var(--side); border-right: 1px solid var(--side-line); color: var(--side-text); display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 18px; color: var(--side-active); }
.brand:hover { color: var(--side-active); }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 19px; color: var(--mark-text); background: linear-gradient(135deg, var(--mark-a) 0%, var(--mark-b) 100%); box-shadow: 0 8px 18px -8px var(--mark-b); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 18px; letter-spacing: -.02em; font-weight: 800; color: var(--side-active); }
.brand-text small { font-size: 10px; color: var(--side-text); letter-spacing: .18em; text-transform: uppercase; margin-top: 3px; font-weight: 700; }
.nav { flex: 1; overflow-y: auto; padding: 4px 16px 16px; scrollbar-width: thin; scrollbar-color: var(--side-active-bg) transparent; }
.nav-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--side-text); opacity: .7; padding: 18px 12px 6px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--side-text); font-weight: 500; position: relative; margin-bottom: 2px; transition: background .15s, color .15s; }
.nav-link .ic { width: 18px; height: 18px; }
.nav-link:hover { background: var(--side-active-bg); color: var(--side-active); }
.nav-link.active { background: var(--side-active-bg); color: var(--side-active); font-weight: 700; }
.nav-link.active::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-count { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: #ef4444; color: #fff; border-radius: 20px; padding: 1px 7px; }
.side-foot { padding: 16px; }
.plan-card { background: var(--side-active-bg); border-radius: 14px; padding: 14px; }
.plan-name { color: var(--side-active); font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-meta { font-size: 11.5px; color: var(--side-text); margin-top: 2px; }
.scrim { display: none; }
.main { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 76px; display: flex; align-items: center; gap: 12px; padding: 0 36px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px); }
.menu-btn { display: none; }
.search { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 13px; color: var(--muted); }
.search input { padding: 12px 44px 12px 42px; border-radius: 14px; background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.search kbd { position: absolute; right: 10px; font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; color: var(--text); padding: 4px 6px; border-radius: 12px; font: inherit; }
.user-btn:hover { background: var(--surface); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--accent); background: var(--accent-soft); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta small { color: var(--muted); font-size: 12px; }
.dropdown { position: relative; }
.dropdown .menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.dropdown .menu.right { left: auto; right: 0; }
.dropdown.open .menu { display: block; animation: pop .14s ease-out; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--bg-soft); }
.menu .ic { color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.content { padding: 8px 36px 28px; flex: 1; width: 100%; }
.foot { margin-top: 40px; text-align: center; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------------ page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.subtitle { color: var(--muted); margin: 6px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.back-link .ic { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ cards & grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ic { color: var(--primary); }
.grid { display: grid; gap: 0 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.cols { display: grid; gap: 18px; }
.cols.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols.c-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }
.mb { margin-bottom: 18px; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.req { color: var(--danger); font-weight: 700; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14px; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); }
input[type=file] { padding: 7px; background: var(--surface-2); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
input.upper { text-transform: uppercase; }
textarea { resize: vertical; }
.w80 { width: 90px; } .w120 { width: 140px; display: inline-block; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--bg-soft); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 8px 20px -10px var(--primary), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--primary-600); color: var(--on-primary); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { filter: brightness(.95); color: #fff; }
.btn.wa { background: #22c55e; border-color: #16a34a; color: #fff; }
.btn.wa:hover { background: #16a34a; color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--surface); }
.btn.danger:hover { background: var(--danger-50); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.tiny { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn.block { display: flex; width: 100%; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
form.inline { display: inline; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); padding: 14px 0; margin-top: 4px; border-top: 1px solid var(--line); z-index: 5; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.row-form > input, .row-form > select { width: auto; flex: 1 1 140px; }
.row-form.compact { margin: 0; flex-wrap: nowrap; }
.row-form.compact > * { flex: 0 1 auto; }
.row-form.compact input[name=notes] { min-width: 120px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.filters > input, .filters > select { width: auto; flex: 1 1 170px; }
.filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.filters label input { width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 6px 16px 6px 0; cursor: pointer; font-weight: 500; }
.checks { margin: 8px 0 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.right { text-align: right; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.warn { color: var(--warning); font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.party-picker { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 14px 14px 0; margin: 0 0 16px; background: var(--surface-2); }
.party-picker legend { font-weight: 650; padding: 0 6px; display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.party-picker legend .ic { width: 15px; height: 15px; color: var(--primary); }
.pay-fields { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 0; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.section-title .num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: 13px; }
.section-title h2 { margin: 0; }

/* ------------------------------------------------------------------ alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert .ic { margin-top: 1px; }
.alert.success { background: var(--success-50); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.alert.error { background: var(--danger-50); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert.info { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }
.alert.warning { background: var(--warning-50); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning); }
.alert div { color: var(--text-2); }

/* ------------------------------------------------------------------ KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--primary-100); transform: translateY(-1px); box-shadow: var(--shadow); color: var(--text); }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-icon .ic { width: 21px; height: 21px; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; width: 100%; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.tone-blue .kpi-icon { background: var(--primary-50); color: var(--primary); }
.kpi-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.tone-green .kpi-icon { background: var(--success-50); color: var(--success); }
.tone-amber .kpi-icon { background: var(--warning-50); color: var(--warning); }
.tone-red .kpi-icon { background: var(--danger-50); color: var(--danger); }
.tone-violet .kpi-icon { background: var(--violet-50); color: var(--violet); }
.tone-sky .kpi-icon { background: var(--info-50); color: var(--info); }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 32px; flex-wrap: wrap; padding: 30px 34px; border-radius: 22px; margin-bottom: 20px; color: var(--hero-text);
  background: linear-gradient(125deg, var(--hero-1), var(--hero-2)); box-shadow: 0 24px 48px -24px var(--hero-1); border: 1px solid color-mix(in srgb, var(--hero-text) 10%, transparent); }
.hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 65%); pointer-events: none; }
.hero-main { flex: 1; min-width: 240px; position: relative; z-index: 1; }
.hero-cap { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.hero-value { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; background: rgba(255, 255, 255, .14); }
.hero-chip .ic { width: 14px; height: 14px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stat { min-width: 150px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: var(--hero-text); }
a.hero-stat:hover { background: rgba(255, 255, 255, .14); color: var(--hero-text); }
.hero-stat span { display: block; font-size: 12px; opacity: .75; font-weight: 500; }
.hero-stat strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }

/* ------------------------------------------------------------------ theme switcher */
.lang-btn { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.lang-btn .ic { width: 16px; height: 16px; color: var(--muted); }
.lang-btn:hover { border-color: var(--primary); }
.lang-menu .menu a.active { color: var(--primary); font-weight: 700; }
.lang-menu .ic-space { display: inline-block; width: 16px; }
.auth-lang { position: absolute; top: 20px; right: 20px; z-index: 5; }
@media (max-width: 640px) { .lang-btn span { display: none; } .lang-btn { padding: 0 10px; } }
.theme-switch { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.theme-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; position: relative; }
.theme-dot[aria-pressed="true"] { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.theme-dot.t-ivory { background: linear-gradient(135deg, #F5F3EE 50%, #1E3557 50%); }
.theme-dot.t-sapphire { background: linear-gradient(135deg, #FFFFFF 50%, #3B5BDB 50%); }
.theme-dot.t-midnight { background: linear-gradient(135deg, #0A0F1E 50%, #6E8BFF 50%); }
.theme-dot.t-obsidian { background: linear-gradient(135deg, #0B0B0D 50%, #D4A85A 50%); }
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.theme-card { border: 2px solid var(--line); border-radius: 16px; padding: 10px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: var(--text); }
.theme-card[aria-pressed="true"] { border-color: var(--primary); }
.theme-card .prev { height: 90px; border-radius: 10px; margin-bottom: 8px; display: flex; overflow: hidden; }
.theme-card .prev i { display: block; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--surface-2); position: sticky; top: 0; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 20px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 20px; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tr.total td { font-weight: 700; background: var(--surface-2); }
.table tr.late td { background: color-mix(in srgb, var(--danger-50) 70%, transparent); }
.table tr.muted td { opacity: .55; }
.table .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.num-cell { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.v-cell { display: flex; align-items: center; gap: 12px; }
.thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-soft); display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.thumb .ic { width: 20px; height: 20px; }
.plate { display: inline-block; font: 700 12.5px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; background: #fffbea; color: #1a1a1a; border: 1.5px solid #1a1a1a; white-space: nowrap; }


/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--bg-soft); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.b-in_stock, .b-done, .b-cleared, .b-won, .b-converted, .b-disbursed { background: var(--success-50); color: var(--success); }
.b-booked, .b-pending, .b-applied, .b-follow_up, .b-active { background: var(--warning-50); color: var(--warning); }
.b-sold, .b-approved, .b-in_progress, .b-new { background: var(--primary-50); color: var(--primary); }
.b-rejected, .b-bounced, .b-lost, .b-cancelled { background: var(--danger-50); color: var(--danger); }
.b-hot { background: #ffe8e0; color: #e4572e; }
.b-na { background: var(--bg-soft); color: var(--muted); }
.chip-mode { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--bg-soft); color: var(--text-2); }
.m-cash { background: var(--success-50); color: var(--success); }
.m-upi { background: var(--violet-50); color: var(--violet); }
.m-bank, .m-dd { background: var(--info-50); color: var(--info); }
.m-cheque { background: var(--warning-50); color: var(--warning); }
.m-card { background: var(--primary-50); color: var(--primary); }
.m-finance { background: #ffe8f2; color: #c0266d; }
.tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--bg-soft); color: var(--text-2); margin: 0 4px 4px 0; }

/* ------------------------------------------------------------------ tabs / dl */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: var(--bg-soft); border-radius: 12px; overflow-x: auto; width: fit-content; max-width: 100%; }
.tabs a { padding: 8px 14px; color: var(--muted); border-radius: 9px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tabs a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.tabs a:hover { color: var(--text); }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 9px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.spec { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.spec span { display: block; font-size: 11.5px; color: var(--muted); }
.spec strong { font-size: 14px; font-weight: 650; }

/* ------------------------------------------------------------------ vehicle */
.v-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.gallery { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.gallery-main { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--bg-soft), var(--surface-2)); display: grid; place-items: center; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .ic { width: 72px; height: 72px; color: var(--line-strong); }
.gallery-strip { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-strip img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; flex: none; }
.gallery-strip img.on { border-color: var(--primary); }
.v-summary { display: flex; flex-direction: column; gap: 14px; }
.v-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.v-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); }
.price-tag { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.money-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.money-strip > div { background: var(--surface); padding: 12px 14px; }
.money-strip span { display: block; font-size: 12px; color: var(--muted); }
.money-strip strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 10px; background: var(--bg-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 10px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------------ lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.list .li-icon .ic { width: 17px; height: 17px; }
.list .li-body { flex: 1; min-width: 0; }
.list .li-body strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .li-body span { font-size: 12.5px; color: var(--muted); }
.list .li-end { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.list .li-end .sub { display: block; font-size: 12px; font-weight: 500; margin-top: 2px; }
.due-today .li-icon { background: var(--danger-50); color: var(--danger); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline .t-meta { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ chart */
.chart { width: 100%; height: 240px; }
.chart .bar-sale { fill: var(--chart-1); }
.chart .bar-profit { fill: var(--chart-2); }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .bar-hit:hover + .bar-tip, .chart g:hover .bar-sale, .chart g:hover .bar-profit { opacity: .85; }
.chart .axis { stroke: var(--line-strong); }
.chart-tip { position: fixed; pointer-events: none; background: var(--text); color: var(--surface); font-size: 12px; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 60; white-space: nowrap; line-height: 1.5; }
.legend .s1 { background: var(--chart-1); }
.legend .s2 { background: var(--chart-2); }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font: 11px var(--font); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars-h .row { display: grid; grid-template-columns: 150px 1fr 60px; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.bars-h .track { height: 10px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; }
.bars-h .track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--accent)); }

/* ------------------------------------------------------------------ empty / misc */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty-icon .ic { width: 26px; height: 26px; }
.empty h3 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 15px; margin: 0 0 4px; }
.empty p { margin-bottom: 14px; }
.calc-box { background: linear-gradient(135deg, var(--primary-50), var(--surface-2)); border: 1px solid var(--primary-100); border-radius: 12px; padding: 16px; }
.calc-row { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.calc-row.total { border-top: 1px dashed var(--line-strong); margin-top: 6px; padding-top: 10px; font-size: 17px; font-weight: 800; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.doc { text-align: center; }
.doc img, .doc .pdf { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--bg-soft); font-weight: 800; color: var(--danger); }
.doc .small { margin-top: 4px; font-weight: 600; }
.doc form { margin-top: 2px; }
.insp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.insp-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.insp-item .lbl { font-weight: 600; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 10px; font-size: 12.5px; cursor: pointer; border-right: 1px solid var(--line); font-weight: 600; color: var(--muted); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { color: #fff; }
.seg .r-good input:checked + span { background: var(--success); }
.seg .r-ok input:checked + span { background: var(--warning); }
.seg .r-poor input:checked + span { background: var(--danger); }
.seg .r-na input:checked + span { background: var(--muted); }
.stars { color: var(--accent); letter-spacing: 2px; }

/* ------------------------------------------------------------------ type picker */
.type-group { margin-bottom: 18px; }
.type-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.type-grid.big { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.type-card { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface); color: var(--text); position: relative; transition: border-color .15s, background .15s, box-shadow .15s; }
.type-card:hover { border-color: var(--primary-100); box-shadow: var(--shadow); color: var(--text); }
.type-card .t-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.type-card .t-txt { display: flex; flex-direction: column; min-width: 0; }
.type-card input { position: absolute; top: 12px; right: 12px; }
.type-card:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.type-card .tname { font-weight: 650; padding-right: 22px; }
.type-grid.big .type-card { padding: 18px; }
.quote { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; background: var(--primary-50); border: 1px solid var(--primary-100); border-radius: 12px; padding: 14px 16px; margin: 6px 0 24px; }
.quote label { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.quote .total { margin-left: auto; font-size: 20px; font-weight: 800; }

/* ------------------------------------------------------------------ auth */
body.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: var(--surface); }
.auth-side { background: radial-gradient(900px 500px at 110% -10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%), linear-gradient(150deg, var(--hero-1), var(--hero-2)); color: var(--hero-text); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .brand { padding: 0; color: var(--hero-text); }
.auth-side .brand-text strong { color: var(--hero-text); }
.auth-side .brand-text small { color: var(--hero-text); opacity: .7; }
.auth-side h2 { font-size: 36px; line-height: 1.15; color: var(--hero-text); letter-spacing: -.03em; margin: 0 0 14px; font-weight: 800; }
.auth-side p { color: var(--hero-text); opacity: .75; font-size: 15px; max-width: 440px; }
.auth-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 26px; max-width: 480px; }
.auth-feats div { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 13px; font-size: 13px; color: var(--hero-text); }
.auth-feats .ic { color: var(--accent); }
.auth-vehicles { display: flex; gap: 16px; color: var(--hero-text); opacity: .5; margin-top: 30px; }
.auth-vehicles .ic { width: 28px; height: 28px; }
.auth-main { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; overflow-y: auto; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box.wide { max-width: 860px; }
.auth-box h1 { font-size: 28px; margin-bottom: 6px; }
.auth-box .subtitle { margin-bottom: 24px; }
.auth-foot { text-align: center; color: var(--muted); margin-top: 18px; }

/* ------------------------------------------------------------------ public showroom */
body.showroom { background: var(--bg); }
.sr-head { background: linear-gradient(125deg, var(--hero-1), var(--hero-2)); color: var(--hero-text); padding: 34px 20px; }
.sr-wrap { max-width: 1180px; margin: 0 auto; }
.sr-head h1 { font-size: 30px; }
.sr-head p { color: var(--hero-text); opacity: .75; margin: 6px 0 0; }
.sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding: 24px 20px; }
.sr-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; color: var(--text); }
.sr-card:hover { box-shadow: var(--shadow); color: var(--text); }
.sr-img { aspect-ratio: 16 / 10; background: var(--bg-soft); display: grid; place-items: center; }
.sr-img img { width: 100%; height: 100%; object-fit: cover; }
.sr-img .ic { width: 54px; height: 54px; color: var(--line-strong); }
.sr-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sr-price { font-size: 20px; font-weight: 800; margin-top: auto; }

/* ------------------------------------------------------------------ legacy aliases */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); box-shadow: var(--shadow-sm); }
.stat .num { font-size: 20px; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .v-hero, .cols.c-main { grid-template-columns: 1fr; }
  body.auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 900px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.c2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 14px; gap: 10px; }
  .content { padding: 18px 16px; }
  .search kbd { display: none; }
  .hide-sm { display: none !important; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4, .cols.c3 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  h1 { font-size: 21px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi-value { font-size: 17px; }
  .dl { grid-template-columns: 120px 1fr; }
  .row-form.compact { flex-wrap: wrap; }
  .search input { font-size: 16px; }
  .auth-feats { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .bars-h .row { grid-template-columns: 100px 1fr 40px; }
  .quote .total { margin-left: 0; }
}

/* Hindi (Devanagari): no letter-spacing or forced caps, they break the joined letters */
:root[lang="hi"] body, :root[lang="hi"] body * { letter-spacing: 0 !important; }
:root[lang="hi"] body { line-height: 1.6; }

/* Settings > Invoice design */
.tpl-color { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tpl-color label { font-weight: 600; font-size: 13px; }
.tpl-color input[type="color"] { width: 46px; height: 36px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 18px; }
.tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover { border-color: var(--primary); }
.tpl-card.active { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.tpl-thumb { display: block; position: relative; height: 336px; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.tpl-thumb iframe { position: absolute; top: 0; left: 50%; width: 794px; height: 1123px; border: 0; transform: translateX(-50%) scale(.3); transform-origin: 50% 0; pointer-events: none; }
.tpl-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tpl-info p { margin: 0; flex: 1; }
.tpl-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tpl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dot); flex: none; }
.tpl-actions { display: flex; gap: 8px; margin-top: 4px; }
.tpl-actions form { margin: 0; }

/* used / new choice (signup, add vehicle) */
.cond-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.cond-card input[type="radio"] { position: absolute; top: 12px; right: 12px; }
.check-row { display: flex; flex-wrap: wrap; align-items: center; min-height: 42px; }
.badge.b-new-veh { background: var(--violet-50); color: var(--violet); }
[data-only][data-hidden="1"] { display: none !important; }

/* installer */
.install-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.install-checks li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.install-checks li.ok .ic { color: var(--success); }
.install-checks li.bad { color: var(--danger); font-weight: 600; }
.install-checks li.warn .ic { color: var(--warning); }
.auth-box > .brand .brand-text strong { color: var(--text); }
.auth-box > .brand .brand-text small { color: var(--muted); }

/* Super Admin */
.imp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-sm); background: var(--warning-50); color: var(--text); border: 1px solid var(--warning); }
.imp-bar > div { flex: 1; min-width: 200px; }
.imp-bar form { margin: 0; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.todo-list li { display: flex; align-items: center; gap: 10px; }
.todo-list li span { flex: 1; }
.todo-list li .ic { color: var(--danger); }
.kv-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv-row:last-child { border-bottom: 0; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.plan-opt { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.plan-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.plan-opt input { position: absolute; top: 14px; right: 14px; }
.plan-opt .amt { font-size: 22px; font-weight: 800; }
.plan-opt .save { font-size: 12px; font-weight: 700; color: var(--success); }
.pay-methods { display: flex; flex-wrap: wrap; gap: 10px; }
.secret-hint { font-size: 12px; color: var(--muted); }
.wagw-box [hidden] { display: none !important; }
.wagw-qr { display: inline-block; background: var(--surface); padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.wagw-qr svg { width: 240px; height: 240px; display: block; }
.wagw-code { font: 700 30px/1.2 ui-monospace, monospace; letter-spacing: 4px; margin: 6px 0; }

/* SaaS admin bits */
.wagw-state { font-weight: 600; }
.wagw-state.is-ok { color: var(--success); }
.wagw-state.is-bad { color: var(--danger); }
.gw-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.gw-box h3 { margin-top: 0; }
.code-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; font: 13px/1.5 ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; }
.w160 { width: 160px; max-width: 100%; }
.pad { padding: 14px 16px; }
.team-perms { display: grid; gap: 6px; }
.team-perms .check { margin-right: 10px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
.pager a { min-width: 34px; padding: 6px 10px; text-align: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; }
.pager a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.upi-qr { width: 180px; margin: 8px 0; }
.upi-qr svg { width: 100%; height: auto; display: block; }
.manual-pay { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.manual-pay summary { cursor: pointer; font-weight: 600; }
.pre-line { white-space: pre-line; }

/* Public home page */
body.landing { background: var(--bg); color: var(--text); }
.ln-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 48px); flex-wrap: wrap; }
.ln-top .brand { padding: 0; }
.ln-top nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ln-top nav > a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.ln-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; margin: 12px clamp(16px, 4vw, 48px) 0; padding: clamp(28px, 5vw, 64px);
  border-radius: 24px; color: var(--hero-text); background: radial-gradient(900px 500px at 110% -10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%), linear-gradient(150deg, var(--hero-1), var(--hero-2)); }
.ln-hero h1 { font-size: clamp(28px, 4.4vw, 48px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; }
.ln-hero p { font-size: 17px; opacity: .9; max-width: 620px; }
.ln-hero .muted { color: inherit; opacity: .7; }
.ln-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 10px; }
.ln-hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ln-hero-art svg { width: 100%; height: 64px; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--hero-text) 10%, transparent); }
.ln-sec { padding: 48px clamp(16px, 4vw, 48px) 8px; }
.ln-sec h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.01em; margin: 0 0 8px; }
.ln-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.ln-feat h3 { margin: 12px 0 6px; font-size: 16px; }
.ln-feat p { margin: 0; font-size: 14px; }
.ln-price-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.ln-price-groups h3 { margin-top: 0; }
.ln-price-groups .kv-row svg { width: 16px; height: 16px; vertical-align: -3px; }
.ln-price-groups .kv-row strong { text-align: right; }
.ln-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 36px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); margin-top: 40px; }
@media (max-width: 800px) { .ln-hero { grid-template-columns: 1fr; } .ln-hero-art { display: none; } }

/* Customer payment page */
body.pay-page { background: var(--bg); color: var(--text); min-height: 100vh; }
.pay-wrap { max-width: 480px; margin: 0 auto; padding: 32px 16px; }
.pay-biz { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pay-biz > div { display: flex; flex-direction: column; }
.pay-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
.pay-amount { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 18px; }
.pay-page .pay-methods { flex-direction: column; }
.pay-page .pay-methods .btn { width: 100%; justify-content: center; }
.pay-foot { text-align: center; margin-top: 14px; }
.narrow-card { max-width: 560px; }
.ln-top .brand-text strong { color: var(--text); }
.ln-top .brand-text small { color: var(--muted); }
.ln-feat h3, .ln-price-groups h3 { text-transform: none; letter-spacing: -.01em; font-size: 16px; color: var(--text); font-weight: 700; }
.ln-price-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.ln-price-groups .kv-row { align-items: flex-start; gap: 12px; }
.ln-price-groups .kv-row > span { flex: 1; min-width: 0; }
.ln-price-groups .kv-row > strong { white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.ln-price-groups .kv-row .sub { font-weight: 500; font-size: 12px; color: var(--muted); }

/* New sale: pick a vehicle */
.sale-search input[name=q] { flex: 1 1 260px; }
.sale-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; margin-bottom: 18px; }
.sale-car { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 0; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.sale-car:hover { border-color: var(--primary); transform: translateY(-1px); }
.sale-car-img { width: 84px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; color: var(--muted); }
.sale-car-img img { width: 100%; height: 100%; object-fit: cover; }
.sale-car-img .ic { width: 28px; height: 28px; }
.sale-car-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sale-car-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sale-booked { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--warning); }
.sale-booked .ic { width: 14px; height: 14px; }
.sale-car-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.sale-price { font-weight: 800; font-size: 15px; }
@media (max-width: 520px) { .sale-car { gap: 10px; padding: 10px; } .sale-car-img { width: 60px; height: 50px; } }

/* Ready to sell: vehicles getting ready (service, repair, cleaning, papers) */
.badge.b-preparing { background: var(--warning-50); color: var(--warning); }
.prep-card { border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.prep-count { font-weight: 700; color: var(--warning); }
.prep-bar { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; margin: 4px 0 12px; }
.prep-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--warning), var(--success)); }
.prep-checks, .prep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px 16px; margin: 10px 0 6px; }
.prep-list[hidden] { display: none; }
.prep-list > p { grid-column: 1 / -1; margin: 0; }
.prep-checks .check { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.prep-checks .check.is-done { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); background: var(--success-50); }
