/* ============================================================
   Thebidesh Business OS — Executive Dashboard theme
   Dark, colourful, self-contained (no CDN — fonts are self-hosted)
   ============================================================ */

/* ---- Bangla-first typography -------------------------------------------
   Self-hosted variable Noto Sans Bengali (~100 KB).  No external request,
   so the dashboard renders Bangla correctly on every device and stays fast
   on a slow international link. */
@font-face {
  font-family: 'Noto Sans Bengali';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/noto-bengali-var.woff2') format('woff2-variations');
}
html, body, button, input, select, textarea {
  font-family: 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

:root {
  --bg: #070b15;
  --bg-2: #0b1120;
  --panel: #0f1729;
  --panel-2: #131d33;
  --line: #1e2a44;
  --line-soft: #17203a;
  --ink: #e9eefb;
  --ink-2: #b7c3dd;
  --muted: #7d8cb0;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --green: #22c55e;
  --amber: #f59e0b;
  --violet: #a855f7;
  --rose: #f43f5e;
  --teal: #14b8a6;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Noto Sans", "Noto Sans Bengali", "Hind Siliguri", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(59,130,246,.16), transparent 60%),
    radial-gradient(760px 400px at 88% 4%, rgba(168,85,247,.12), transparent 62%),
    radial-gradient(700px 420px at 50% 110%, rgba(34,211,238,.08), transparent 60%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 14px; color: var(--ink-2); }
code { background: #16203a; padding: 2px 6px; border-radius: 6px; font-size: 12px; color: var(--cyan); }

/* ---------------- layout ---------------- */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: 244px; flex: 0 0 244px;
  background: linear-gradient(180deg, #0c1424 0%, #090f1c 100%);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  padding: 4px 8px 18px;
}
.brand .dot {
  width: 11px; height: 11px; border-radius: 4px; flex: 0 0 11px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 0 0 4px rgba(59,130,246,.16), 0 0 18px rgba(34,211,238,.5);
}
.brand.big { font-size: 19px; justify-content: center; padding-bottom: 6px; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 14px; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(59,130,246,.1); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--c, #3b82f6) 92%, transparent),
    color-mix(in srgb, var(--c, #22d3ee) 62%, transparent));
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--c, #3b82f6) 34%, transparent);
}
/* the three service lines carry their own accent colour */
.nav-item.active .ic { color: #fff; }
.nav-item .ic {
  width: 18px; height: 18px; flex: 0 0 18px;
  display: flex; align-items: center; justify-content: center;
}
.ic-svg { display: block; }
.icon-btn { display: inline-flex; align-items: center; }

.side-foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }

.main { flex: 1; min-width: 0; padding: 20px 24px 56px; }

/* ---------------- pipeline stage chips ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip {
  --c: #3b82f6;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  color: var(--text); font-size: 12.5px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s;
}
.chip:hover {
  background: color-mix(in srgb, var(--c) 24%, transparent);
  border-color: color-mix(in srgb, var(--c) 60%, transparent);
  transform: translateY(-1px);
}
.chip.active {
  background: color-mix(in srgb, var(--c) 30%, transparent);
  border-color: color-mix(in srgb, var(--c) 75%, transparent);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.chip .n {
  min-width: 20px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: color-mix(in srgb, var(--c) 26%, transparent);
  font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 220px; }

/* ---------------- main category tabs (jatri · agent · agency · rl) ---- */
.party-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.ptab {
  --c: #3b82f6;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 15px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  background: color-mix(in srgb, var(--c) 11%, transparent);
  text-decoration: none; color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.ptab:hover {
  background: color-mix(in srgb, var(--c) 20%, transparent);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  transform: translateY(-1px);
}
.ptab.active {
  background: color-mix(in srgb, var(--c) 26%, transparent);
  border-color: color-mix(in srgb, var(--c) 72%, transparent);
}
.ptab .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.ptab .lbl { font-size: 14px; font-weight: 650; }
.ptab .en { font-size: 11px; color: var(--muted); }
.ptab .n {
  min-width: 22px; padding: 1px 8px; border-radius: 999px; text-align: center;
  font-size: 12px; background: color-mix(in srgb, var(--c) 26%, transparent);
  font-variant-numeric: tabular-nums;
}
.stage-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  margin-bottom: 16px;
}
.stage-head .big { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.stage-head h2 { font-size: 20px; margin: 0; }
.stage-head .cnt { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stage-head .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------------- interview calendar ---------------- */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow {
  text-align: center; font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; padding: 7px 0;
}
.cal-day {
  position: relative; display: block; min-height: 78px; padding: 8px 9px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); text-decoration: none;
  transition: background .15s, border-color .15s, transform .12s;
}
.cal-day:hover {
  text-decoration: none; transform: translateY(-1px);
  background: color-mix(in srgb, #06b6d4 16%, transparent);
  border-color: color-mix(in srgb, #06b6d4 55%, transparent);
}
.cal-day.out { opacity: .3; }
.cal-day.today { border-color: #22d3ee; box-shadow: inset 0 0 0 1px #22d3ee; }
.cal-day.has { background: color-mix(in srgb, #06b6d4 13%, transparent); }
.cal-day .dnum { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-day .who {
  display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.35;
  color: var(--muted); overflow: hidden; max-height: 28px;
}
.cal-day .badge {
  position: absolute; right: 7px; bottom: 7px; min-width: 22px; padding: 2px 7px;
  border-radius: 999px; text-align: center; font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, #06b6d4 32%, transparent);
  border: 1px solid color-mix(in srgb, #06b6d4 60%, transparent);
}
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.cal-legend span { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
@media (max-width: 900px) {
  .cal-grid { gap: 4px; }
  .cal-day { min-height: 58px; padding: 6px; }
  .cal-day .who { display: none; }
}

/* ---------------- compact KPI strip ---------------- */
.kpis, .kpis-more {
  display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.kpis .card, .kpis-more .card { padding: 14px 15px 13px; }
.kpis .card-label, .kpis-more .card-label {
  font-size: 11px; letter-spacing: .03em; line-height: 1.3;
}
.kpis .card-value, .kpis-more .card-value {
  font-size: 22px; line-height: 1.25; letter-spacing: -.01em;
  word-break: break-word;
}
.kpis .card-sub, .kpis-more .card-sub { font-size: 10.5px; margin-top: 3px; line-height: 1.35; }
.kpis .card-go, .kpis-more .card-go { font-size: 10px; }
@media (max-width: 1500px) {
  .kpis, .kpis-more { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis .card-value, .kpis-more .card-value { font-size: 26px; }
}
@media (max-width: 760px) {
  .kpis, .kpis-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .card-value, .kpis-more .card-value { font-size: 22px; }
}
.more-toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); list-style: none; margin: 10px 0 2px;
}
.more-toggle::-webkit-details-marker { display: none; }
.more-toggle:hover { color: var(--text); border-color: var(--blue); }
details[open] > .more-toggle { color: var(--text); border-color: var(--blue); }

/* ---- "show part, click for the rest" (CSS-only, no JavaScript) ---- */
.exp-toggle { display: none; }
tr.exp-extra, .sector.exp-extra, .kind.exp-extra, .mrow.exp-extra,
li.fold-extra, .legend li.fold-extra, .hbars li.fold-extra { display: none; }
.panel:has(.exp-toggle:checked) tr.exp-extra { display: table-row; }
.panel:has(.exp-toggle:checked) .sector.exp-extra { display: grid; }
.panel:has(.exp-toggle:checked) .kind.exp-extra { display: grid; }
.panel:has(.exp-toggle:checked) .mrow.exp-extra { display: grid; }
.panel:has(.exp-toggle:checked) li.fold-extra,
.panel:has(.exp-toggle:checked) .legend li.fold-extra,
.panel:has(.exp-toggle:checked) .hbars li.fold-extra { display: grid; }
.when-open { display: none; }
.panel:has(.exp-toggle:checked) .when-open { display: inline; }
.panel:has(.exp-toggle:checked) .when-closed { display: none; }
.exp-toggle:checked ~ * .more-toggle,
.panel:has(.exp-toggle:checked) .more-toggle { color: var(--text); border-color: var(--blue); }
/* the folded part gets a soft fade so it reads as “more of the same” */
.panel:has(.exp-toggle:checked) .legend li.fold-extra,
.panel:has(.exp-toggle:checked) .hbars li.fold-extra { animation: foldIn .18s ease; }
@keyframes foldIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; } }

/* ---------------- finance: step-by-step calculation ---------------- */
.calc { display: grid; grid-template-columns: 1fr auto; gap: 0 14px; align-items: center; }
.calc > h3 {
  grid-column: 1 / -1; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  margin: 18px 0 4px;
}
.calc > h3:first-child { margin-top: 0; }
.calc > a, .calc > span.lbl {
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 13px; color: var(--text); text-decoration: none;
}
.calc > a:hover { color: #60a5fa; text-decoration: none; }
.calc > .amt {
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
  font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.calc > .tot { border-bottom: 0; border-top: 2px solid var(--line);
               padding-top: 12px; font-size: 15px; font-weight: 700; }

/* ---------------- finance: bars, sectors, monthly ---------------- */
.bar-duo { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--line-soft); }
.bar-duo i { display: block; height: 100%; }
.bar-track { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }

.sector {
  display: grid; grid-template-columns: 1.7fr .75fr .75fr .85fr;
  gap: 10px; align-items: center; padding: 11px 0;
  border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text);
}
.sector:last-of-type { border-bottom: 0; }
.sector:hover { background: var(--panel-2); text-decoration: none; }
.sector .nm { font-weight: 600; font-size: 13.5px; display: block; }
.sector .cd { font-size: 10.5px; color: var(--muted); }
.sector .amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.sector-hd {
  display: grid; grid-template-columns: 1.7fr .75fr .75fr .85fr; gap: 10px;
  font-size: 10.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.kind { display: grid; grid-template-columns: 1.5fr 2fr auto; gap: 10px; align-items: center;
        padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.kind:last-child { border-bottom: 0; }
.kind .lb { font-size: 12.5px; }
.kind .vl { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; }

.mrow { display: grid; grid-template-columns: 74px 1fr 110px; gap: 10px; align-items: center;
        padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
/* month rows carry three figures (in / out / net) — they need a wider last column */
.mrow.wide { grid-template-columns: 68px 1fr 252px; }
.mrow.wide .mv { white-space: nowrap; }
.mrow:last-child { border-bottom: 0; }
.mrow .ml { font-size: 12px; color: var(--muted); }
.mrow .mv { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }

.legend-in { color: #22c55e; }
.legend-out { color: #f43f5e; }

/* ---------------- the tracking sheet ---------------- */
.sheet-scroll { overflow-x: auto; margin: 0 -4px; }
table.sheet { width: 100%; border-collapse: collapse; font-size: 12px; }
table.sheet th, table.sheet td {
  padding: 8px 9px; border-bottom: 1px solid var(--line-soft);
  text-align: left; vertical-align: top;
}
table.sheet thead th {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: color-mix(in srgb, var(--panel-2, #131a2a) 92%, transparent);
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.sheet tbody tr:hover { background: color-mix(in srgb, var(--blue) 7%, transparent); }
table.sheet .nowrap { white-space: nowrap; }
table.sheet tfoot td {
  font-weight: 700; border-top: 2px solid var(--line);
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}
tr.row-pass td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
tr.row-fail td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.remark-cell { max-width: 190px; font-size: 11.5px; color: var(--muted); }

.res-form { display: flex; gap: 4px; }
.btn.xs { padding: 2px 8px; font-size: 11px; border-radius: 6px; line-height: 1.6; }
.btn.danger { border-color: color-mix(in srgb, #ef4444 55%, transparent);
              color: #fca5a5; }
.btn.danger:hover { background: color-mix(in srgb, #ef4444 22%, transparent); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* a form laid out as a labelled grid — used by the tracking sheet and case page */
.row-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 14px; align-items: end;
}
.row-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; color: var(--muted);
}
.row-form label.wide { grid-column: 1 / -1; }
.row-form input, .row-form select, .row-form textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--line); background: var(--bg-2);
  color: var(--ink);
}
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select {
  padding: 8px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
}
.alert.good {
  border-color: color-mix(in srgb, #22c55e 45%, transparent);
  background: color-mix(in srgb, #22c55e 14%, transparent);
  color: #86efac;
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

/* income / expense cards above the monthly graph */
.aybay { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.aybay-item {
  --c: #3b82f6;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
  background: color-mix(in srgb, var(--c) 11%, transparent);
}
.aybay-label { font-size: 11px; color: var(--muted); }
.aybay-value {
  font-size: 19px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.aybay-sub { font-size: 10.5px; color: var(--muted); }

/* the search box */
.search-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px; align-items: end;
}
.search-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; color: var(--muted);
}
.search-form input {
  width: 100%; padding: 9px 11px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
}
.search-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- the income / expense report block ---------------- */
.rep-filter {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent);
}
.rep-quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rep-filter label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10.5px; color: var(--muted);
}
.rep-filter select {
  padding: 7px 10px; border-radius: 8px; font-size: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
}
.rep-split {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px; margin-top: 16px;
}
.rep-col {
  --c: #3b82f6;
  padding: 13px 15px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  background: color-mix(in srgb, var(--c) 7%, transparent);
}
.rep-col h3, .rep-months h3 {
  margin: 0 0 10px; font-size: 12.5px; font-weight: 650; color: var(--ink);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.head-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 74px 104px 46px 34px;
  gap: 8px; align-items: center; padding: 7px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 12px;
}
.head-row:last-child { border-bottom: 0; }
.head-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.head-bar { height: 7px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.head-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 45%, #fff));
}
.head-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.head-pct, .head-n { text-align: right; color: var(--muted); font-size: 10.5px; }
.head-row.tot {
  margin-top: 5px; padding-top: 9px; border-top: 2px solid var(--line);
  border-bottom: 0; font-weight: 750;
}
.rep-months { margin-top: 18px; }
.rep-months .tot-row {
  border-top: 2px solid var(--line); margin-top: 4px; padding-top: 10px;
  font-weight: 750; color: var(--ink);
}
@media (max-width: 620px) {
  .head-row { grid-template-columns: minmax(0, 1fr) 92px 44px; }
  .head-row .head-bar, .head-row .head-n { display: none; }
}
/* ---------------- click-to-open section headers ---------------- */
details.fold > summary {
  cursor: pointer; list-style: none;
  transition: color .15s ease;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::marker { content: ""; }
details.fold > summary:hover h2 { color: var(--blue); }
details.fold .fold-hint {
  font-size: 10.5px; color: var(--muted); opacity: .75; white-space: nowrap;
}
details.fold[open] .fold-hint { display: none; }
details.fold .fold-chev {
  color: var(--muted); font-size: 13px; line-height: 1;
  transition: transform .2s ease, color .2s ease;
}
details.fold[open] .fold-chev { transform: rotate(180deg); color: var(--blue); }
details.fold > summary + * { animation: foldIn .18s ease; }
/* a folded panel should look like a tidy closed drawer */
details.fold:not([open]) { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
details.fold:not([open]) > summary { margin-bottom: 0; }

/* the data-entry panel sits at the top of a service page — make it unmissable */
.entry-panel {
  border: 1px solid color-mix(in srgb, var(--blue) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 9%, transparent);
}
.entry-panel .panel-head h2 { color: var(--ink); }

/* ---------------- the three service lines ---------------- */
/* a service page names only its own business — no switcher, no sibling cards */
.svc-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin: 0 0 16px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.svc-banner-dot {
  width: 10px; height: 10px; border-radius: 999px; background: var(--c);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent);
  flex: 0 0 auto;
}
.svc-banner-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.svc-banner-note { font-size: 11.5px; color: var(--muted); }
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: 1fr; } }
.svc-card {
  --c: #3b82f6;
  display: block; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .12s;
}
.svc-card:hover {
  text-decoration: none; transform: translateY(-2px);
  background: color-mix(in srgb, var(--c) 18%, transparent);
  border-color: color-mix(in srgb, var(--c) 65%, transparent);
}
.svc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.svc-name { font-size: 14px; font-weight: 700; }
.svc-n { font-size: 11px; color: var(--muted); }
.svc-profit {
  display: block; font-size: 24px; font-weight: 700; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.svc-lbl { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.svc-bar {
  display: block; height: 6px; border-radius: 999px; background: var(--line-soft);
  margin: 10px 0 8px; overflow: hidden;
}
.svc-bar i { display: block; height: 100%; background: var(--c); border-radius: 999px; }
.svc-rows {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--muted);
}
.svc-rows b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------------- print (বেতন শীট / হাজিরা) ---------------- */
@media print {
  body { background: #fff !important; color: #000 !important; }
  body::before { display: none !important; }
  .sidebar, .topbar .icon-btn, .topbar .pill, .toolbar, .btn,
  .more-toggle, form, .card-go { display: none !important; }
  .shell { display: block !important; }
  .main { padding: 0 !important; }
  .panel, .card, .stage-head {
    border-color: #bbb !important; box-shadow: none !important;
    background: #fff !important; color: #000 !important;
  }
  .card-value, .card-label, h1, h2, td, th, .lbl, .amt { color: #000 !important; }
  .tag { border-color: #888 !important; color: #000 !important; }
  .table-wrap { overflow: visible !important; }
  table { font-size: 11px; }
  a { color: #000 !important; text-decoration: none !important; }
}

/* ---------------- header bar ---------------- */
.topbar {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(112deg, rgba(160,196,255,.16) 0%, rgba(214,205,255,.10) 44%,
                    rgba(23,33,56,.55) 100%);
  box-shadow: var(--shadow);
}
.topbar::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(34,211,238,.13), transparent 70%);
  pointer-events: none;
}
.topbar-title { position: relative; display: flex; flex-direction: column; min-width: 0; }
.topbar h1 { font-size: 19px; letter-spacing: -.02em; line-height: 1.2; font-weight: 650; }
.topbar .sub {
  font-size: 9.5px; color: var(--muted); margin-top: 1px;
  text-transform: uppercase; letter-spacing: .11em; font-weight: 600;
}
.topbar .icon-btn { position: relative; flex: 0 0 auto; font-size: 0; padding: 5px 8px; }
.topbar .icon-btn svg { width: 16px; height: 16px; }
.topbar .pill { position: relative; font-size: 10px; padding: 4px 9px; }
.spacer { flex: 1; }
.pill {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
  color: var(--cyan); background: rgba(34,211,238,.12);
  border: 1px solid rgba(34,211,238,.28);
  padding: 5px 11px; border-radius: 999px;
}
.icon-btn {
  display: inline-block; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); border-radius: 10px; font-size: 17px; padding: 4px 11px;
  cursor: pointer; line-height: 1.3;
}
.icon-btn:hover { border-color: rgba(59,130,246,.55); color: #fff; }

/* ---------------- collapsible sidebar ---------------- */
.sidebar { transition: width .2s ease, flex-basis .2s ease, padding .2s ease; }

@media (min-width: 881px) {
  .nav-collapsed .sidebar {
    width: 74px; flex-basis: 74px; padding-left: 9px; padding-right: 9px;
  }
  .nav-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-collapsed .brand-name { display: none; }
  .nav-collapsed .nav-item {
    justify-content: center; padding-left: 0; padding-right: 0; gap: 0;
  }
  .nav-collapsed .nav-item .lbl { display: none; }
  .nav-collapsed .nav-item .ic { font-size: 16px; width: 100%; }
  .nav-collapsed .side-foot { flex-direction: column; gap: 9px; }
  .nav-collapsed .who { display: none; }
  .nav-collapsed .side-foot .btn { padding: 7px 9px; font-size: 11px; }
  .nav-collapsed .lbl-full { display: none; }
  .nav-collapsed .lbl-short { display: inline; }
}
.lbl-short { display: none; }

/* ---------------- KPI cards ---------------- */
.cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  margin-bottom: 18px;
}
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 62%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 10px; box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--blue));
}
.card > * { position: relative; }
.card-label {
  font-size: 11.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .07em; font-weight: 600;
}
.card-value {
  font-size: 30px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15;
  margin-top: 4px; color: #fff;
}
.card-value.hot { color: var(--rose); }
.card-sub { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.card-sub a { color: var(--cyan); }
.card .spark { display: block; width: 100%; height: 46px; margin-top: 8px; }

/* ---------------- panels ---------------- */
.panel {
  background: linear-gradient(170deg, var(--panel-2) 0%, var(--panel) 70%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.panel h2 { margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.muted-panel { background: rgba(15,23,41,.6); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }

.grid-2 {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

/* ---------------- donut + legend ---------------- */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 190px; height: 190px; flex: 0 0 190px; }
.donut-value { fill: #fff; font-size: 22px; font-weight: 750; }
.donut-label { fill: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 190px; }
.legend li {
  display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px;
  align-items: center; padding: 6px 0; font-size: 13.5px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.legend li:last-child { border-bottom: 0; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.legend .lbl { color: var(--ink-2); text-transform: capitalize; }
.legend .val { color: #fff; font-weight: 650; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--muted); font-size: 12px; min-width: 38px; text-align: right; }

/* ---------------- horizontal bars ---------------- */
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: 108px 1fr 116px; gap: 12px; align-items: center; }
.hb-label { font-size: 12.5px; color: var(--ink-2); text-transform: capitalize; }
.hb-track { height: 12px; background: #16203a; border-radius: 999px; overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.hb-value { text-align: right; font-size: 13px; color: #fff; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------- vertical bars ---------------- */
.vbars { display: flex; align-items: flex-end; gap: 4px; }
.vbar { flex: 1; border-radius: 4px 4px 2px 2px; opacity: .9; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; padding: 9px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
tbody tr:hover { background: rgba(59,130,246,.06); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 24px 10px; }

.tag {
  display: inline-block; font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: rgba(59,130,246,.14); color: #9cc3ff;
  border: 1px solid rgba(59,130,246,.24); text-transform: capitalize; white-space: nowrap;
}
.tag.ok { background: rgba(34,197,94,.14); color: #7ee2a8; border-color: rgba(34,197,94,.3); }
.tag.bad { background: rgba(244,63,94,.14); color: #ffa3b3; border-color: rgba(244,63,94,.3); }

.dot-ok, .dot-bad { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot-ok { background: var(--green); box-shadow: 0 0 10px rgba(34,197,94,.7); }
.dot-bad { background: var(--rose); box-shadow: 0 0 10px rgba(244,63,94,.7); }

/* ---------------- forms ---------------- */
input, select, button { font: inherit; color: inherit; }
input, select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: #0c1424; color: var(--ink); width: 100%; min-width: 0;
}
input::placeholder { color: #5c6b8c; }
input:focus, select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.22);
}

.row-form { display: flex; gap: 9px; }
.row-form input { max-width: 340px; }
.grid-form {
  display: grid; gap: 11px; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  align-items: center;
}
.grid-form button { grid-column: 1 / -1; justify-self: start; }
.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline input { max-width: 160px; }

.btn {
  display: inline-block; border: 1px solid var(--line); background: #16203a;
  color: var(--ink); padding: 10px 15px; border-radius: 11px; cursor: pointer;
  font-weight: 600; white-space: nowrap; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn.sm { padding: 7px 11px; font-size: 12.5px; }
.btn.full { width: 100%; }
.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-color: transparent; color: #04101f; font-weight: 700;
  box-shadow: 0 8px 22px rgba(59,130,246,.32);
}
.btn.ok { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.4); color: #7ee2a8; }
.btn.danger { background: rgba(244,63,94,.16); border-color: rgba(244,63,94,.4); color: #ffa3b3; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }

/* ---------------- alerts ---------------- */
.alert { padding: 12px 15px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; }
.alert.danger { background: rgba(244,63,94,.12); color: #ffb3bf; border: 1px solid rgba(244,63,94,.32); }
.alert.warn { background: rgba(245,158,11,.12); color: #ffd18a; border: 1px solid rgba(245,158,11,.32); }

/* ---------------- login ---------------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 22px; padding: 30px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 7px;
}
.login-card label { font-size: 12.5px; color: var(--muted); margin-top: 9px; }
.login-card .btn { margin-top: 18px; }
.login-card .muted { margin: 2px 0 6px; text-align: center; }

/* ---------------- sector trend cards ---------------- */
.trend-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}
.trend-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 70%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 8px; box-shadow: var(--shadow);
}
.trend-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--blue));
}
.trend-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trend-name {
  font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .07em; font-weight: 700;
}
.trend-delta {
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
}
.trend-delta.up   { color: #7ee2a8; background: rgba(34,197,94,.14); }
.trend-delta.down { color: #ffa3b3; background: rgba(244,63,94,.14); }
.trend-delta.flat { color: var(--muted); background: rgba(125,140,176,.14); }
.trend-delta.up::before, .trend-delta.down::before {
  content: ""; width: 0; height: 0; margin-right: 5px;
  border-left: 4.5px solid transparent; border-right: 4.5px solid transparent;
}
.trend-delta.up::before   { border-bottom: 6px solid currentColor; }
.trend-delta.down::before { border-top: 6px solid currentColor; }
.trend-value {
  display: block; font-size: 21px; font-weight: 750; letter-spacing: -.02em;
  margin-top: 5px; color: #fff;
}
.trend-card .spark { display: block; width: 100%; height: 40px; margin-top: 4px; }
.trend-foot { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------------- clickable cards / drill-down ---------------- */
a.card, a.trend-card { display: block; color: inherit; text-decoration: none; }
a.card:hover, a.trend-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
a.card, a.trend-card { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.card-go {
  display: block; margin-top: 7px; font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--cyan);
}
a.card:hover .card-go, a.trend-card:hover .card-go { color: #fff; }
.panel-head .go { font-size: 12.5px; font-weight: 600; }
.hbar.hot .hb-label { color: #fff; font-weight: 700; }
.hbar.hot .hb-track { box-shadow: 0 0 0 2px rgba(59,130,246,.55); }
.focus-note {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: #9cc3ff; background: rgba(59,130,246,.12);
  border: 1px solid rgba(59,130,246,.3);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 12px;
}

/* ---------------- responsive ---------------- */
@media (max-width: 880px) {
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 24px 70px rgba(0,0,0,.6);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .main { padding: 15px 14px 44px; }
  .hbar { grid-template-columns: 92px 1fr 92px; }
  .card-value { font-size: 26px; }
  .donut { width: 160px; height: 160px; flex-basis: 160px; }
}
