:root {
  --ink: #122d30; --ink-2: #214044; --muted: #718285;
  --teal: #12508f; --teal-dark: #0e3d6e; --teal-soft: #e6eef8;
  --coral: #f26a21; --paper: #f5f4ef; --surface: #fffefa; --line: #e6e4dc;
  --shadow: 0 10px 34px rgba(33,64,68,.07); --good: #1c9c6c; --bad: #d1554a; --warn: #c98a1d;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal-dark); }
h1, h2, h3, p { margin: 0; }

.eyebrow { display: block; color: var(--teal-dark); font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--coral); color: #173338; font-weight: 850; font-size: 19px; flex: none; }

/* Buttons */
.primary-button { background: var(--teal); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 650; box-shadow: 0 6px 16px rgba(18,80,143,.25); }
.primary-button:hover { background: var(--teal-dark); }
.primary-button:disabled { opacity: .6; cursor: default; }
.soft-button { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 15px; font-weight: 600; color: var(--ink-2); }
.soft-button:hover { border-color: var(--teal); color: var(--teal-dark); }
.danger-button { background: #fde7e4; color: var(--bad); border: 1px solid #f4c7c1; border-radius: 10px; padding: 9px 15px; font-weight: 600; }
.link-button { background: none; border: 0; color: var(--teal-dark); font-weight: 600; padding: 4px; text-decoration: underline; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand-panel { background: linear-gradient(160deg,#0c2a4a,#12508f); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand { display: flex; gap: 12px; align-items: center; }
.login-brand strong { font-size: 19px; display: block; }
.login-brand span { font-size: 11px; color: #9db4d1; text-transform: uppercase; letter-spacing: 1.2px; }
.login-message h1 { font-size: 40px; line-height: 1.1; margin: 16px 0; }
.login-message p { color: #cddcf0; max-width: 420px; }
.login-stats { display: flex; gap: 28px; }
.login-stats b { display: block; font-size: 20px; }
.login-stats span { color: #9db4d1; font-size: 12px; }
.login-form-panel { display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.login-card h2 { font-size: 26px; }
.login-card p { color: var(--muted); margin-bottom: 8px; }
.login-error { background: #fde7e4; color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.login-card small { color: var(--muted); text-align: center; }
@media (max-width: 860px) { .login-page { grid-template-columns: 1fr; } .login-brand-panel { display: none; } }

.chrome-logo { max-height: 46px; max-width: 210px; object-fit: contain; margin-bottom: 6px; }
/* Logo above the login form — scales proportionally, capped so it never stretches */
.login-card { background: #fff; }
.login-card .chrome-logo { display: block; width: 90%; max-width: 90%; height: auto; max-height: 120px; margin: 0 auto 14px; justify-self: center; background: #fff; }

/* Form fields */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(18,80,143,.3); border-color: var(--teal); }
.field textarea { min-height: 70px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-field input { width: auto; }

/* App shell */
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 236px; flex: none; background: #0c2a4a; color: #fff; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding-bottom: 24px; }
.sidebar .brand strong { display: block; font-size: 16px; }
.sidebar .brand span { color: #9db4d1; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; }
.nav-item { width: 100%; border: 0; border-radius: 10px; background: transparent; color: #a9bcd6; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 3px; font-weight: 600; text-align: left; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--surface); color: var(--ink); }
.nav-item .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; display: grid; place-items: center; background: var(--coral); color: #0c2a4a; font-size: 10px; font-weight: 800; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #9db4d1; }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
/* Desktop top bar: tab name (left) · brand name (centre) · search (right) */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 22px; }
.topbar h1 { justify-self: start; }
.topbar-brand { justify-self: center; text-align: center; font-weight: 800; font-size: 26px; color: var(--teal-dark); }
.topbar-actions { justify-self: end; }
/* Hamburger + drawer backdrop are desktop-hidden; shown only on mobile */
.nav-toggle { display: none; flex: none; width: 42px; height: 42px; align-items: center; justify-content: center; font-size: 20px; background: #fff; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); }
.nav-backdrop { display: none; }
.topbar h1 { font-size: 22px; }
.topbar .search { border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-width: 240px; background: #fff; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card small { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
.stat-card strong { display: block; font-size: 22px; margin-top: 6px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 17px; margin-top: 4px; }
.panel-head p { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 520px; }

.status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #eef1ee; color: var(--muted); }
.status.good { background: #e2f6ec; color: var(--good); }
.status.bad { background: #fbe6e3; color: var(--bad); }
.status.warn { background: #fbf0dc; color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { text-align: left; color: var(--muted); font-weight: 650; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: rgba(18,80,143,.04); }
.table-wrap { overflow-x: auto; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-actions button { font-size: 12px; padding: 5px 10px; }
.empty-row td { text-align: center; color: var(--muted); padding: 26px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(17,34,36,.45); display: grid; place-items: center; padding: 20px; z-index: 60; }
.modal { background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.modal-head button { background: none; border: 0; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.toast { position: fixed; bottom: 22px; right: 22px; background: #17302f; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 26px rgba(0,0,0,.25); z-index: 80; max-width: 360px; font-size: 13px; }
.toast.error { background: #7a2b25; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list span { background: var(--teal-soft); color: var(--teal-dark); padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* Catalog / customer portal (public pages) */
.catalog-page, .customer-portal, .customer-login { min-height: 100vh; background: var(--paper); }
.catalog-header, .customer-portal header { display: flex; justify-content: space-between; align-items: center; padding: 18px 30px; background: var(--surface); border-bottom: 1px solid var(--line); }
.catalog-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.catalog-brand img { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: #fff; }
.catalog-brand b { width: 36px; height: 36px; border-radius: 9px; background: var(--coral); display: grid; place-items: center; color: #173338; font-weight: 800; }
.catalog-brand strong { display: block; }
.catalog-brand small { color: var(--muted); }
.catalog-hero { padding: 40px 30px; text-align: center; }
.catalog-hero h1 { font-size: 30px; margin: 10px 0; }
.catalog-hero input { max-width: 460px; width: 100%; margin: 16px auto 0; display: block; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.catalog-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding: 0 30px 40px; }
.catalog-products article { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.catalog-product-art { background: var(--teal-soft); height: 90px; display: flex; justify-content: space-between; align-items: center; padding: 14px; }
.catalog-product-art b { font-size: 26px; color: var(--teal-dark); }
.catalog-product-copy { padding: 14px 16px; display: grid; gap: 6px; }
.catalog-product-copy h2 { font-size: 16px; }
.catalog-product-copy strong { font-size: 17px; }
.catalog-product-copy > div { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.catalog-empty, .catalog-loading { text-align: center; padding: 60px 20px; color: var(--muted); }
.catalog-message { text-align: center; background: var(--teal-soft); color: var(--teal-dark); padding: 10px; margin: 0 30px; border-radius: 10px; }

.customer-login { display: grid; place-items: center; padding: 30px; }
.customer-login section { max-width: 420px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.portal-welcome { display: flex; justify-content: space-between; align-items: center; padding: 24px 30px; flex-wrap: wrap; gap: 16px; }
.portal-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; text-align: right; }
.portal-stat strong { font-size: 22px; display: block; }
.portal-tabs { display: flex; gap: 6px; padding: 0 30px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.portal-tabs button { background: none; border: 0; padding: 12px 14px; font-weight: 650; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.portal-tabs button.active { color: var(--teal-dark); border-color: var(--teal); }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 16px; padding: 20px 30px; }
.portal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; padding: 20px 30px; }
.portal-table { margin: 20px 30px; }
.portal-account h2 { font-size: 16px; }
.portal-account strong { display: block; font-size: 20px; margin: 6px 0; }
.scope-list { display: grid; gap: 6px; margin-top: 10px; font-size: 13px; }
.consent-switch { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.form-message { background: #fde7e4; color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 12px 30px; }
.global-message { margin: 12px 30px; }

.provision-page { min-height: 100vh; padding: 30px; background: #fff; }
/* Pure-white cards with a proper blue border all around, on the super-admin page */
.provision-page .panel, .provision-page .stat-card { background: #fff; border: 1.5px solid var(--teal); }
.provision-shell { max-width: 1180px; margin: 0 auto; }

/* Bold navy header band with a white (knocked-out) logo */
.provision-page .sa-head {
  position: relative; overflow: hidden;
  background: linear-gradient(125deg, #0a2745 0%, #12508f 60%, #1a63ad 100%);
  border: 0; border-radius: 22px; padding: 30px 34px; margin-bottom: 26px;
  box-shadow: 0 20px 46px rgba(11,44,82,.30);
}
/* warm orange glow in the corner so the band isn't flat/dull */
.provision-page .sa-head::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(242,106,33,.55), transparent 62%); pointer-events: none;
}
.provision-page .sa-head > * { position: relative; z-index: 1; }
/* Keep the logo in its original colours — sit it on a clean white tile so it stays legible on the navy band */
.provision-page .sa-head .sa-logo { background: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.20); }
.provision-page .sa-head-text .eyebrow { color: #ffb488; }
.provision-page .sa-head-text h1 { color: #fff; font-size: 30px; }
.provision-page .sa-head-text p { color: #cfe0f4; }
.provision-page .sa-head .sa-signout {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35);
}
.provision-page .sa-head .sa-signout:hover { background: rgba(255,255,255,.26); border-color: #fff; }

/* Panels: clean, with a coloured section label and a gentle hover lift */
.provision-page .panel { transition: box-shadow .18s ease, transform .18s ease; }
.provision-page .panel:hover { box-shadow: 0 16px 40px rgba(18,80,143,.12); transform: translateY(-1px); }
.provision-page .panel .eyebrow { color: var(--teal); }
.provision-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
/* Super-admin header: big logo on the left, title text to its right */
.sa-head { flex-direction: row; align-items: center; text-align: left; gap: 22px; flex-wrap: wrap; }
.sa-head .sa-logo { width: auto; height: auto; max-width: 400px; max-height: 150px; object-fit: contain; margin: 0; background: transparent; flex: none; }
.sa-head .sa-head-text { flex: 1; min-width: 240px; }
.sa-head .sa-signout { align-self: flex-start; }
.sa-head p { max-width: 620px; }
@media (max-width: 640px) {
  .provision-page .sa-head { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
  .provision-page .sa-head .sa-logo { max-height: 120px; width: 100%; max-width: 100%; }
  .provision-page .sa-head-text { width: 100%; min-width: 0; }
  .provision-page .sa-head .sa-signout { align-self: center; }
}
.provision-head p { color: var(--muted); max-width: 560px; margin-top: 6px; }
.superadmin-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.tenant-list { display: grid; gap: 8px; margin-top: 10px; max-height: 320px; overflow-y: auto; }
.tenant-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; text-align: left; }
.tenant-list button { transition: border-color .15s ease, background .15s ease; }
.tenant-list button:hover { border-color: #b9cde8; background: #f4f8fd; }
.tenant-list button.active { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--coral); }
.tenant-list small { display: block; color: var(--muted); }
.mini-brand { display: flex; align-items: center; gap: 8px; }
.mini-brand img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; }
.mini-brand b { width: 30px; height: 30px; border-radius: 8px; background: var(--coral); display: grid; place-items: center; color: #173338; }
.mini-brand small { display: block; color: var(--muted); }
@media (max-width: 980px) { .superadmin-grid { grid-template-columns: 1fr; } }

.loading-page { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* Point of sale */
.pos-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.pos-input { width: 100%; border: 2px solid var(--teal); border-radius: 11px; padding: 14px 16px; font-size: 16px; background: #fff; }
.pos-input:focus { outline: 3px solid rgba(18,80,143,.2); }
.pos-matches { margin-top: 10px; display: grid; gap: 6px; }
.pos-match { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 13px; }
.pos-match:hover { border-color: var(--teal); background: var(--teal-soft); }
.pos-match small { display: block; color: var(--muted); font-size: 12px; }
.pos-match em { font-style: normal; font-weight: 700; white-space: nowrap; }
.pos-cell { width: 92px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; text-align: right; }
.pos-cell:disabled { background: #f3f2ee; color: var(--muted); }
.spec-small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.pos-checkout { position: sticky; top: 20px; }
.pos-totals { margin: 12px 0 16px; font-size: 14px; }
.pos-totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.pos-totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 19px; font-weight: 800; }
@media (max-width: 900px) { .pos-layout { grid-template-columns: 1fr; } .pos-checkout { position: static; } }

/* Dashboard sparkline */
.spark { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.spark-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.spark-bar { width: 100%; max-width: 34px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--teal), var(--teal-dark)); transition: height .3s ease; }
.spark-col:hover .spark-bar { background: var(--coral); }
.spark-col span { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* Command palette */
.palette-backdrop { position: fixed; inset: 0; background: rgba(17,34,36,.45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 20px 20px; z-index: 90; }
.palette { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 30px 60px rgba(0,0,0,.3); overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 17px 20px; font-size: 16px; background: transparent; }
.palette input:focus { outline: none; }
.palette-results { max-height: 52vh; overflow-y: auto; }
.palette-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 20px; }
.palette-row:hover, .palette-row.active { background: var(--teal-soft); }
.palette-row small { display: block; color: var(--muted); font-size: 12px; }
.palette-kind { font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--teal-dark);
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 3px 9px; min-width: 74px; text-align: center; flex: none; }
.palette-foot { border-top: 1px solid var(--line); padding: 9px 20px; font-size: 11px; color: var(--muted); }

/* Device timeline */
.timeline { display: grid; gap: 0; }
.timeline-row { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 0 0 16px; position: relative; }
.timeline-row:not(:last-child)::before { content: ''; position: absolute; left: 12px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--teal); margin: 5px auto 0; box-shadow: 0 0 0 4px var(--teal-soft); position: relative; z-index: 1; }

/* Reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.report-grid .panel { margin-bottom: 0; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.bar-label { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #eef1ee; border-radius: 20px; height: 16px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--teal), var(--teal-dark)); min-width: 3px; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
@media (max-width: 620px) { .bar-row { grid-template-columns: 92px 1fr auto; gap: 8px; font-size: 12px; } }

@media print {
  .sidebar, .topbar-actions, .toast, [data-report-preset], #report-run, #report-print { display: none !important; }
  .main { padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
  .bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   Mobile: sidebar becomes a slide-out drawer, tighter layout
   ============================================================ */
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; width: 262px; z-index: 80;
    transform: translateX(-100%); transition: transform .26s ease;
    box-shadow: 0 24px 60px rgba(6,18,34,.4); overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }
  /* Keep the account/sign-out footer pinned to the bottom of the drawer so it's always reachable */
  .sidebar-footer { position: sticky; bottom: 0; background: #0c2a4a; margin-top: auto; padding-bottom: 20px; }
  .app-shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(8,20,36,.5); z-index: 75; }
  .nav-toggle { display: inline-flex; }

  .main { padding: 0 14px 60px; }
  /* Sticky top app bar: hamburger left, brand/title centered, search on the row below */
  .topbar {
    position: sticky; top: 0; z-index: 40; background: var(--paper);
    margin: 0 -14px 14px; padding: 12px 14px; gap: 10px;
    border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: 42px 1fr 42px; align-items: center;
  }
  .topbar .nav-toggle { grid-column: 1; }
  .topbar h1 { grid-column: 2; justify-self: center; text-align: center; font-size: 17px; margin: 0; }
  .topbar-brand { display: none; }
  /* Overview page on mobile: show the brand name in place of the "Overview" title */
  .topbar.is-dashboard h1 { display: none; }
  .topbar.is-dashboard .topbar-brand { display: block; grid-column: 2; justify-self: center; text-align: center; font-size: 18px; }
  .topbar-actions { grid-column: 1 / -1; justify-self: stretch; display: flex; }
  .topbar .search { width: 100%; min-width: 0; }

  /* KPI cards two-up, like a modern dashboard */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 13px 14px; }
  .stat-card strong { font-size: 18px; }
  .stat-card small { font-size: 9px; }

  .panel { padding: 16px; border-radius: 14px; }
  .panel-head { gap: 8px; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .topbar h1 { font-size: 16px; }
}
