/* ============================================================
   AutoHub design system
   ============================================================ */
:root {
    --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f8fafc; --border: #e4e9f2; --border-strong: #d3dbe8;
    --text: #0f172a; --text-2: #334155; --muted: #64748b;
    --primary: #4f46e5; --primary-600: #4338ca; --primary-soft: #eef2ff; --primary-text: #ffffff;
    --success: #15803d; --success-soft: #dcfce7;
    --warning: #b45309; --warning-soft: #fef3c7;
    --danger: #b91c1c; --danger-soft: #fee2e2;
    --info: #0369a1; --info-soft: #e0f2fe;
    --purple: #7e22ce; --purple-soft: #f3e8ff;
    --sidebar: #0b1220; --sidebar-2: #131c31; --sidebar-text: #9aa6bd; --sidebar-active: #ffffff;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .22);
    --radius: 14px; --radius-sm: 10px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[data-theme='dark'] {
    --bg: #0a0f1d; --surface: #111a2e; --surface-2: #0e1628; --border: #1d2943; --border-strong: #2a3a5c;
    --text: #e8ecf6; --text-2: #c3cce0; --muted: #8592ae;
    --primary: #818cf8; --primary-600: #6366f1; --primary-soft: #1b2347; --primary-text: #0b1020;
    --success: #4ade80; --success-soft: #0f2d1d;
    --warning: #fbbf24; --warning-soft: #33260a;
    --danger: #f87171; --danger-soft: #3a1414;
    --info: #38bdf8; --info-soft: #0b2a3d;
    --purple: #c084fc; --purple-soft: #2a1745;
    --sidebar: #070b15; --sidebar-2: #0f1728;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 800; } h2 { font-size: 1.35rem; font-weight: 700; } h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; } a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .strong { font-weight: 700; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; } .mt-lg { margin-top: 1.5rem; } .mb { margin-bottom: 1rem; }
.icon { flex-shrink: 0; vertical-align: middle; }
::selection { background: var(--primary); color: var(--primary-text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 252px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; transition: width .2s ease; z-index: 40; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; color: #fff; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #6366f1, #a855f7); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px rgba(99, 102, 241, .45); flex-shrink: 0; }
.brand-logo.lg { width: 56px; height: 56px; border-radius: 16px; }
.brand-text { font-weight: 800; font-size: 1.1rem; display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-weight: 500; font-size: .7rem; color: var(--sidebar-text); letter-spacing: .04em; margin-top: 3px; }
.nav { flex: 1; overflow-y: auto; padding: .5rem .75rem; display: flex; flex-direction: column; gap: 2px; }
.nav-section { text-transform: uppercase; font-size: .66rem; letter-spacing: .1em; padding: 1rem .75rem .35rem; color: #5d6a85; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; border-radius: 10px; color: var(--sidebar-text); font-weight: 500; background: none; border: 0; cursor: pointer; font: inherit; width: 100%; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .08)); color: var(--sidebar-active); box-shadow: inset 3px 0 0 #818cf8; }
.sidebar-foot { padding: .75rem; border-top: 1px solid var(--sidebar-2); }
.app.collapsed .sidebar { width: 76px; }
.app.collapsed .brand-text, .app.collapsed .nav-item span, .app.collapsed .nav-section { display: none; }
.app.collapsed .nav-item { justify-content: center; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 1rem; padding: 0 1.75rem; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.topbar-title { font-weight: 500; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.menu-btn { display: none; }
.content { padding: 1.75rem; max-width: 1480px; width: 100%; margin: 0 auto; flex: 1; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: .6rem; background: none; border: 1px solid var(--border); border-radius: 999px; padding: .25rem .7rem .25rem .25rem; cursor: pointer; color: var(--text); font: inherit; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta small { color: var(--muted); font-size: .72rem; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 210px; padding: .35rem; z-index: 60; }
.dropdown-item { display: flex; gap: .6rem; align-items: center; padding: .6rem .75rem; border-radius: 8px; color: var(--text); background: none; border: 0; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.dropdown-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-scrim { position: fixed; inset: 0; z-index: 55; }
.mobile-scrim { display: none; }

/* ---------- page header ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header p { margin-top: .25rem; }
.page-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: .75rem; }
.card-title { font-weight: 700; font-size: 1rem; }
.grid { display: grid; gap: 1.25rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2-1 { grid-template-columns: 2fr 1fr; } .cols-1-2 { grid-template-columns: 1fr 2fr; }
.row { display: flex; align-items: center; } .gap { gap: .75rem; } .between { justify-content: space-between; } .center { justify-content: center; } .wrap { flex-wrap: wrap; } .end { justify-content: flex-end; }

/* kpi */
.kpi { display: flex; gap: 1rem; align-items: flex-start; position: relative; overflow: hidden; }
.kpi-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.kpi-icon.green { background: var(--success-soft); color: var(--success); } .kpi-icon.amber { background: var(--warning-soft); color: var(--warning); } .kpi-icon.blue { background: var(--info-soft); color: var(--info); } .kpi-icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin: .1rem 0; }
.trend { font-size: .8rem; font-weight: 600; } .trend.up { color: var(--success); } .trend.down { color: var(--danger); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .58rem 1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; transition: transform .05s, background .15s, box-shadow .15s, border-color .15s; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: translateY(1px); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-text); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); } .btn-primary:hover:not(:disabled) { background: var(--primary-600); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); } .btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; } .btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-success { background: var(--success); color: #fff; } [data-theme='dark'] .btn-success { color: #052e16; }
.btn-soft-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: .35rem .65rem; font-size: .82rem; border-radius: 8px; } .btn-lg { padding: .8rem 1.25rem; font-size: 1rem; } .btn-block { width: 100%; }
.btn-icon { background: none; border: 0; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; transition: background .15s, color .15s; flex-shrink: 0; }
.btn-icon:hover { background: var(--surface-2); color: var(--text); } .btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-icon.sm { width: 30px; height: 30px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; min-width: 0; }
.field label { font-weight: 600; font-size: .82rem; color: var(--text-2); }
.input, select.input, textarea.input, .field input, .field select, .field textarea { width: 100%; padding: .62rem .8rem; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 92px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.input-group { position: relative; display: flex; align-items: center; } .input-group .btn-icon { position: absolute; right: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.25rem; } .form-grid.three { grid-template-columns: repeat(3, 1fr); } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.validation-message, .field-error { color: var(--danger); font-size: .78rem; }
.invalid { border-color: var(--danger) !important; }
.form-section { font-weight: 700; margin: .5rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.checkbox { display: flex; align-items: center; gap: .5rem; cursor: pointer; } .checkbox input { width: auto; }
.search-box { position: relative; flex: 1; min-width: 220px; } .search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); } .search-box input { padding-left: 2.4rem; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.25rem; padding: 1rem; }
.filters select, .filters input { width: auto; min-width: 140px; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.filters .search-box input { width: 100%; }
.filters-more { display: flex; flex-wrap: wrap; gap: .75rem; width: 100%; padding-top: .75rem; border-top: 1px dashed var(--border); }
.filters-more input[type=number] { width: 120px; min-width: 0; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .85rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; } .table tbody tr:hover { background: var(--surface-2); } .table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.cell-user { display: flex; align-items: center; gap: .75rem; } .cell-user .avatar { width: 36px; height: 36px; font-size: .75rem; }
.cell-user small { display: block; color: var(--muted); }
.thumb { width: 56px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.table-foot { padding: 0 1rem; }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); } .badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.purple { background: var(--purple-soft); color: var(--purple); } .badge.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; } .chip { background: var(--surface-2); border: 1px solid var(--border); padding: .2rem .6rem; border-radius: 8px; font-size: .76rem; color: var(--text-2); font-weight: 500; }
.chip.primary { background: var(--primary-soft); border-color: transparent; color: var(--primary); }

/* ---------- alerts / empty / loaders ---------- */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.alert-danger { background: var(--danger-soft); color: var(--danger); } .alert-info { background: var(--info-soft); color: var(--info); } .alert-warning { background: var(--warning-soft); color: var(--warning); }
.empty { text-align: center; padding: 3.5rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: .5rem; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--primary); animation: spin .7s linear infinite; display: inline-block; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
.spinner-wrap { display: grid; place-items: center; padding: 4rem 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1.25rem; background: var(--bg); }
.splash-logo { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.8rem; }

/* ---------- modal / toast / confirm ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 24, .55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 1rem; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; border: 1px solid var(--border); }
.modal.lg { max-width: 760px; } .modal.xl { max-width: 980px; } .modal.sm { max-width: 400px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.25rem; overflow-y: auto; }
.confirm { text-align: center; display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.confirm-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); } .confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm .row { margin-top: .75rem; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toast-host { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: .6rem; z-index: 200; }
.toast { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); min-width: 260px; max-width: 380px; animation: pop .2s ease; font-weight: 500; }
.toast-success { border-left: 4px solid var(--success); } .toast-success .icon { color: var(--success); }
.toast-danger { border-left: 4px solid var(--danger); } .toast-danger .icon { color: var(--danger); }
.toast-info { border-left: 4px solid var(--info); } .toast-info .icon { color: var(--info); }

/* ---------- pager / tabs ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; padding: 1rem; gap: 1rem; flex-wrap: wrap; } .pager-btns { display: flex; gap: .3rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tab { padding: .7rem 1rem; background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); } .tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.segmented button { border: 0; background: none; padding: .35rem .7rem; border-radius: 8px; cursor: pointer; color: var(--muted); font: inherit; font-weight: 600; display: flex; align-items: center; gap: .35rem; }
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- inventory ---------- */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.car-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: inherit; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s, border-color .18s; text-decoration: none !important; }
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.car-img { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); display: grid; place-items: center; color: var(--primary); overflow: hidden; }
.car-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; } .car-card:hover .car-img img { transform: scale(1.05); }
.car-img .badge { position: absolute; top: 12px; left: 12px; box-shadow: var(--shadow-sm); backdrop-filter: blur(6px); }
.car-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.car-title { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.car-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .6rem; border-top: 1px dashed var(--border); }
.price { font-size: 1.2rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; }

.gallery-main { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); display: grid; place-items: center; color: var(--primary); position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .75rem; overflow-x: auto; padding-bottom: .25rem; }
.gallery-thumb { position: relative; width: 92px; height: 66px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; flex-shrink: 0; padding: 0; background: none; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; } .gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb .star { position: absolute; top: 3px; left: 3px; background: rgba(0, 0, 0, .55); color: #fbbf24; border-radius: 6px; padding: 1px 3px; display: grid; }
.img-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: .4rem; }
.img-tools .btn { box-shadow: var(--shadow); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.spec { display: flex; gap: .7rem; align-items: center; padding: .85rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.spec .icon-box { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.spec small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; } .spec strong { font-size: .95rem; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .55rem 1rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.price-hero { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; }
.upload-zone { display: inline-flex; position: relative; overflow: hidden; } .upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* ---------- charts / progress ---------- */
.chart { width: 100%; height: 240px; } .chart-grid { stroke: var(--border); stroke-dasharray: 4 4; } .chart-bar { fill: color-mix(in srgb, var(--primary) 45%, transparent); transition: fill .15s; } .chart-bar:hover, .chart-bar.current { fill: var(--primary); } .chart-label { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.donut { width: 160px; height: 160px; border-radius: 50%; position: relative; flex-shrink: 0; } .donut::after { content: ''; position: absolute; inset: 24px; background: var(--surface); border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; } .donut-center strong { font-size: 1.6rem; line-height: 1; } .donut-center small { color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: .6rem; flex: 1; } .legend-item { display: flex; align-items: center; gap: .6rem; } .legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; } .legend-item span:last-child { margin-left: auto; font-weight: 700; }
.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; min-width: 90px; } .progress > div { height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); border-radius: 99px; } .progress.done > div { background: var(--success); }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: .78rem; flex-shrink: 0; }
.list-row { display: flex; align-items: center; gap: .85rem; padding: .75rem 0; border-bottom: 1px solid var(--border); } .list-row:last-child { border-bottom: 0; } .list-row .grow { flex: 1; min-width: 0; }
.summary { display: flex; flex-direction: column; gap: .6rem; } .summary .line { display: flex; justify-content: space-between; } .summary .total { font-size: 1.15rem; font-weight: 800; padding-top: .75rem; border-top: 1px solid var(--border); }

/* ---------- auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-hero { background: radial-gradient(circle at 20% 15%, #6366f1 0, transparent 45%), radial-gradient(circle at 85% 85%, #a855f7 0, transparent 40%), #0b1220; color: #fff; display: flex; align-items: center; padding: 3rem; }
.auth-hero-inner { max-width: 480px; display: flex; flex-direction: column; gap: 1.25rem; } .auth-hero h1 { font-size: 2.8rem; } .auth-hero .lead { font-size: 1.15rem; color: #cbd5e1; }
.auth-points { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .75rem; color: #e2e8f0; } .auth-points li { display: flex; gap: .65rem; align-items: center; } .auth-points .icon { color: #86efac; }
.auth-card-wrap { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2.25rem; box-shadow: var(--shadow); } .auth-card h2 { margin-bottom: .25rem; } .auth-card .muted { margin-bottom: 1.5rem; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; }

/* ---------- misc ---------- */
#blazor-error-ui { background: var(--danger-soft); color: var(--danger); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.invoice-only { display: none; }

@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2, 1fr); } .cols-2-1, .cols-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
    .sidebar { position: fixed; left: -280px; width: 264px; transition: left .22s; } .app.mobile-open .sidebar { left: 0; }
    .app.mobile-open .mobile-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 35; }
    .menu-btn { display: inline-grid; } .content { padding: 1rem; } .topbar { padding: 0 1rem; } .user-meta { display: none; }
    .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } .form-grid, .form-grid.three { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; }
    .auth-shell { grid-template-columns: 1fr; } .auth-hero { display: none; } .kv { grid-template-columns: 110px 1fr; }
}
@media print {
    .sidebar, .topbar, .page-actions, .btn, .toast-host, .no-print { display: none !important; }
    body { background: #fff; color: #000; } .content { padding: 0; max-width: none; } .card { box-shadow: none; border-color: #ccc; } .invoice-only { display: block; }
}

/* ---------- brand logo ---------- */
.brand-img { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: block; }
.auth-logo { width: min(400px, 100%); margin-left: -10px; display: block; }
.mobile-logo { display: none; width: 72px; height: 72px; margin: 0 auto 14px; }
.powered { text-align: center; margin-top: 1.25rem; }
.splash img { width: 72px; height: 72px; border-radius: 18px; }
@media (max-width: 860px) { .mobile-logo { display: block; } }

/* ---------- multitenancy ---------- */
.tenant-chip { display: flex; align-items: center; gap: .5rem; padding: .25rem .8rem .25rem .3rem; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; font-size: .85rem; background: var(--surface); }
.tenant-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.tenant-mono { width: 28px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: .72rem; flex-shrink: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; font-size: .78rem; color: var(--text-2); }
.logo-preview { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-weight: 800; font-size: 1.6rem; }
.tenant-found { font-size: .82rem; font-weight: 600; margin-top: .15rem; } .tenant-found.ok { color: var(--success); } .tenant-found.bad { color: var(--danger); }
@media (max-width: 860px) { .tenant-chip span.name { display: none; } }
