:root {
  color-scheme: dark;
  --bg: #081018;
  --surface: #0d1620;
  --surface-2: #111c28;
  --surface-3: #162330;
  --line: #22313e;
  --line-soft: rgba(255,255,255,.07);
  --text: #f6f8fa;
  --muted: #8f9ca8;
  --gold: #d89a16;
  --gold-soft: #ffb33a;
  --orange: #ff8f32;
  --blue: #42aeea;
  --cyan: #45c7d8;
  --green: #3dd598;
  --red: #ff5d67;
  --purple: #b78cff;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
  --radius: 18px;
  --sidebar: 232px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 82% 8%, rgba(66,174,234,.08), transparent 28%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; overflow: hidden; background: linear-gradient(145deg, #070c12, #0d1721); }
.login-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(80px); opacity: .18; pointer-events: none; }
.login-glow-one { background: var(--gold); top: -190px; left: -120px; }
.login-glow-two { background: var(--blue); bottom: -210px; right: -100px; }
.login-card { width: min(610px, 100%); position: relative; z-index: 1; padding: 34px; border: 1px solid rgba(255,255,255,.09); border-radius: 26px; background: rgba(13,22,32,.9); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-brand { display: flex; align-items: center; gap: 20px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line-soft); }
.login-brand img { width: 245px; height: 74px; object-fit: contain; object-position: left center; filter: brightness(1.1); }
.login-brand > span { margin-left: auto; color: var(--gold-soft); font-size: 12px; font-weight: 800; letter-spacing: .18em; white-space: nowrap; }
.eyebrow { margin: 0 0 7px; color: var(--gold-soft); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 43px); letter-spacing: -.04em; }
h2 { margin-bottom: 7px; font-size: clamp(22px, 2.4vw, 31px); letter-spacing: -.035em; }
h3 { margin-bottom: 6px; font-size: 16px; }
.login-copy, .form-copy { color: var(--muted); line-height: 1.65; }
.login-form { display: grid; gap: 14px; margin-top: 22px; }
.login-form label, .filter-panel label { display: grid; gap: 7px; }
.login-form label span, .filter-panel label span, .form-group > span { color: #c7d0d8; font-size: 11px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--text); background: #0a131c; transition: border .2s, box-shadow .2s, background .2s; }
textarea { padding-top: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(255,179,58,.8); box-shadow: 0 0 0 3px rgba(216,154,22,.12); background: #0d1721; }
input::placeholder, textarea::placeholder { color: #53616c; }
.primary-btn, .small-btn, .ghost-btn, .tool-btn, .icon-btn, .inline-btn, .text-btn { border: 0; border-radius: 10px; transition: transform .18s, background .18s, opacity .18s, border .18s; }
.primary-btn { min-height: 47px; padding: 0 18px; color: #171107; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); font-weight: 850; box-shadow: 0 12px 28px rgba(216,154,22,.16); }
.primary-btn.large { min-height: 54px; font-size: 15px; }
.primary-btn:hover, .small-btn:hover, .ghost-btn:hover, .tool-btn:hover, .icon-btn:hover { transform: translateY(-1px); }
.small-btn { min-height: 38px; padding: 0 14px; color: #171107; background: var(--gold-soft); font-size: 12px; font-weight: 850; }
.ghost-btn, .tool-btn, .icon-btn { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); color: #dfe6eb; background: #101a24; font-size: 12px; font-weight: 700; }
.icon-btn { width: 39px; padding: 0; display: inline-grid; place-items: center; }
.full { width: 100%; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.form-status { min-height: 20px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-status.success { color: var(--green); }
.form-status.error { color: var(--red); }
.demo-login { margin-top: 25px; padding-top: 21px; border-top: 1px solid var(--line-soft); }
.demo-login-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.demo-login-head strong { font-size: 13px; }
.demo-login-head small { color: var(--muted); }
.demo-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.demo-role { display: flex; align-items: center; gap: 10px; min-height: 74px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); text-align: left; background: #0a131c; }
.demo-role:hover { border-color: rgba(255,179,58,.65); background: #101a23; }
.role-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #171107; background: var(--gold-soft); font-weight: 900; }
.demo-role strong, .demo-role small { display: block; }
.demo-role small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.offline-ready-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.status-dot { width: 9px; height: 9px; display: inline-block; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(61,213,152,.1); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #080f16; box-shadow: 20px 0 55px rgba(0,0,0,.14); }
.sidebar-brand { min-height: 96px; display: flex; align-items: center; gap: 12px; padding: 16px 16px; border-bottom: 1px solid var(--line-soft); }
.sidebar-brand img { width: auto; height: 58px; max-width: 48px; object-fit: contain; object-position: center center; border-radius: 0; flex: 0 0 auto; display: block; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { color: var(--gold-soft); font-size: 9px; letter-spacing: .12em; }
.sidebar-brand small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.sidebar-brand > div { min-width: 0; }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav-label { padding: 12px 10px 7px; color: #53616e; font-size: 8px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; margin-bottom: 4px; padding: 0 12px; border: 0; border-radius: 9px; color: #9aa8b4; text-align: left; background: transparent; font-size: 11px; font-weight: 700; }
.nav-item:hover { color: var(--text); background: #101a24; }
.nav-item.active { color: #fff2dc; background: linear-gradient(90deg, rgba(216,154,22,.24), rgba(216,154,22,.08)); box-shadow: inset 3px 0 0 var(--gold-soft); }
.nav-icon { width: 18px; text-align: center; color: var(--gold-soft); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-soft); }
.sync-mini { display: flex; gap: 10px; align-items: center; margin-bottom: 11px; padding: 10px; border-radius: 10px; background: #0d1720; }
.sync-mini strong, .sync-mini small { display: block; }
.sync-mini strong { font-size: 10px; }
.sync-mini small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.app-main { min-width: 0; grid-column: 2; }
.topbar { min-height: 84px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 22px; border-bottom: 1px solid var(--line); background: rgba(8,16,24,.91); backdrop-filter: blur(18px); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left h1 { margin: 0 0 2px; font-size: 18px; letter-spacing: -.025em; }
.topbar-left small { color: var(--muted); font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.account-chip { display: flex; align-items: center; gap: 9px; min-width: 150px; padding: 6px 10px 6px 7px; border: 1px solid var(--line); border-radius: 12px; background: #101a24; }
.account-chip > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #1a1205; background: var(--gold-soft); font-size: 12px; font-weight: 900; }
.account-chip strong, .account-chip small { display: block; white-space: nowrap; }
.account-chip strong { font-size: 10px; }
.account-chip small { margin-top: 2px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .12em; }
.sync-badge { min-height: 37px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: #cbd3d9; background: #101a24; font-size: 10px; font-weight: 700; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.sync-badge.online .sync-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(61,213,152,.1); }
.sync-badge.syncing .sync-dot { background: var(--gold-soft); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .32; transform: scale(.75); } }
.workspace { padding: 18px 21px 44px; }
.page-view { max-width: 1600px; margin: 0 auto; }
.data-flow-banner { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 auto 13px; padding: 8px 42px 8px 13px; position: relative; border: 1px solid rgba(66,174,234,.18); border-radius: 12px; background: linear-gradient(90deg, rgba(66,174,234,.08), rgba(216,154,22,.06)); }
.data-flow-banner > div { display: flex; align-items: center; gap: 7px; }
.data-flow-banner strong { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #161007; background: var(--gold-soft); font-size: 10px; }
.data-flow-banner span { color: #bdc8d0; font-size: 10px; font-weight: 700; }
.data-flow-banner i { color: #53636f; font-style: normal; }
.data-flow-banner button { position: absolute; right: 10px; width: 26px; height: 26px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.filter-panel { max-width: 1600px; display: grid; grid-template-columns: minmax(150px,1.1fr) repeat(6,minmax(105px,.72fr)) auto auto; gap: 9px; align-items: end; margin: 0 auto 16px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.filter-status { align-self: center; min-width: 0; }
.filter-status strong, .filter-status small { display: block; }
.filter-status strong { display: inline; font-size: 10px; }
.filter-status small { margin-top: 4px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { margin-right: 5px; color: var(--green); }
.filter-panel input, .filter-panel select { min-height: 36px; padding: 0 9px; font-size: 10px; }
.filter-panel label span { font-size: 9px; }
.dashboard-title-row, .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-head.compact { margin-bottom: 8px; }
.header-actions { display: flex; gap: 8px; }
.role-pill { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border-radius: 999px; color: var(--green); background: rgba(61,213,152,.1); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.role-pill.danger { color: var(--red); background: rgba(255,93,103,.1); }
.kpi-grid { display: grid; gap: 10px; margin-bottom: 13px; }
.kpi-grid.four { grid-template-columns: repeat(4,1fr); }
.kpi-grid.five { grid-template-columns: repeat(5,1fr); }
.kpi-grid.six { grid-template-columns: repeat(6,1fr); }
.kpi-card { min-height: 116px; position: relative; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #111c28, #0c151f); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.kpi-card::after { content: ""; position: absolute; right: -26px; bottom: -32px; width: 86px; height: 86px; border-radius: 50%; background: rgba(66,174,234,.05); }
.kpi-card.gold::after { background: rgba(255,179,58,.08); }
.kpi-card.red::after { background: rgba(255,93,103,.08); }
.kpi-card.green::after { background: rgba(61,213,152,.08); }
.kpi-card > span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.kpi-card > strong { display: block; margin: 12px 0 4px; font-size: clamp(22px, 2.2vw, 32px); line-height: 1; letter-spacing: -.04em; }
.kpi-card > small { color: #83909b; font-size: 9px; }
.kpi-trend { position: absolute; right: 12px; top: 13px; color: var(--green); font-size: 9px; font-weight: 800; }
.kpi-trend.bad { color: var(--red); }
.dashboard-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.dashboard-grid.two-thirds { grid-template-columns: minmax(0,1.65fr) minmax(280px,.8fr); }
.dashboard-grid.half { grid-template-columns: repeat(2,minmax(0,1fr)); }
.panel-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 35px rgba(0,0,0,.09); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.panel-head h3 { margin-bottom: 2px; }
.panel-head small { color: var(--muted); font-size: 9px; }
.chart-canvas { width: 100%; max-width: 100%; display: block; border-radius: 8px; }
.chart-canvas.donut { max-width: 430px; margin: 0 auto; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; padding-top: 7px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.horizontal-bars { display: grid; gap: 10px; padding: 5px 0; }
.horizontal-bars.large { gap: 13px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px,145px) minmax(110px,1fr) 78px; align-items: center; gap: 9px; }
.hbar-label { min-width: 0; color: #c6cfd6; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 9px; overflow: hidden; border-radius: 99px; background: #1a2733; }
.hbar-fill { height: 100%; min-width: 3px; border-radius: 99px; background: linear-gradient(90deg, var(--gold-soft), var(--orange)); }
.hbar-value { color: #d8dfe4; font-size: 9px; text-align: right; }
.table-wrap { width: 100%; overflow: auto; }
.table-wrap.tall { max-height: 610px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th, .data-table td { padding: 11px 9px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 9px; white-space: nowrap; }
.data-table th { position: sticky; top: 0; z-index: 1; color: #71808c; background: var(--surface); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.data-table tbody tr:hover { background: rgba(255,255,255,.025); }
.data-table.compact th, .data-table.compact td { padding: 9px 8px; }
.status-chip { display: inline-flex; min-height: 21px; align-items: center; padding: 0 7px; border: 1px solid transparent; border-radius: 999px; font-size: 8px; font-weight: 850; }
.status-chip.normal { color: var(--blue); border-color: rgba(66,174,234,.25); background: rgba(66,174,234,.08); }
.status-chip.good { color: var(--green); border-color: rgba(61,213,152,.25); background: rgba(61,213,152,.08); }
.status-chip.bad { color: var(--red); border-color: rgba(255,93,103,.25); background: rgba(255,93,103,.08); }
.status-chip.warning { color: var(--gold-soft); border-color: rgba(255,179,58,.25); background: rgba(255,179,58,.08); }
.text-btn { padding: 0; color: var(--gold-soft); background: transparent; font-size: 9px; font-weight: 800; }
.metric-list, .rank-list, .leaderboard, .insight-list, .sync-list { display: grid; gap: 9px; }
.metric-item, .rank-item, .leader-row, .insight-item, .sync-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 10px; background: #0a131c; }
.metric-item span, .rank-item span, .leader-row span, .insight-item span, .sync-item span { color: var(--muted); font-size: 9px; }
.metric-item strong, .rank-item strong, .leader-row strong, .insight-item strong, .sync-item strong { font-size: 10px; }
.rank-index { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: #171107; background: var(--gold-soft); font-size: 9px; font-weight: 900; }
.rank-main { flex: 1; min-width: 0; }
.rank-main strong, .rank-main small { display: block; }
.rank-main small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.leader-row { justify-content: flex-start; }
.leader-row .variance { margin-left: auto; font-weight: 900; }
.leader-row.bad .variance { color: var(--red); }
.leader-row.good .variance { color: var(--green); }
.heatmap { min-width: 900px; display: grid; grid-template-columns: 56px repeat(24,minmax(22px,1fr)); gap: 4px; padding-top: 10px; overflow-x: auto; }
.heat-label { color: var(--muted); font-size: 8px; text-align: center; }
.heat-day { display: flex; align-items: center; color: #a7b3bc; font-size: 8px; }
.heat-cell { aspect-ratio: 1.2; min-height: 23px; border-radius: 3px; background: rgba(255,143,50,var(--heat,.08)); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.table-toolbar input { max-width: 390px; min-height: 38px; }
.table-toolbar span { color: var(--muted); font-size: 9px; }
.upload-card { text-align: center; }
.upload-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 8px auto 15px; border-radius: 18px; color: #1c1304; background: var(--gold-soft); font-size: 30px; font-weight: 900; }
.upload-card p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.upload-card input { margin: 12px 0; padding: 9px; }
.upload-card button { width: 100%; margin-top: 8px; }
.process-list { display: grid; gap: 14px; margin: 18px 0; padding: 0; list-style: none; counter-reset: flow; }
.process-list li { position: relative; padding-left: 39px; }
.process-list li::before { counter-increment: flow; content: counter(flow); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #191207; background: var(--gold-soft); font-size: 10px; font-weight: 900; }
.process-list strong, .process-list span { display: block; }
.process-list strong { font-size: 11px; }
.process-list span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.process-list.boxed li { padding: 11px 11px 11px 45px; border: 1px solid var(--line-soft); border-radius: 10px; background: #0a131c; }
.process-list.boxed li::before { left: 9px; top: 10px; }
.empty-state { min-height: 130px; display: grid; place-items: center; padding: 20px; border: 1px dashed #334452; border-radius: 11px; color: var(--muted); font-size: 11px; }
.executive-insights .insight-item { align-items: flex-start; justify-content: flex-start; }
.insight-mark { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #171107; background: var(--gold-soft); font-weight: 900; }
.insight-copy strong, .insight-copy span { display: block; }
.insight-copy span { margin-top: 3px; line-height: 1.45; }
.attention-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; }
.attention-card { padding: 13px; border: 1px solid var(--line-soft); border-radius: 11px; background: #0a131c; }
.attention-card .priority { display: inline-flex; margin-bottom: 10px; padding: 3px 7px; border-radius: 999px; color: var(--red); background: rgba(255,93,103,.09); font-size: 8px; font-weight: 850; }
.attention-card strong, .attention-card span, .attention-card small { display: block; }
.attention-card > strong { margin-bottom: 3px; font-size: 13px; }
.attention-card span { color: var(--muted); font-size: 9px; }
.attention-card small { margin-top: 10px; color: var(--gold-soft); font-size: 9px; }
.site-card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; margin-bottom: 12px; }
.site-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.site-card h3 { font-size: 14px; }
.site-card-kpis { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 14px; }
.site-card-kpis div { padding: 9px; border-radius: 9px; background: #0a131c; }
.site-card-kpis span, .site-card-kpis strong { display: block; }
.site-card-kpis span { color: var(--muted); font-size: 8px; }
.site-card-kpis strong { margin-top: 5px; font-size: 13px; }
.driver-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(260px,.65fr); gap: 13px; max-width: 1150px; margin: 0 auto; }
.form-card, .driver-side-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.form-grid { display: grid; gap: 11px; }
.form-grid.two { grid-template-columns: repeat(2,1fr); }
.form-grid.three { grid-template-columns: repeat(3,1fr); }
.form-group { display: grid; gap: 7px; margin-bottom: 12px; }
.form-group input, .form-group select { min-height: 45px; }
.field-hint { min-height: 25px; margin: -4px 0 9px; padding: 7px 10px; border-radius: 8px; color: #9facb5; background: #0a131c; font-size: 9px; }
.input-suffix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #0a131c; overflow: hidden; }
.input-suffix input { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.input-suffix span { padding: 0 12px; color: var(--gold-soft); font-size: 11px; font-weight: 900; }
.inline-control { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-btn { padding: 0 14px; color: var(--gold-soft); border: 1px solid rgba(255,179,58,.25); background: rgba(255,179,58,.07); font-size: 10px; font-weight: 800; }
.calculation-card { display: flex; align-items: center; gap: 15px; margin: 0 0 12px; padding: 12px; border: 1px solid rgba(61,213,152,.22); border-radius: 11px; background: rgba(61,213,152,.06); }
.calculation-card.alert { border-color: rgba(255,93,103,.25); background: rgba(255,93,103,.06); }
.calculation-card span { color: var(--muted); font-size: 9px; }
.calculation-card strong { font-size: 16px; }
.calculation-card small { margin-left: auto; color: var(--green); font-size: 9px; }
.calculation-card.alert small { color: var(--red); }
.driver-side-card { align-self: start; position: sticky; top: 102px; }
.driver-status-icon { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 17px; color: #0a1a13; background: var(--green); font-size: 25px; font-weight: 900; }
.driver-side-card h3 { font-size: 22px; letter-spacing: -.03em; }
.driver-mini-kpis { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 20px 0 12px; }
.driver-mini-kpis div { padding: 12px; border-radius: 10px; background: #0a131c; }
.driver-mini-kpis span, .driver-mini-kpis strong { display: block; }
.driver-mini-kpis span { color: var(--muted); font-size: 8px; }
.driver-mini-kpis strong { margin-top: 6px; font-size: 22px; }
.toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: min(430px,calc(100vw - 40px)); padding: 13px 16px; border: 1px solid rgba(255,179,58,.25); border-radius: 12px; color: #f6f1e8; background: #151d24; box-shadow: 0 20px 60px rgba(0,0,0,.35); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; font-size: 11px; line-height: 1.5; }
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-only { display: none; }

@media (max-width: 1250px) {
  .filter-panel { grid-template-columns: repeat(4,minmax(130px,1fr)); }
  .filter-status { grid-column: span 2; }
  .kpi-grid.six { grid-template-columns: repeat(3,1fr); }
  .kpi-grid.five { grid-template-columns: repeat(3,1fr); }
  .attention-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 980px) {
  :root { --sidebar: 220px; }
  .app-shell { display: block; }
  .app-main { grid-column: auto; }
  .sidebar { transform: translateX(-105%); transition: transform .25s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open::after { content: ""; position: fixed; z-index: 25; inset: 0; background: rgba(0,0,0,.55); }
  .mobile-only { display: inline-grid; }
  .topbar { padding: 12px 14px; }
  .workspace { padding: 14px 12px 35px; }
  .dashboard-grid.two-thirds, .driver-layout { grid-template-columns: 1fr; }
  .driver-side-card { position: static; }
  .filter-panel { grid-template-columns: repeat(3,1fr); }
  .account-chip { min-width: 0; }
  .account-chip div { display: none; }
  .sync-badge { display: none; }
}

@media (max-width: 720px) {
  .login-screen { padding: 13px; }
  .login-card { padding: 22px 17px; border-radius: 20px; }
  .login-brand { align-items: flex-start; flex-direction: column; gap: 10px; }
  .login-brand img { width: 230px; height: 65px; }
  .login-brand > span { margin-left: 0; }
  .demo-grid { grid-template-columns: 1fr; }
  .topbar-actions .tool-btn, #logoutBtn { display: none; }
  .topbar-left h1 { font-size: 16px; }
  .data-flow-banner { justify-content: flex-start; overflow-x: auto; padding-right: 42px; }
  .data-flow-banner > div { flex: 0 0 auto; }
  .filter-panel { grid-template-columns: repeat(2,1fr); }
  .filter-status { grid-column: span 2; }
  .dashboard-grid.half, .form-grid.two, .form-grid.three, .site-card-grid { grid-template-columns: 1fr; }
  .kpi-grid.four, .kpi-grid.five, .kpi-grid.six { grid-template-columns: repeat(2,1fr); }
  .kpi-card { min-height: 105px; padding: 13px; }
  .kpi-card > strong { font-size: 24px; }
  .attention-grid { grid-template-columns: 1fr; }
  .dashboard-title-row, .section-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .header-actions { width: 100%; }
  .header-actions button { flex: 1; }
  .hbar-row { grid-template-columns: 95px 1fr 62px; }
  .panel-card, .form-card, .driver-side-card { padding: 13px; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-toolbar input { max-width: none; }
}

@media (max-width: 440px) {
  .kpi-grid.four, .kpi-grid.five, .kpi-grid.six { grid-template-columns: 1fr 1fr; }
  .kpi-card > strong { font-size: 21px; }
  .filter-panel { grid-template-columns: 1fr; }
  .filter-status { grid-column: auto; }
  .filter-panel button { width: 100%; }
}


/* v2.3.1 — logo crop fix + two-month comparison and resilient login brand */
.login-brand img { max-width: 245px; max-height: 74px; width: 100%; height: auto; display: block; }
.month-compare-panel { overflow: hidden; }
.month-comparison { display: grid; grid-template-columns: minmax(180px,1fr) 42px minmax(180px,1fr) minmax(260px,1.35fr); gap: 14px; align-items: stretch; }
.month-card { padding: 18px; border: 1px solid var(--line-soft); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); display: flex; flex-direction: column; gap: 5px; }
.month-card.current { border-color: rgba(230,171,39,.45); box-shadow: inset 0 0 0 1px rgba(230,171,39,.08); }
.month-card > span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.month-card > strong { font-size: clamp(25px,3vw,36px); line-height: 1.05; }
.month-card > small { color: var(--muted); }
.month-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.month-metrics b { padding: 6px 8px; border-radius: 9px; background: rgba(255,255,255,.045); color: var(--text-soft); font-size: 11px; }
.month-arrow { display: grid; place-items: center; color: var(--gold-soft); font-size: 28px; }
.month-deltas { display: grid; grid-template-columns: repeat(2,minmax(105px,1fr)); gap: 9px; }
.month-deltas > div { padding: 12px; border-radius: 13px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.025); display: flex; flex-direction: column; gap: 4px; }
.month-deltas span { color: var(--muted); font-size: 11px; }
.month-deltas strong { font-size: 18px; }
.month-deltas .good strong { color: var(--green); }
.month-deltas .bad strong { color: var(--red); }
.dataset-strip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(230,171,39,.08); color: var(--muted); font-size: 12px; }
.dataset-strip strong { color: var(--text); }
.dataset-strip i { color: var(--gold-soft); font-style: normal; }
@media (max-width: 1120px) { .month-comparison { grid-template-columns: 1fr 34px 1fr; } .month-deltas { grid-column: 1 / -1; grid-template-columns: repeat(4,1fr); } }
@media (max-width: 720px) { .month-comparison { grid-template-columns: 1fr; } .month-arrow { transform: rotate(90deg); min-height: 22px; } .month-deltas { grid-column: auto; grid-template-columns: repeat(2,1fr); } .dataset-strip { grid-column: auto; } }


/* sidebar logo crop fix */
.sidebar-brand { min-height: 96px; gap: 12px; padding: 16px 16px; }
.sidebar-brand img { width: auto; height: 58px; max-width: 48px; object-fit: contain; object-position: center center; border-radius: 0; flex: 0 0 auto; display: block; }
.sidebar-brand > div { min-width: 0; }
