:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --card: #ffffff;
  --line: #e4e3df;
  --line-soft: #efeeea;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #7a7974;
  --brand: #047857;
  --brand-ink: #ffffff;
  --brand-soft: #e7f5ef;
  --hero: #047857;
  --series-1: #059669;
  --grid: #ecebe7;
  --good: #047857;
  --bad: #c0362c;
  --warn: #a15c00;
  --chip: #ecebe7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111110;
    --card: #1a1a19;
    --line: #2c2c2a;
    --line-soft: #242422;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --ink-3: #8f8e86;
    --brand: #0e9f6e;
    --brand-ink: #ffffff;
    --brand-soft: #16302a;
    --hero: #0a6b4c;
    --series-1: #0e9f6e;
    --grid: #2a2a28;
    --good: #34c38f;
    --bad: #f07a70;
    --warn: #e0a64a;
    --chip: #262624;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 'Segoe UI', Inter, system-ui, -apple-system, 'Noto Sans Bengali', 'Nirmala UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.boot { padding: 48px; text-align: center; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.neg { color: var(--bad); }
.pos { color: var(--good); }

/* ---------- top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 56px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--chip); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink-2); white-space: nowrap; }
.link { background: none; border: 0; padding: 4px 6px; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- page */
.page { max-width: 1200px; margin: 0 auto; padding: 24px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.head h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.head p { margin: 2px 0 0; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.chips button {
  border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
}
.chips button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.range { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.range input, .select, .field input, .field select {
  height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.select { min-width: 160px; }

/* ---------- cards & tiles */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 20px; min-width: 0;
}
.card h2 { margin: 0 0 14px; font-size: 15px; letter-spacing: -0.01em; }
.card h2 .faint { font-weight: 400; font-size: 13px; }
.tile .label { color: var(--ink-2); font-size: 13px; }
.tile .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.tile .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.tile.hero { background: var(--hero); border-color: var(--hero); color: var(--brand-ink); }
.tile.hero .label, .tile.hero .sub { color: rgba(255, 255, 255, 0.82); }
.section { margin-top: 16px; }
.section-title { margin: 28px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; }

.biz { display: flex; flex-direction: column; gap: 14px; }
.biz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.biz-head h2 { margin: 0; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.kv div span { display: block; color: var(--ink-2); font-size: 12.5px; }
.kv div b { font-size: 17px; }
.soon { border-style: dashed; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.badge.ok { background: var(--brand-soft); color: var(--brand); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }

/* ---------- tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
td .s { display: block; font-size: 12px; color: var(--ink-3); }
tr.void td { color: var(--ink-3); text-decoration: line-through; }
.lines { display: flex; flex-direction: column; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.line:last-child { border-bottom: 0; }
.line.total { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 10px; }
.empty { color: var(--ink-3); text-align: center; padding: 28px 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px -20px 12px; padding: 0 20px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 12px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- chart */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .bar { fill: var(--series-1); }
.chart .bar:hover, .chart .bar.hot { opacity: 0.8; }
.chart .peak { fill: var(--ink); font-size: 11px; font-weight: 600; }
.tip {
  position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--card);
  padding: 6px 9px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}

/* ---------- forms, buttons, login */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 0; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-weight: 600; cursor: pointer;
}
.btn.ghost { background: var(--chip); color: var(--ink); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; font-weight: 500; }
.btn:disabled { opacity: 0.6; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.err { color: var(--bad); min-height: 1.4em; font-size: 13px; }
.note { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.key {
  font: 600 16px/1.3 ui-monospace, Consolas, monospace; letter-spacing: 0.04em; padding: 12px 14px; border-radius: 10px;
  background: var(--chip); word-break: break-all; user-select: all;
}
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login .brand { justify-content: center; font-size: 18px; margin-bottom: 4px; }
.login input { height: 40px; }
.login .btn { height: 42px; }

/* ---------- modal */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- responsive */
@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21, .g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 8px 12px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 12px 8px; }
  .page { padding: 16px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .tile .value { font-size: 21px; }
  .card { padding: 16px; }
  .table-wrap, .tabs { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .head h1 { font-size: 19px; }
}
