/* =====================================================================
   AURA · Sales & CRM Dashboard — styles (from the X Capital dashboard v3.7)
   Tokens follow the data-viz reference palette (light + dark selected).
   ===================================================================== */

:root {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f1f1ed;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e3eefb;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --deemph: #d6d5ce;
  --good: #0ca30c; --good-text: #006300; --good-soft: #e4f5e4;
  --warning: #fab219; --warning-text: #7a5200; --warning-soft: #fff3d6;
  --serious: #ec835a; --serious-text: #8a3a1a; --serious-soft: #fde7de;
  --critical: #d03b3b; --critical-text: #a21d1d; --critical-soft: #fbe3e3;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -16px rgba(0,0,0,.18);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", "Noto Sans Myanmar", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono-nums: "tnum";
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0f0e; --surface: #1a1a19; --surface-2: #222221;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835;
    --border: rgba(255,255,255,.10); --border-strong: rgba(255,255,255,.2);
    --accent: #3987e5; --accent-soft: #15325a;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --deemph: #3a3a37;
    --good-text: #4cc94c; --good-soft: #163a16;
    --warning-text: #ffd166; --warning-soft: #3d2f0a;
    --serious-text: #ffb595; --serious-soft: #4a2416;
    --critical-text: #ff8585; --critical-soft: #4a1a1a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e; --surface: #1a1a19; --surface-2: #222221;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835;
  --border: rgba(255,255,255,.10); --border-strong: rgba(255,255,255,.2);
  --accent: #3987e5; --accent-soft: #15325a;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --deemph: #3a3a37;
  --good-text: #4cc94c; --good-soft: #163a16;
  --warning-text: #ffd166; --warning-soft: #3d2f0a;
  --serious-text: #ffb595; --serious-soft: #4a2416;
  --critical-text: #ff8585; --critical-soft: #4a1a1a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--page);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.right { text-align: right; }
.center { text-align: center; }
.mm { font-family: "Noto Sans Myanmar", var(--font); }

/* ---------- loading ---------- */
.loading { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: var(--page); z-index: 100; color: var(--text-2); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--grid); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- brand (logo.svg = AURA wordmark traced from the owner's PNG, mark.svg = its first "A" for the phone top bar) ---------- */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-decoration: none; color: inherit; }
.brand:hover { text-decoration: none; }
.logo { display: block; height: 21px; width: auto; }
.logo-lg { height: 34px; }
.brand-sub { font-size: 11px; color: var(--muted); line-height: 1.2; letter-spacing: .02em; }
.brand-lg { align-items: center; gap: 10px; }
.brand-lg .brand-sub { font-size: 13px; }
.logo-mark { display: none; height: 22px; width: auto; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 26px 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.auth-form input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--page); font-size: 14px; }
.auth-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.auth-foot { margin: 22px 0 0; font-size: 12px; text-align: center; }
.form-error { color: var(--critical-text); font-size: 12.5px; min-height: 1em; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; align-self: center; }
.link:hover { text-decoration: underline; }
/* authenticator + device screens (v3.0) */
.auth-card.wide { max-width: 440px; }
.auth-title { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.auth-help { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.auth-help.small { font-size: 12px; color: var(--muted); text-align: center; }
.auth-steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--text-2); line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.qr-box { display: flex; justify-content: center; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.qr-box img { width: 180px; height: 180px; display: block; }
.auth-manual { font-size: 12.5px; color: var(--muted); }
.auth-manual summary { cursor: pointer; }
.auth-manual code { display: block; margin-top: 6px; padding: 8px 10px; background: var(--page); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; letter-spacing: .06em; word-break: break-all; color: var(--text); user-select: all; }
#mfa-enroll-code, #mfa-verify-code { font-size: 20px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.device-kv { padding: 12px 14px; background: var(--page); border: 1px solid var(--border); border-radius: 10px; }
.device-kv dd { font-weight: 500; word-break: break-all; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); background: var(--accent); }
.btn-block { width: 100%; padding: 11px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- app layout: sidebar + content ---------- */
.app { display: flex; min-height: 100dvh; }
.sidebar { width: 236px; flex: 0 0 236px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.sidebar-brand { padding: 18px 16px 12px; }
.sidenav { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 1px; }
.sidenav .group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 4px; }
.sidenav a { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.sidenav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.sidenav a.active { background: var(--text); color: var(--page); }
.sidenav a .code { font-size: 10.5px; font-weight: 700; min-width: 24px; text-align: center; padding: 1px 4px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); }
.sidenav a.active .code { background: rgba(255,255,255,.18); color: inherit; }
.sidebar-foot { margin-top: auto; padding: 12px 14px 16px; border-top: 1px solid var(--border); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mobile-nav { display: none; }
.sync-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap; width: 100%; justify-content: center; }
.sync-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: 0 0 auto; }
.sync-badge.stale .dot { background: var(--warning); }
.sync-badge.error .dot { background: var(--critical); }
.user-menu { position: relative; }
.menu { position: absolute; right: 0; top: 40px; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.menu-email { padding: 8px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; word-break: break-all; }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }

/* ---------- month picker ---------- */
.month-picker { position: relative; }
.month-btn { gap: 8px; padding: 7px 12px; font-weight: 600; }
.month-btn .caret { color: var(--muted); font-size: 11px; }
.month-btn.na { opacity: .55; }
.month-menu .mm-head span button { margin: 0 2px; }
.month-menu { left: 0; right: auto; top: 42px; min-width: 272px; max-height: 420px; overflow: auto; }
.month-menu .mm-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px 8px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; white-space: nowrap; }
.month-menu .mm-head button { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.month-menu label.mm-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.month-menu label.mm-item:hover { background: var(--surface-2); }
.month-menu label.mm-item.sel { font-weight: 600; }
.month-menu label.mm-item .mm-sub { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.month-menu .mm-all { border-bottom: 1px solid var(--border); margin-bottom: 4px; padding-bottom: 8px; }
.period-label { font-size: 12.5px; color: var(--muted); }

/* ---------- multi-select filter (customers, suppliers) ---------- */
.msel { position: relative; display: inline-block; }
.msel-btn { gap: 8px; font-weight: 500; max-width: 320px; }
.msel-btn .msel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-btn .caret { color: var(--muted); font-size: 11px; }
.msel-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.msel-menu { left: 0; right: auto; top: 34px; min-width: 300px; max-width: 420px; max-height: 420px; overflow: auto; }
.msel-menu .mm-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px 8px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; white-space: nowrap; }
.msel-menu .mm-head button { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.msel-menu .msel-search { width: calc(100% - 12px); margin: 2px 6px 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--page); font-size: 13px; }
.msel-menu label.mm-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.msel-menu label.mm-item:hover { background: var(--surface-2); }
.msel-menu label.mm-item.sel { font-weight: 600; }
.msel-menu label.mm-item .mm-sub { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.msel-menu .mm-all { border-bottom: 1px solid var(--border); margin-bottom: 4px; padding-bottom: 8px; }
.msel-menu .empty { padding: 10px 0; }

/* ---------- layout ---------- */
main { padding: 14px 20px 60px; max-width: 1480px; width: 100%; }
.view > h1 { font-size: 20px; font-weight: 700; margin: 10px 0 2px; letter-spacing: -.01em; }
.view-sub { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.report-head { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 12px; }
.report-head h1 { font-size: 20px; font-weight: 700; margin: 0 0 2px; letter-spacing: -.01em; }
.report-head .view-sub { margin: 0; }
.report-code { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: var(--text); color: var(--page); margin-top: 3px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 14px; }
.filters label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.filters select, .filters input[type="search"] { padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; min-width: 150px; }
.filters .spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tiles.tiles-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tiles, .tiles.tiles-3, .tiles.tiles-5, .tiles.tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 14px; }
@media (max-width: 980px) { .cols-3, .cols-2, .cols-2-1, .cols-1-2 { grid-template-columns: 1fr; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-title { font-size: 13.5px; font-weight: 600; margin: 0; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 320px; }
.chart-wrap.short { height: 200px; }
.chart-wrap.refetching { opacity: .5; }
.empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }

/* ---------- stat tiles ---------- */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); min-width: 0; }
.tile-label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 6px; }
.tile-value { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.tile-foot { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--critical-text); }
.delta.flat { color: var(--muted); }
.tile.hero .tile-value { font-size: 28px; }

/* ---------- badges / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill-good { background: var(--good-soft); color: var(--good-text); }
.pill-warning { background: var(--warning-soft); color: var(--warning-text); }
.pill-serious { background: var(--serious-soft); color: var(--serious-text); }
.pill-critical { background: var(--critical-soft); color: var(--critical-text); }
.pill-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.table-wrap.tall { max-height: 560px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; vertical-align: middle; }
table.data th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th .sort-ind { opacity: .55; margin-left: 4px; font-size: 10px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.wrap { white-space: normal; min-width: 180px; }
table.data th.hwrap { white-space: normal; line-height: 1.25; min-width: 96px; }   /* long header may wrap to two lines (R2) */
table.data tfoot td { font-weight: 600; background: var(--surface-2); position: sticky; bottom: 0; }
.cell-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.bar-cell .bar { height: 8px; border-radius: 0 4px 4px 0; background: var(--series-1); flex: 0 0 auto; }
.bar-cell .bar.deemph { background: var(--deemph); }
.table-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.table-tools input[type="search"], .table-tools select { padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; min-width: 150px; }
.table-tools .spacer { flex: 1; }
.count-note { font-size: 12px; color: var(--muted); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; height: 100dvh; width: min(1440px, 97vw); background: var(--page); z-index: 51; overflow: auto; box-shadow: -12px 0 40px rgba(0,0,0,.25); padding: 18px 22px 40px; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; margin-bottom: 10px; }
.drawer-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.drawer-meta { color: var(--text-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.drawer .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { .drawer .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.drawer table.data th, .drawer table.data td { padding: 7px 8px; }
.drawer .table-wrap.tall { max-height: 480px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.kv dd .pill { white-space: normal; line-height: 1.35; }
.section-title { font-size: 13px; font-weight: 600; margin: 18px 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--page); padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 90; box-shadow: var(--shadow); max-width: 90vw; }
.notice { padding: 10px 14px; border-radius: 10px; font-size: 13px; border: 1px solid var(--border); background: var(--surface-2); }
.notice.warn { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.notice.err { background: var(--critical-soft); color: var(--critical-text); border-color: transparent; }
.auth-form .notice { margin: 0; text-align: center; line-height: 1.45; }   /* v3.3: auto sign-out notice on the login card */

/* v3.4 — Overview "Top customers / Top products": compact ranked tables (replaced the bar charts) */
.rank-table table.data th, .rank-table table.data td { padding: 5px 7px; font-size: 12.5px; }
.rank-table table.data th { position: static; }
.rank-table td.rank, .rank-table th.rank { color: var(--muted); font-weight: 600; width: 24px; text-align: right; }
.rank-table td.wrap { min-width: 110px; }
.share-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 94px; }
.share-cell .bar { height: 6px; border-radius: 0 3px 3px 0; background: var(--series-1); flex: 0 0 auto; }
.share-cell .bar.alt { background: var(--series-3); }
.share-cell span:last-child { font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.share-cell .bar.warn { background: var(--series-2); }
@media (max-width: 900px) { .share-cell .bar { display: none; } .share-cell { min-width: 0; } }   /* phone: percent only */
/* v3.5 — R2: YGN / GIT split bar in the table (replaced the stacked chart); R1 / R3 / R5–R8 charts → rank tables / share bars */
.split-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 150px; }
.split-cell .track { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); flex: 0 0 auto; }
.split-cell .track i { display: block; height: 100%; }
.split-cell .track i.y { background: var(--series-1); }
.split-cell .track i.g { background: var(--series-2); }
.split-cell small { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; font-size: 11.5px; }
@media (max-width: 900px) { .split-cell .track { display: none; } .split-cell { min-width: 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend .key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 6px; }
.legend .box { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12px; cursor: pointer; color: var(--text-2); }
.chip.active { background: var(--text); color: var(--page); border-color: var(--text); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.steps { padding-left: 18px; margin: 6px 0; font-size: 13px; }
.steps li { margin: 4px 0; }

/* ---------- matrix (R8) ---------- */
table.data td.heat { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.heat.h1 { background: color-mix(in srgb, var(--series-1) 12%, transparent); }
table.data td.heat.h2 { background: color-mix(in srgb, var(--series-1) 26%, transparent); }
table.data td.heat.h3 { background: color-mix(in srgb, var(--series-1) 42%, transparent); }
table.data td.heat.h4 { background: color-mix(in srgb, var(--series-1) 60%, transparent); color: #fff; }
table.data td.zero { color: var(--muted); }
table.data th.sel { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
table.data tr.total-row td { font-weight: 600; background: var(--surface-2); }
.neg { color: var(--critical-text); }
.pos { color: var(--good-text); }

/* ---------- responsive ---------- */
/* ---------- Users & devices (owner) ---------- */
.admin { display: flex; flex-direction: column; gap: 14px; }
.admin-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--critical-soft); border-color: var(--critical-text); color: var(--critical-text); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
table.data td.actions, table.data th.actions { text-align: right; white-space: nowrap; }
.admin-help { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.admin-help b { color: var(--text); }
.role-select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; }

@media (max-width: 900px) {
  .app { display: block; }
  .sidebar { display: none; }
  .logo-mark { display: block; }
  .mobile-nav { display: block; max-width: 36vw; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; }
  .topbar { padding: 8px 10px; gap: 6px; flex-wrap: wrap; }
  .month-btn { padding: 7px 9px; }
  .topbar-right { gap: 6px; }
  .period-label { display: none; }
  main { padding: 10px 12px 60px; }
  .tiles, .tiles.tiles-3, .tiles.tiles-5, .tiles.tiles-6, .drawer .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-value { font-size: 17px; }
  .tile.hero .tile-value { font-size: 20px; }
  .card { padding: 14px; }
  .chart-wrap { height: 230px; }
  .drawer { padding: 14px 14px 40px; }
  .report-head h1 { font-size: 17px; }
}
@media print {
  .topbar, .sidebar, .drawer, .drawer-backdrop, .toast, .filters { display: none !important; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
}
