/* Pastry World Sales Dashboard - brand theme from the logo: warm black + gold.
   Design system from UI/UX Pro Max ("luxury black gold executive dashboard", density 8):
   primary #1C1917, gold accent #A16207 (text on light), Cormorant headings + Montserrat body.
   Plain CSS, no build step. Mobile first; sidebar from 1024px; light + dark. */
:root {
  color-scheme: light;
  /* Brand */
  --ink-900: #0c0a09; --ink-800: #1c1917; --ink-700: #292524; --ink-600: #44403c;
  --gold: #c2a661; --gold-light: #e3d49c; --gold-soft: #f7f1e1;
  --accent: #a16207; --accent-strong: #8a5306; --accent-soft: #f7f1e1;
  /* Surfaces & text */
  --bg: #fafaf9; --card: #ffffff; --card-2: #f5f5f4; --text: #0c0a09; --text-2: #44403c; --muted: #57534e; --line: #e7e5e4;
  --good: #15803d; --good-bg: #e7f5ec; --bad: #b91c1c; --bad-bg: #fdeaea;
  /* Charts */
  --series-1: #a16207; --series-1-fill: rgba(194, 166, 97, .20); --series-2: #78716c; --series-ly: #a8a29e; --bar: #c2a661;
  --grid: #efedeb; --axis: #57534e;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(12, 10, 9, .05), 0 6px 20px rgba(12, 10, 9, .06);
  --serif: "Cormorant", "Cormorant Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--sans);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0c0a09; --card: #1c1917; --card-2: #24201e; --text: #fafaf9; --text-2: #d6d3d1; --muted: #a8a29e; --line: #33302d;
    --gold: #d4b96a; --gold-light: #e8d9a6; --gold-soft: #2c2512;
    --accent: #d4b96a; --accent-strong: #e8d9a6; --accent-soft: #2c2512;
    --good: #4ade80; --good-bg: #13291b; --bad: #f87171; --bad-bg: #3a1717;
    --series-1: #d4b96a; --series-1-fill: rgba(212, 185, 106, .18); --series-2: #a8a29e; --series-ly: #78716c; --bar: #d4b96a;
    --grid: #2a2725; --axis: #a8a29e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent-strong); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, .serif { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 17px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 12px 0; }
@media (prefers-reduced-motion: no-preference) {
  .card, .nav-link, .btn, .bl-bar { transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, width .4s ease; }
}

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.sidebar { display: none; }
.content { min-width: 0; padding-bottom: 84px; } /* room for the phone tab bar */
.page { max-width: 1280px; margin: 0 auto; padding: 16px; }

/* Phone top bar */
.mobilebar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--ink-800); color: #fafaf9; }
.mobilebar .brandmark img { max-height: 34px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(250, 250, 249, .18);
  background: transparent; color: #e7e5e4; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

/* Brand mark (logo image, or a gold serif wordmark like the logo) */
.brandmark { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-decoration: none; color: inherit; }
.brandmark img { display: block; max-height: 56px; width: auto; max-width: 100%; }
.word-logo { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: .04em; line-height: 1;
  background: linear-gradient(90deg, #b9a066, var(--gold-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.word-logo span { font-weight: 600; }
.brand-sub { font-size: 10.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: #a8a29e; }

/* Phone bottom tab bar: max 5 tabs (4 pages + More) */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  background: var(--ink-800); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0, 0, 0, .2); }
.tabbar a, .tabbar summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px;
  border-radius: 12px; color: #bdb7b0; text-decoration: none; font-size: 11px; font-weight: 500; min-height: 52px; cursor: pointer; list-style: none; }
.tabbar summary::-webkit-details-marker { display: none; }
.tabbar a.active, .tabbar summary.active { color: var(--ink-900); background: linear-gradient(180deg, var(--gold-light), var(--gold)); font-weight: 700; }
.tabbar svg { width: 21px; height: 21px; }
.more { position: relative; }
.more-menu { position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 200px; background: var(--ink-800); border: 1px solid rgba(250, 250, 249, .12);
  border-radius: 14px; padding: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.more-menu a { flex-direction: row; justify-content: flex-start; gap: 10px; font-size: 14px; min-height: 46px; padding: 0 12px; color: #e7e5e4; }
.more-menu a.active { background: rgba(194, 166, 97, .18); color: var(--gold-light); }

/* Desktop sidebar */
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .mobilebar, .tabbar { display: none; }
  .content { padding-bottom: 0; }
  .page { padding: 24px 32px 40px; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 16px;
    background: linear-gradient(180deg, var(--ink-800), var(--ink-900)); color: #fafaf9; }
  .sidebar .brandmark { padding: 0 8px 20px; border-bottom: 1px solid rgba(194, 166, 97, .25); margin-bottom: 14px; }
  .sidebar .brandmark img { max-height: 64px; }
  .sidebar-foot .btn svg { width: 16px; height: 16px; }
  .nav-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #a8a29e; padding: 10px 12px 6px; }
  .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #e7e5e4;
    text-decoration: none; font-size: 14.5px; margin-bottom: 2px; }
  .nav-link svg { width: 18px; height: 18px; opacity: .85; flex: none; }
  .nav-link:hover { background: rgba(250, 250, 249, .08); color: #fff; }
  .nav-link.active { background: linear-gradient(90deg, rgba(194, 166, 97, .95), rgba(194, 166, 97, .78)); color: var(--ink-900); font-weight: 700; }
  .nav-link.active svg { opacity: 1; }
  .sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(250, 250, 249, .12); font-size: 13px; }
  .sidebar-foot .name { font-weight: 600; }
  .sidebar-foot .email { color: #a8a29e; font-size: 12px; overflow-wrap: anywhere; }
  .sidebar-foot .btn { margin-top: 10px; width: 100%; background: transparent; color: #e7e5e4; border-color: rgba(250, 250, 249, .22); }
  .sidebar-foot .btn:hover { border-color: var(--gold); color: #fff; }
}

/* ---------- Page header & filters ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.page-head .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin-bottom: 4px; }
.page-head h1 { font-size: 32px; line-height: 1.1; }
@media (min-width: 1024px) { .page-head h1 { font-size: 38px; } }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.page-head .sub svg { width: 16px; height: 16px; color: var(--accent); }

.filters { margin-bottom: 18px; }
.filters-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters-box > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.filters-box > summary::-webkit-details-marker { display: none; }
.filters-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.filters-toggle { font-size: 13px; color: var(--accent-strong); font-weight: 700; white-space: nowrap; }
.filters-toggle::after { content: " ▾"; }
.filters-box[open] .filters-toggle::after { content: " ▴"; }
.filters-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 14px; align-items: end; }
.filters-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.filters-row label[hidden] { display: none; }
.filters-row .btn { grid-column: 1 / -1; }
.chip { background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; }
select, input[type=date], input[type=text], input[type=email] {
  font: inherit; font-size: 16px; color: var(--text); background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); min-height: 44px; padding: 0 12px; width: 100%; }
select:hover, input:hover { border-color: var(--accent); }
@media (min-width: 900px) {
  .filters-box > summary { display: none; }
  .filters-row { display: flex; flex-wrap: wrap; padding: 12px 14px; }
  .filters-row label { min-width: 170px; flex: 1 1 170px; max-width: 240px; }
  .filters-row .btn { grid-column: auto; }
  form.js .filters-row .btn { display: none; }
}

/* ---------- Buttons, cards, alerts ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
.card-head .muted { font-size: 13px; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-ok { background: var(--good-bg); color: var(--good); }

/* ---------- Grids ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
@media (min-width: 960px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.stack { display: grid; gap: 16px; margin-bottom: 16px; }

/* ---------- Hero (Overview) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 22px; margin-bottom: 16px; color: #fafaf9;
  background: radial-gradient(120% 140% at 100% 0%, rgba(194, 166, 97, .35), transparent 55%),
              linear-gradient(135deg, var(--ink-700), var(--ink-900)); box-shadow: 0 10px 30px rgba(12, 10, 9, .25); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%;
  border: 36px solid rgba(194, 166, 97, .10); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; gap: 18px; }
.hero-label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.hero-value { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 9vw, 56px); line-height: 1.05; margin: 6px 0 8px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hero-change { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.hero-change .pill { background: rgba(111, 207, 151, .18); color: #9be3b8; }
.hero-change .pill.bad { background: rgba(242, 148, 139, .18); color: #ffb3aa; }
.hero-period { color: #c9c3bb; font-size: 13px; margin-top: 6px; }
.hero-compare { display: grid; gap: 10px; align-content: center; }
.hc-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; align-items: center; font-size: 13px; color: #e7e5e4; }
.hc-track { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.hc-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), #e3d49c); }
.hc-bar.ly { background: rgba(231, 229, 228, .4); }
.hc-row strong { font-variant-numeric: tabular-nums; color: #fff; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.hero-stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 10px 12px; }
.hero-stat .l { font-size: 11.5px; color: #bdb7b0; }
.hero-stat .v { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.hero-stat .c { font-size: 12px; font-weight: 600; }
.hero-stat .c.good { color: #9be3b8; } .hero-stat .c.bad { color: #ffb3aa; }
@media (min-width: 900px) {
  .hero { padding: 28px 32px; }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; }
  .hc-row { grid-template-columns: 150px 1fr auto; font-size: 14px; }
}

/* ---------- KPI cards ---------- */
.kpi { padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); opacity: .9; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kpi-value { font-family: var(--serif); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  overflow-wrap: anywhere; margin: 4px 0 6px; }
@media (min-width: 760px) { .kpi-value { font-size: 27px; } }
.kpi-change { font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px;
  background: var(--card-2); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.kpi-note { font-size: 12px; margin-top: 4px; }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; --k: 1; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .grid.zero { stroke: var(--axis); opacity: .45; }
.chart .axis { fill: var(--axis); font-size: calc(12px * var(--k)); font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .area { stroke: none; }
.chart .hover line { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart .hover circle { stroke: var(--card); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .hover rect { fill: var(--accent); opacity: .08; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink-800); color: #fafaf9; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; box-shadow: 0 8px 24px rgba(12, 10, 9, .3); white-space: nowrap; }
.tip b { display: block; margin-bottom: 3px; color: var(--gold); }
.tip .row { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--c); border-radius: 2px; }
.swatch.dash { border-top-style: dashed; }
.tip .swatch { width: 12px; }
.as-table { margin-top: 10px; font-size: 13px; }
.as-table summary { cursor: pointer; color: var(--muted); font-weight: 600; }

/* ---------- Ranked bar lists ---------- */
.barlist { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.barlist li { padding: 10px 0; border-bottom: 1px dashed var(--line); counter-increment: rank; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; }
.barlist li:last-child { border-bottom: 0; }
.barlist li::before { content: counter(rank); grid-row: 1 / span 3; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.barlist li:nth-child(1)::before { background: var(--gold); color: var(--ink-900); border-color: var(--gold); }
.barlist li:nth-child(2)::before { background: #d9d2c8; color: var(--ink-900); border-color: #d9d2c8; }
.barlist li:nth-child(3)::before { background: #d6a27a; color: var(--ink-900); border-color: #d6a27a; }
.barlist.plain li { grid-template-columns: minmax(0, 1fr); }
.barlist.plain li::before { content: none; }
.bl-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.bl-label { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.bl-label a { color: var(--text); text-decoration: none; }
.bl-label a:hover { color: var(--accent-strong); text-decoration: underline; }
.bl-sub { display: block; font-size: 12px; font-weight: 400; }
.bl-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bl-track { height: 8px; margin-top: 7px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.bl-bar { height: 8px; background: var(--c, linear-gradient(90deg, var(--accent), var(--gold))); border-radius: 999px; min-width: 3px; }
.bl-extra { font-size: 12px; margin-top: 5px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.up { color: var(--good); font-weight: 600; } .down { color: var(--bad); font-weight: 600; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: var(--card-2); }
tbody tr:hover td { background: var(--card-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--accent); background: var(--accent-soft); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; text-decoration: none; color: var(--text-2); font-size: 13px; border-radius: 999px; font-weight: 600; }
.seg a.active { background: var(--ink-800); color: #fafaf9; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bad-bg); color: var(--bad); }

.footnote { color: var(--muted); font-size: 12px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(90% 70% at 100% 0%, rgba(194, 166, 97, .28), transparent 60%), linear-gradient(160deg, var(--ink-700), var(--ink-900)); }
.login .card { width: 100%; max-width: 400px; text-align: center; padding: 32px 26px; }


.login h1 { font-size: 22px; margin-bottom: 4px; }
.login-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.login-brand img { max-height: 90px; width: auto; max-width: 100%; }
.login-brand .word-logo { font-size: 30px; }
.btn-ms { width: 100%; background: var(--ink-800); border-color: var(--ink-800); color: #fafaf9; min-height: 48px; }
.btn-ms:hover { background: var(--ink-700); border-color: var(--gold); }

/* Numbers: Montserrat lining figures (Cormorant's old-style digits read badly in figures) */
.hero-value, .kpi-value { font-family: var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.hero-value { font-weight: 700; letter-spacing: -0.03em; }
.kpi-value { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
@media (min-width: 760px) { .kpi-value { font-size: 24px; } }
h2 { font-size: 21px; }

/* Logo sizes */
.sidebar .brandmark img { width: 100%; max-width: 200px; max-height: none; height: auto; }
.mobilebar .brandmark img { max-height: 44px; }

/* ---------- "What changed" highlights ---------- */
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .hl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hl a { display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 12px; align-items: start; padding: 12px 14px; min-height: 64px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); text-decoration: none; height: 100%; }
.hl a:hover { border-color: var(--gold); background: var(--card); }
.hl-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.hl-icon svg { width: 19px; height: 19px; }
.hl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hl-tone { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hl-title { font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.hl-detail { font-size: 13px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.hl-go { color: var(--muted); font-size: 20px; line-height: 1; align-self: center; }
.hl-alert .hl-icon { background: var(--bad-bg); color: var(--bad); } .hl-alert .hl-tone { color: var(--bad); }
.hl-alert a { border-left: 3px solid var(--bad); }
.hl-watch .hl-icon { background: var(--gold-soft); color: var(--accent); } .hl-watch .hl-tone { color: var(--accent); }
.hl-watch a { border-left: 3px solid var(--gold); }
.hl-good .hl-icon { background: var(--good-bg); color: var(--good); } .hl-good .hl-tone { color: var(--good); }
.hl-good a { border-left: 3px solid var(--good); }

/* ---------- Export order tracker ---------- */
.tracker td { vertical-align: middle; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 1px; }
.st-late { background: var(--bad-bg); color: var(--bad); }
.st-ok { background: var(--good-bg); color: var(--good); }
.st-off { background: var(--card-2); color: var(--muted); }
.tracker td:first-child { min-width: 230px; }
.tracker td:nth-child(3) { white-space: nowrap; }
.tracker td:nth-child(5) { white-space: nowrap; }
.st-due { background: var(--gold-soft); color: var(--accent); }
/* Phones: keep "RM 1,926,527" on one line in a half-width card */
@media (max-width: 759px) { .kpi-value { white-space: nowrap; font-size: clamp(16px, 4.8vw, 22px); } .kpi { padding: 12px; } }
/* Phones: each tracker row becomes a card with labelled lines */
@media (max-width: 759px) {
  .tracker thead { display: none; }
  .tracker, .tracker tbody, .tracker tr, .tracker td { display: block; width: 100%; }
  .tracker tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--card-2); }
  .tracker td { border: 0; padding: 4px 0; text-align: right; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-width: 0 !important; }
  .tracker td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
  .tracker td:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .tracker td:first-child::before { content: none; }
  .tracker td > div { display: inline; margin-left: 6px; }
  .tracker tbody tr:hover td { background: transparent; }
}

/* ---------- Language switch + Chinese fonts ---------- */
.lang-switch { display: inline-flex; border: 1px solid rgba(250, 250, 249, .22); border-radius: 999px; padding: 2px; gap: 2px; }
.lang-switch form { margin: 0; }
.lang-switch button { font: inherit; font-size: 12.5px; font-weight: 600; min-height: 32px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; color: #d6d3d1; cursor: pointer; }
.lang-switch button.active { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--ink-900); }
.sidebar-foot .lang-switch { margin-bottom: 12px; }
.mobilebar-actions { display: flex; align-items: center; gap: 8px; }
.login .lang-switch { border-color: var(--line); margin-top: 18px; }
.login .lang-switch button { color: var(--text-2); }
/* Chinese: Montserrat/Cormorant have no Chinese characters, so use good system Chinese fonts */
:lang(zh-Hans) { --sans: "Montserrat", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, sans-serif;
  --serif: "Cormorant", "Songti SC", "Noto Serif SC", "SimSun", "PingFang SC", "Microsoft YaHei", serif; }
:lang(zh-Hans) .kpi-label, :lang(zh-Hans) th, :lang(zh-Hans) .hl-tone, :lang(zh-Hans) .hero-label, :lang(zh-Hans) .eyebrow { letter-spacing: .02em; }

/* ---------- Drill-down page header ---------- */
.profile-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; align-items: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips a.chip { text-decoration: none; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.profile-facts > div { display: flex; flex-direction: column; gap: 2px; }
.profile-facts strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.subhead { font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
td a, .bl-label a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--muted); }
td a:hover, .bl-label a:hover { color: var(--accent-strong); border-bottom-color: var(--accent); }
.credit-facts { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- Excel button, hidden export tables, printing ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.btn-excel { min-height: 32px; padding: 0 10px; font-size: 12.5px; gap: 6px; margin-left: auto; color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.btn-excel:hover { border-color: var(--good); }
.page-actions { display: flex; gap: 8px; }
.page-actions .btn svg { width: 16px; height: 16px; }
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  :root { color-scheme: light; --bg: #fff; --card: #fff; --card-2: #f6f6f5; --shadow: none; }
  body { background: #fff; font-size: 11px; }
  .sidebar, .mobilebar, .tabbar, .filters, .no-print, .as-table summary, .hl-go, .lang-switch { display: none !important; }
  .app { display: block; }
  .page { padding: 0; max-width: none; }
  .print-only { display: block; }
  .print-meta { color: #57534e; font-size: 10px; }
  .card, .hero, section, tr, .kpi, .hl { break-inside: avoid; page-break-inside: avoid; }
  .card { box-shadow: none; border-color: #ddd; }
  .hero { background: #1c1917 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpis.six, .kpis.four { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .table-scroll { overflow: visible; }
  a { color: inherit; text-decoration: none; border: 0 !important; }
  .chart .tip { display: none !important; }
  .page-head h1 { font-size: 24px; }
}
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; } .check input { width: 18px; height: 18px; accent-color: var(--accent); }
