/* ============================================================
   IBD SALES LIVE - glass theme in Kores colours
   ============================================================ */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: Inter; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/inter-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }

:root {
  --ink: #0E2238; --ink2: #3F5672; --ink3: #7489A1;
  --blue: #0B6FB8; --blue-d: #084F86; --sky: #8CC8EC; --red: #D7261E; --green: #0F8A5F; --amber: #C9772E;
  --bg0: #051627; --bg1: #0A3355; --bg2: #0D5A86; --bg3: #138AA8;
  --glass: rgba(255,255,255,.16); --glass-b: rgba(255,255,255,.30);
  --card: rgba(255,255,255,.86); --card-2: rgba(255,255,255,.72); --card-b: rgba(255,255,255,.70);
  --line: rgba(14,34,56,.09);
  --r-xl: 28px; --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 10px 34px rgba(3,22,42,.18), 0 1px 0 rgba(255,255,255,.6) inset;
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg1); }
body { font-family: var(--font); color: var(--ink); font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; background: transparent; }
body::before { content: ''; position: fixed; inset: 0; z-index: -2;
  background: radial-gradient(60vw 60vw at 0% 0%, rgba(31,127,196,.55), transparent 60%),
              radial-gradient(45vw 45vw at 100% 35%, rgba(24,163,185,.40), transparent 60%),
              radial-gradient(40vw 40vw at 45% 110%, rgba(215,38,30,.14), transparent 60%),
              linear-gradient(140deg, var(--bg0) 0%, var(--bg1) 34%, var(--bg2) 68%, var(--bg3) 100%); }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; }
.muted { color: var(--ink3); } .tiny { font-size: 12px; } .dim { color: var(--ink3); }

/* soft colour blobs behind the glass */
.backdrop { display: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.b1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: #1F7FC4; }
.b2 { width: 38vw; height: 38vw; right: -10vw; top: 20vh; background: #18A3B9; opacity: .45; }
.b3 { width: 30vw; height: 30vw; left: 30vw; bottom: -16vw; background: #D7261E; opacity: .16; }

.glass { background: var(--glass); border: 1px solid var(--glass-b); backdrop-filter: blur(26px) saturate(140%); -webkit-backdrop-filter: blur(26px) saturate(140%); box-shadow: 0 30px 80px rgba(2,16,32,.35); }
.glass-dark { background: rgba(9,42,70,.62); border: 1px solid rgba(255,255,255,.14); color: #EAF4FB; box-shadow: 0 18px 50px rgba(2,16,32,.25); }
.top.glass-dark { background: linear-gradient(90deg, #0A2A47, #0B3354); border-color: rgba(255,255,255,.10); box-shadow: 0 10px 30px rgba(2,16,32,.45); }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 13px; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, #E53A2F, #C11F17); color: #fff; box-shadow: 0 8px 20px rgba(215,38,30,.35); }
.btn.dark { background: #0B1D31; color: #fff; box-shadow: 0 8px 20px rgba(5,22,39,.35); }
.btn.dark:hover { background: #12304F; }
.btn.soft { background: rgba(255,255,255,.55); color: var(--ink); border: 1px solid rgba(255,255,255,.7); }
.btn.soft:hover { background: rgba(255,255,255,.8); }
.btn.ghost { background: transparent; color: var(--ink2); border: 1px solid rgba(14,34,56,.15); }
.btn.ghost:hover { background: rgba(255,255,255,.5); }
.btn.sm { padding: 7px 13px; font-size: 12px; }
.btn.wide { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #EAF4FB; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: rgba(255,255,255,.18); }
.icon-btn.light { color: var(--ink); background: rgba(255,255,255,.6); border-color: rgba(255,255,255,.8); }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- login ---------------- */
#login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; border-radius: var(--r-xl); padding: 34px 32px 26px; color: #fff; text-align: center; }
.login-card h1 { margin: 18px 0 4px; font-size: 22px; letter-spacing: -.3px; }
.login-card .muted { color: rgba(234,244,251,.7); margin: 0 0 22px; }
.login-card label { display: block; text-align: left; font-size: 12px; font-weight: 600; color: rgba(234,244,251,.85); margin-bottom: 14px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 14px; outline: none; }
.login-card input:focus { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.2); }
.login-card .tiny { margin: 14px 0 0; }
.err { min-height: 18px; color: #FFB4AE; font-size: 12.5px; font-weight: 600; margin: -4px 0 10px; text-align: left; }
.logo-chip { background: rgba(255,255,255,.94); border-radius: 14px; padding: 8px 10px; display: inline-grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.logo-chip img { height: 26px; display: block; }
.logo-chip.lg { padding: 0; border-radius: 0; background: transparent; box-shadow: none; } .logo-chip.lg img { height: 72px; width: auto; }

/* ---------------- shell ---------------- */
#shell { display: grid; grid-template-columns: 252px 1fr; gap: 18px; padding: 18px; min-height: 100vh; }
.side { border-radius: var(--r-xl); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 18px; height: calc(100vh - 36px); }
.brand { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 2px 2px 16px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 8px; }
.logo-chip.wide { display: block; padding: 6px 6px 0; border-radius: 0; background: transparent; box-shadow: none; }
.logo-chip.wide img { width: 100%; height: auto; max-width: 200px; display: block; }
.b-text { padding: 0 6px; }
.b-title { font-weight: 800; font-size: 19px; letter-spacing: -.3px; line-height: 1.2; } .b-sub { font-size: 11.5px; color: rgba(234,244,251,.6); }
.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(234,244,251,.45); padding: 14px 10px 6px; }
.nav button { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; background: transparent; color: rgba(234,244,251,.82); border-radius: 12px; cursor: pointer; font-size: 13.5px; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav button.on { background: linear-gradient(180deg, rgba(57,170,232,.95), rgba(11,111,184,.95)); color: #fff; box-shadow: 0 8px 22px rgba(11,111,184,.45), 0 1px 0 rgba(255,255,255,.3) inset; font-weight: 600; }
.nav button span { flex: 1; }
.nav-badge { font-size: 11px; font-weight: 700; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.14); text-align: center; }
.nav-badge:empty { display: none; }
.side-foot { margin-top: auto; padding-top: 14px; }
.fy-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 12px 13px; font-size: 12px; }
.fy-row { display: flex; justify-content: space-between; color: rgba(234,244,251,.75); } .fy-row b { color: #fff; }
.fy-bar { height: 6px; background: rgba(255,255,255,.14); border-radius: 99px; margin: 9px 0 7px; overflow: hidden; }
.fy-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #7CC6EE, #fff); transition: width .6s; }
.fy-note { color: rgba(234,244,251,.6); font-size: 11.5px; }

.main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.top { border-radius: 0 0 26px 26px; padding: 27px 12px 10px 14px; margin-top: -18px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 50; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; min-width: 0; max-width: 520px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 0 14px; }
.search svg { color: rgba(234,244,251,.6); width: 17px; }
.search input { flex: 1; background: transparent; border: 0; outline: none; color: #fff; font: inherit; font-size: 13.5px; padding: 10px 0; min-width: 0; }
.search input::placeholder { color: rgba(234,244,251,.5); }
.search kbd { font: inherit; font-size: 11px; color: rgba(234,244,251,.55); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: 1px 6px; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: rgba(255,255,255,.97); color: var(--ink); border-radius: 18px; box-shadow: 0 24px 60px rgba(2,16,32,.35); padding: 8px; max-height: 420px; overflow-y: auto; z-index: 50; }
.sugg .sg-h { font-size: 10.5px; font-weight: 700; color: var(--ink3); text-transform: uppercase; letter-spacing: .8px; padding: 8px 10px 4px; }
.sugg button { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.sugg button:hover, .sugg button.act { background: #EAF4FB; }
.sugg button small { margin-left: auto; color: var(--ink3); font-size: 11.5px; white-space: nowrap; }
.sugg svg { width: 15px; height: 15px; color: var(--blue); }
.sugg .sg-empty { padding: 14px; color: var(--ink3); font-size: 13px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ason { display: flex; align-items: center; gap: 9px; padding: 0 8px; }
.ason-l { font-size: 10.5px; color: rgba(234,244,251,.55); text-transform: uppercase; letter-spacing: .6px; } .ason-v { font-size: 12.5px; font-weight: 600; color: #fff; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 4px rgba(74,222,128,.18); }
.user { display: flex; align-items: center; gap: 9px; padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2FA3DC, #0B6FB8); }
.user-t { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.2; } .user-s { font-size: 11px; color: rgba(234,244,251,.6); font-weight: 500; }

/* ---------------- content panel ---------------- */
.content { border-radius: var(--r-xl); padding: 26px 26px 18px; min-width: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.34), rgba(255,255,255,.18)); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 30px 80px rgba(2,16,32,.28); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.6px; color: var(--ink); }
.page-head .sub { margin: 6px 0 0; color: #fff; font-size: 14px; font-weight: 500; text-shadow: 0 1px 2px rgba(5,22,39,.35); }
.head-acts { display: flex; gap: 10px; }

/* slicers */
.slicers { position: relative; z-index: 20; display: grid; align-items: end; gap: 12px 12px; margin: 20px 0 8px; padding: 14px 16px; border-radius: var(--r-lg);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.7); }
.sl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sl > select, .sl > .seg, .sl > .ms { width: 100%; }
.sl > .seg button { flex: 1; padding: 0 6px; }
.sl > label { font-size: 10.5px; font-weight: 700; color: var(--ink3); text-transform: uppercase; letter-spacing: .7px; padding-left: 4px; }
.sl select, .ms-btn { height: 36px; border-radius: 12px; border: 1px solid rgba(14,34,56,.12); background: rgba(255,255,255,.85); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; padding: 0 12px; cursor: pointer; outline: none; }
.sl select { padding-right: 30px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237489A1' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.sl select:focus, .ms-btn:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,111,184,.15); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(14,34,56,.07); height: 36px; }
.seg button { border: 0; background: transparent; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.seg button.on { background: #0B1D31; color: #fff; box-shadow: 0 4px 10px rgba(5,22,39,.25); }
.seg button:disabled { opacity: .35; cursor: default; }
.seg.sm { height: 32px; } .seg.sm button { font-size: 12px; padding: 0 12px; }
.slicers .reset { height: 36px; align-self: end; width: 100%; justify-content: center; }

/* multi-select */
.ms { position: relative; min-width: 150px; }
.ms-btn { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; }
.ms-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink3); }
.ms.has-sel .ms-btn { border-color: rgba(11,111,184,.5); background: #EAF4FB; } .ms.has-sel .ms-val { color: var(--blue-d); font-weight: 600; }
.ms-caret { width: 14px; height: 14px; color: var(--ink3); }
.ms-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; color: var(--ink); width: max(100%, 300px); background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(2,16,32,.28); padding: 8px; }
.ms-search input { width: 100%; border: 1px solid rgba(14,34,56,.14); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.ms-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 0 6px; }
.ms-acts button { border: 0; background: #EEF4F9; border-radius: 9px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--blue-d); cursor: pointer; text-align: center; transition: background .15s, color .15s; }
.ms-acts button:hover { background: #0B6FB8; color: #fff; }
.ms-list { max-height: 280px; overflow-y: auto; }
.ms-opt { display: flex; gap: 9px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: pointer; line-height: 1.3; }
.ms-opt:hover { background: #F2F7FB; }
.ms-opt input { margin-top: 2px; accent-color: var(--blue); }
.ms-opt small { display: block; color: var(--ink3); font-size: 11px; font-weight: 400; margin-top: 1px; }
.ms-empty { padding: 12px; color: var(--ink3); font-size: 13px; }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.fchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--blue-d); background: #EAF4FB; border: 1px solid rgba(11,111,184,.25); border-radius: 999px; padding: 4px 6px 4px 11px; }
.fchip button { border: 0; background: rgba(11,111,184,.12); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--blue-d); }
.fchip svg { width: 11px; height: 11px; stroke-width: 2.6; }
.partial { margin: 8px 0 0; font-size: 12.5px; color: #8A4B10; background: rgba(255,237,213,.75); border: 1px solid rgba(201,119,46,.3); border-radius: 12px; padding: 7px 12px; }

/* ---------------- cards & grids ---------------- */
.page { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g-ov { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-map { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
.card { background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--card-b); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.card-h p { margin: 3px 0 0; color: var(--ink3); font-size: 12.5px; }
.pill-note { font-size: 11.5px; color: var(--ink2); background: rgba(255,255,255,.7); border: 1px solid rgba(14,34,56,.08); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.chart { width: 100%; }
.h200 { height: 200px; } .h220 { height: 220px; } .h280 { height: 280px; } .h300 { height: 300px; } .h360 { height: 360px; } .h420 { height: 420px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { position: relative; background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--card-b); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px 15px; min-width: 0; transition: transform .18s ease, box-shadow .18s ease; }
.kpi[data-go] { cursor: pointer; }
.kpi[data-go]::after { content: '→'; position: absolute; right: 16px; bottom: 14px; font-size: 14px; color: var(--ink3); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.kpi.hero[data-go]::after { color: rgba(255,255,255,.8); }
.kpi[data-go]:hover::after { opacity: 1; transform: none; }
.kpi[data-go]:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(3,22,42,.22), 0 1px 0 rgba(255,255,255,.6) inset; }
.kpi .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); color: var(--blue); box-shadow: 0 3px 10px rgba(3,22,42,.10); }
.kpi .ic svg { width: 16px; height: 16px; }
.kpi .tag { position: absolute; top: 16px; right: 16px; }
.kpi .v { font-size: 27px; font-weight: 800; letter-spacing: -.8px; margin: 12px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { font-size: 13px; font-weight: 600; color: var(--ink3); margin-left: 3px; letter-spacing: 0; }
.kpi .l { font-size: 13px; font-weight: 600; color: var(--ink); }
.kpi .s { font-size: 12px; color: var(--ink3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero { background: linear-gradient(160deg, rgba(11,111,184,.92), rgba(8,79,134,.95)); color: #fff; border-color: rgba(255,255,255,.25); }
.kpi.hero .l { color: #fff; } .kpi.hero .s { color: rgba(234,244,251,.75); } .kpi.hero .v small { color: rgba(234,244,251,.7); }
.kpi.hero .ic { background: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.chip.up { color: var(--green); background: rgba(15,138,95,.12); } .chip.down { color: var(--red); background: rgba(215,38,30,.10); }
.chip.flat { color: var(--ink2); background: rgba(14,34,56,.07); }
.kpi.hero .chip.flat { color: #fff; background: rgba(255,255,255,.18); }
.kpi.hero .chip.up { color: #CFFBE6; background: rgba(15,138,95,.45); } .kpi.hero .chip.down { color: #FFE0DE; background: rgba(215,38,30,.45); }

/* donut legend */
.legend-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 4px; }
.legend-list div { display: flex; align-items: center; gap: 7px; font-size: 12px; min-width: 0; cursor: pointer; padding: 3px 4px; border-radius: 6px; }
.legend-list div:hover { background: rgba(255,255,255,.6); }
.legend-list i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend-list span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.legend-list b { font-variant-numeric: tabular-nums; font-size: 12px; }

/* leaderboards & movers */
.leader { display: flex; flex-direction: column; gap: 10px; }
.ld { cursor: pointer; } .ld:hover .ld-n { color: var(--blue); }
.ld-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.ld-n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ld-v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-bar { height: 6px; border-radius: 99px; background: rgba(14,34,56,.07); margin-top: 5px; overflow: hidden; }
.ld-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2FA3DC, #0B6FB8); }
.movers { display: flex; flex-direction: column; }
.mv { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.mv:last-child { border-bottom: 0; } .mv:hover { background: rgba(255,255,255,.45); border-radius: 10px; }
.mv .rk { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: rgba(14,34,56,.07); color: var(--ink2); }
.mv .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .mv .nm small { display: block; font-weight: 500; color: var(--ink3); font-size: 11.5px; }
.mv .dv { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv .dv.up { color: var(--green); } .mv .dv.down { color: var(--red); }
.mv .pv { font-size: 11.5px; color: var(--ink3); white-space: nowrap; text-align: right; min-width: 92px; }
.empty-note { color: var(--ink3); font-size: 13px; padding: 12px 4px; }

.scope-row { display: flex; align-items: center; gap: 12px; margin-bottom: -4px; flex-wrap: wrap; }
.scope-row .seg { background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(3,22,42,.10); }
.scope-row .muted { color: var(--ink2); background: rgba(255,255,255,.55); padding: 4px 10px; border-radius: 999px; }

/* tables */
.t-tools { display: flex; align-items: center; gap: 10px; }
.t-search { height: 34px; border-radius: 999px; border: 1px solid rgba(14,34,56,.12); background: rgba(255,255,255,.85); padding: 0 14px; font: inherit; font-size: 13px; width: 220px; outline: none; }
.t-search:focus { border-color: var(--blue); }
.count { font-size: 12px; color: var(--ink3); white-space: nowrap; }
.t-scroll { overflow-x: auto; margin: 0 -8px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink3); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid rgba(14,34,56,.12); cursor: pointer; white-space: nowrap; user-select: none; background: rgba(255,255,255,.4); }
.tbl th:first-child { border-top-left-radius: 10px; } .tbl th:last-child { border-top-right-radius: 10px; }
.tbl th i::after { content: ''; margin-left: 4px; font-style: normal; }
.tbl th.sorted.desc i::after { content: '▾'; color: var(--blue); } .tbl th.sorted.asc i::after { content: '▴'; color: var(--blue); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td.wrap { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td.strong { font-weight: 600; }
.tbl td small { display: block; color: var(--ink3); font-size: 11px; font-weight: 500; }
.tbl.clickable tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.55); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid rgba(14,34,56,.18); border-bottom: 0; background: rgba(255,255,255,.35); }
.tbl td.empty { text-align: center; color: var(--ink3); padding: 26px; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .trk { width: 70px; height: 6px; border-radius: 99px; background: rgba(14,34,56,.07); overflow: hidden; }
.bar-cell .trk span { display: block; height: 100%; background: linear-gradient(90deg, #2FA3DC, #0B6FB8); border-radius: 99px; }
.t-more { text-align: center; padding: 12px 0 2px; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.badge.new { background: rgba(15,138,95,.13); color: var(--green); }
.badge.lapsed { background: rgba(215,38,30,.10); color: var(--red); }
.badge.in { background: rgba(201,119,46,.14); color: var(--amber); }

/* states */
.state { padding: 70px 20px; text-align: center; color: var(--ink2); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(11,111,184,.2); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(14,34,56,.08); font-size: 11.5px; color: var(--ink2); }

/* detail pop-up (centred) */
.scrim { position: fixed; inset: 0; background: rgba(3,16,30,.55); z-index: 60; }
.drill { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1220px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  border-radius: 26px; padding: 22px 24px 20px; background: linear-gradient(170deg, #F4F9FD, #E4F0F9); border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 40px 120px rgba(2,16,32,.55); animation: popin .22s cubic-bezier(.2,.9,.3,1.1); overscroll-behavior: contain; }
@keyframes popin { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
.dm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dm-id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; flex: 1; }
.dm-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2FA3DC, #0B6FB8); flex: none; box-shadow: 0 8px 18px rgba(11,111,184,.35); }
.dm-icon svg { width: 22px; height: 22px; }
.drill-k { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 1px; }
.drill h2 { margin: 3px 0 6px; font-size: 22px; letter-spacing: -.4px; line-height: 1.2; }
.dm-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-facts span { font-size: 11.5px; font-weight: 600; color: var(--ink2); background: rgba(255,255,255,.85); border: 1px solid rgba(14,34,56,.08); border-radius: 999px; padding: 3px 10px; }
.dm-facts span b { color: var(--ink); font-weight: 700; }
.dm-acts { display: flex; gap: 8px; align-items: center; }
.dm-scope { margin: 14px 0 0; font-size: 12px; color: var(--ink3); }
.dm-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 10px 0 12px; }
.dk { background: #fff; border: 1px solid rgba(14,34,56,.06); border-radius: 16px; padding: 12px 14px; box-shadow: 0 4px 14px rgba(3,22,42,.06); min-width: 0; }
.dk.hero { background: linear-gradient(160deg, #0B6FB8, #084F86); color: #fff; } .dk.hero .dl { color: rgba(234,244,251,.8); }
.dk .dv { font-size: 20px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk .dv small { font-size: 11px; font-weight: 600; opacity: .7; margin-left: 2px; }
.dk .dl { font-size: 11.5px; color: var(--ink3); font-weight: 600; }
.dk .ds { font-size: 11px; color: var(--ink3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dk.hero .ds { color: rgba(234,244,251,.75); }
.dk .chip { margin-top: 5px; } .dk.hero .chip.up { color: #CFFBE6; background: rgba(15,138,95,.45); } .dk.hero .chip.down { color: #FFE0DE; background: rgba(215,38,30,.45); } .dk.hero .chip.flat { color: #fff; background: rgba(255,255,255,.18); }
.dm-row { display: grid; gap: 12px; margin-top: 12px; }
.dm-row.r3 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); }
.dm-row.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dm-card { background: #fff; border: 1px solid rgba(14,34,56,.06); border-radius: 18px; padding: 14px 16px; box-shadow: 0 4px 14px rgba(3,22,42,.06); min-width: 0; }
.dm-card h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.dm-card h4 span { font-size: 11px; font-weight: 500; color: var(--ink3); }
.dm-scroll { max-height: 300px; overflow: auto; margin: 0 -8px; } .dm-scroll.tall { max-height: 340px; }
.dm-scroll .tbl th { background: #F3F7FB; }
@media (max-width: 1100px) { .dm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dm-row.r3 { grid-template-columns: 1fr 1fr; } .dm-row.r3 .dm-card:first-child { grid-column: 1 / -1; } }
@media (max-width: 700px) { .drill { padding: 16px 14px; border-radius: 20px; } .dm-kpis { grid-template-columns: 1fr 1fr; } .dm-row.r3, .dm-row.r2 { grid-template-columns: 1fr; } .drill h2 { font-size: 18px; } .dm-acts { width: 100%; justify-content: flex-end; } }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #0B1D31; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: 0 14px 34px rgba(0,0,0,.3); z-index: 80; }

/* customer groups: donut + table side by side (Summary page) */
.cg-split { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(0, 3fr); gap: 24px; align-items: center; }
.cg-tbl { overflow-x: auto; }
.tbl.cg-t tbody tr[data-cg] { cursor: pointer; }
.tbl.cg-t th { cursor: default; }
.tbl.cg-t td { padding: 8px 10px; }
.cg-n { display: inline-flex; align-items: center; gap: 8px; }
.cg-n i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cg-sh { display: inline-block; width: 54px; height: 6px; border-radius: 3px; background: rgba(14,34,56,.08); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.cg-sh span { display: block; height: 100%; border-radius: 3px; }
.tbl td.pos { color: var(--green); }
@media (max-width: 1180px) { .cg-split { grid-template-columns: 1fr; gap: 8px; } }

/* ---------------- responsive ---------------- */
@media (max-width: 1540px) {
  .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .g-ov, .g-map { grid-template-columns: 1fr; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis, .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ason { display: none; }
}
@media (max-width: 900px) {
  .slicers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #shell { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .side { position: fixed; z-index: 70; left: 10px; top: 10px; bottom: 10px; height: auto; width: 250px; transform: translateX(-110%); transition: transform .22s; background: rgba(6,30,52,.94); }
  body.menu-open .side { transform: none; }
  .menu-btn { display: grid; }
  .top { top: 0; margin-top: -10px; padding-top: 18px; border-radius: 0 0 22px 22px; }
  .user-t, .search kbd { display: none; }
  .content { padding: 18px 16px 14px; border-radius: 22px; }
  .page-head h1 { font-size: 22px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .t-search { width: 150px; }
}
@media (max-width: 560px) {
  .kpis, .kpis.k4, .kpis.k6 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 13px 12px; } .kpi .v { font-size: 21px; } .kpi .tag { top: 12px; right: 10px; }
  .slicers { padding: 10px; }
  .slicers { grid-template-columns: 1fr 1fr; } .ms { min-width: 0; }
  .sl.seg-sl { grid-column: 1 / -1; }
  .user { display: none; } .top { gap: 8px; padding: 8px; } .search { padding: 0 10px; }
  .head-acts .btn { padding: 9px 12px; }
  .card { padding: 14px 14px; }
}
@media print {
  body { background: #fff; } .side, .top, .slicers, .head-acts, .backdrop { display: none !important; }
  #shell { display: block; padding: 0; } .content { box-shadow: none; border: 0; background: #fff; }
}

/* ---------------- interactions ---------------- */
.page { animation: pagein .28s ease-out; }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } }
html { scroll-behavior: smooth; }
.chart { cursor: default; }
.hint-x { font-size: 11.5px; color: var(--ink3); }
.sel-note { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--blue-d); background: #EAF4FB; border: 1px solid rgba(11,111,184,.25); border-radius: 999px; padding: 4px 6px 4px 10px; }
.sel-note button { border: 0; background: rgba(11,111,184,.14); border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--blue-d); padding: 2px 8px; cursor: pointer; }
.tbl tbody tr { transition: background .12s; }
.tbl.clickable tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--blue); }

/* download menus */
.dl-wrap { position: relative; display: inline-flex; }
.dl-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(14,34,56,.10); background: rgba(255,255,255,.85); color: var(--ink2); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.dl-btn:hover, .dl-wrap.open .dl-btn { background: #0B1D31; color: #fff; }
.dl-btn svg { width: 15px; height: 15px; }
.dl-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: #fff; border-radius: 14px; box-shadow: 0 18px 44px rgba(2,16,32,.26); padding: 6px; z-index: 55; }
.dl-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; }
.dl-menu button:hover { background: #EEF5FB; }
.dl-menu button b { font-size: 10.5px; font-weight: 700; color: #fff; border-radius: 5px; padding: 2px 5px; min-width: 34px; text-align: center; }
.dl-menu .png { background: #16A394; } .dl-menu .pdf { background: #D7261E; } .dl-menu .xls { background: #0F8A5F; }
.card-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.head-acts .dl-menu { min-width: 230px; }
.busy { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(3,16,30,.25); }
.busy div { background: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 600; display: flex; gap: 12px; align-items: center; box-shadow: 0 18px 44px rgba(0,0,0,.3); }
.busy .spinner { width: 20px; height: 20px; border-width: 2.5px; }
@media (prefers-reduced-motion: reduce) { .page, .drill { animation: none; } html { scroll-behavior: auto; } }
#t-raw td, #t-raw th { white-space: nowrap; }
#t-raw td { padding: 7px 10px; }
.tbl td.neg { color: var(--red); }
.dm-card .tbl { font-size: 12px; } .dm-card .tbl th { font-size: 10.5px; padding: 8px 8px; } .dm-card .tbl td { padding: 7px 8px; }
.dm-card .tbl td.wrap { max-width: 240px; }
@media (max-width: 700px) { .dm-acts { flex-wrap: wrap; } #dr-csv span, .dm-acts .btn { font-size: 12px; } .dm-facts span { font-size: 11px; } }

/* BA DTC: keep dates on one line in the invoice-lines table */
#t-lines td:first-child{white-space:nowrap}

/* Year comparison page */
.cmp-bar { display: grid; grid-template-columns: minmax(150px, 190px) minmax(150px, 190px) minmax(240px, 340px) 1fr; gap: 12px 14px; align-items: end; position: relative; z-index: 5; }
.cmp-note { font-size: 12.5px; color: var(--ink2); line-height: 1.45; align-self: center; }
.cmp-note b { color: var(--ink); }
.cmp-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--ink3); margin: 6px 4px -6px; }
#cmp-cust .kpi .l { white-space: normal; }
@media (max-width: 900px) { .cmp-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cmp-bar .cmp-wide, .cmp-note { grid-column: 1 / -1; } }
