/* ============================================================================
 * MBT BUSINESS KPI COMMAND CENTER  -  Design System
 * "Mission control" aesthetic: deep-ink command center, teal accent + gold hero.
 * Fonts: IBM Plex Sans (UI), IBM Plex Mono (data/codes), Plex Sans Devanagari.
 * ========================================================================== */

/* -------------------------------------------------- THEME TOKENS */
:root {
  /* brand */
  --brand: #12b5a5;
  --brand-2: #0d8f83;
  --gold: #e9b949;
  --gold-2: #d99e2b;

  /* status */
  --ok: #2fbf71;
  --watch: #f0a202;
  --bad: #e5484d;
  --info: #4c82f7;

  /* dark (default) surfaces */
  --bg: #0b0f14;
  --bg-grid: rgba(255, 255, 255, 0.02);
  --surface: #121821;
  --surface-2: #171f2b;
  --surface-3: #1d2735;
  --line: #263243;
  --line-soft: #1c2634;
  --text: #e7edf5;
  --text-dim: #9fb0c3;
  --text-mute: #6b7c92;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);

  --font: 'IBM Plex Sans', 'IBM Plex Sans Devanagari', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;

  --sidebar-w: 246px;
  --topbar-h: 62px;
}

:root[data-theme='light'] {
  --bg: #eef1f6;
  --bg-grid: rgba(0, 0, 0, 0.025);
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef2f7;
  --line: #dde3ec;
  --line-soft: #e7ecf3;
  --text: #14202f;
  --text-dim: #46586d;
  --text-mute: #7a8aa0;
  --shadow: 0 10px 30px rgba(20, 32, 47, 0.1);
  --shadow-sm: 0 2px 8px rgba(20, 32, 47, 0.06);
}

/* -------------------------------------------------- RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(18, 181, 165, 0.08), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(233, 185, 73, 0.05), transparent 55%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--brand); color: #04120f; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; }

/* -------------------------------------------------- LAYOUT */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--surface), var(--surface) 60%, var(--surface-2));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px; border-bottom: 1px solid var(--line-soft);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: conic-gradient(from 210deg, var(--brand), var(--gold), var(--brand));
  display: grid; place-items: center; color: #05130f; font-weight: 700;
  font-family: var(--mono); font-size: 15px; letter-spacing: -1px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 6px 18px rgba(18,181,165,0.35);
}
.brand-txt b { display: block; font-size: 13px; letter-spacing: 0.3px; line-height: 1.15; }
.brand-txt span { font-size: 10.5px; color: var(--text-mute); letter-spacing: 0.4px; }

.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-mute); padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border-radius: 10px; color: var(--text-dim);
  font-size: 13px; font-weight: 500; border: 1px solid transparent;
  background: transparent; text-align: left; transition: all 0.15s;
}
.nav-item .ico { width: 20px; display: inline-flex; align-items: center; justify-content: center; opacity: 0.85; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
.ec-icon { color: var(--brand); }
.bn-title .ic { color: var(--bad); vertical-align: -3px; }
.bottleneck.supporting .bn-title .ic { color: var(--watch); }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(18,181,165,0.16), rgba(18,181,165,0.04));
  color: var(--text); border-color: rgba(18,181,165,0.3);
}
.nav-item.active .ico { color: var(--brand); opacity: 1; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-soft); }
.userchip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.userchip .avatar {
  width: 34px; height: 34px; border-radius: 9px; flex: none; object-fit: cover;
  background: var(--surface-3); display: grid; place-items: center;
  font-weight: 700; color: var(--brand); font-family: var(--mono);
}
.userchip .meta { min-width: 0; flex: 1; }
.userchip .meta b { font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip .meta span { font-size: 10.5px; color: var(--text-mute); }

/* -------------------------------------------------- TOPBAR */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; height: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.topbar .sub { font-size: 11.5px; color: var(--text-mute); }
.topbar-spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-dim);
  font-size: 16px; transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--brand); }
.hamburger { display: none; }

.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-mute); }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47,191,113,0.18); }
.status-dot.offline i { background: var(--bad); box-shadow: 0 0 0 3px rgba(229,72,77,0.18); }

.content { padding: 20px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* -------------------------------------------------- FILTER BAR */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 18px;
}
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: none; background: transparent; color: var(--text-dim);
  padding: 6px 11px; border-radius: 7px; font-size: 12px; font-weight: 500;
}
.seg button.active { background: var(--brand); color: #04120f; font-weight: 600; }
.filterbar input[type='date'], .filterbar select {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 7px 10px; font-size: 12.5px; font-family: inherit;
}
.filterbar .pill-label { font-size: 11px; color: var(--text-mute); letter-spacing: 0.4px; }

/* -------------------------------------------------- SECTIONS */
.section { margin-bottom: 26px; animation: rise 0.5s both; }
.section:nth-child(1) { animation-delay: 0.02s; }
.section:nth-child(2) { animation-delay: 0.06s; }
.section:nth-child(3) { animation-delay: 0.10s; }
.section:nth-child(4) { animation-delay: 0.14s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 14px; font-weight: 600; letter-spacing: 0.2px; }
.section-head .hint { font-size: 11.5px; color: var(--text-mute); }
.section-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* -------------------------------------------------- CARDS + GRID */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
}
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

/* KPI card */
.kpi { position: relative; overflow: hidden; }
.kpi::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--brand); opacity: 0.9;
}
.kpi.st-on_track::after { background: var(--ok); }
.kpi.st-watch::after { background: var(--watch); }
.kpi.st-behind::after { background: var(--bad); }
.kpi .k-label { font-size: 11.5px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-family: var(--mono); font-size: 25px; font-weight: 600; letter-spacing: -0.5px; margin: 6px 0 2px; }
.kpi .k-sub { font-size: 11px; color: var(--text-mute); font-family: var(--mono); }
.kpi .k-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; font-size: 11px; }
.kpi .k-target { color: var(--text-mute); font-family: var(--mono); }

/* -------------------------------------------------- BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; letter-spacing: 0.3px; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on_track, .badge.healthy, .badge.submitted, .badge.verified, .badge.processed, .badge.paid, .badge.fully_paid, .badge.active { color: var(--ok); background: rgba(47,191,113,0.12); border-color: rgba(47,191,113,0.28); }
.badge.watch, .badge.needs-attention, .badge.pending, .badge.partially_paid, .badge.approved, .badge.requested { color: var(--watch); background: rgba(240,162,2,0.12); border-color: rgba(240,162,2,0.28); }
.badge.behind, .badge.critical, .badge.at-risk, .badge.overdue, .badge.failed, .badge.rejected, .badge.cancelled, .badge.refunded { color: var(--bad); background: rgba(229,72,77,0.12); border-color: rgba(229,72,77,0.28); }
.badge.no-data, .badge.info, .badge.neutral { color: var(--text-mute); background: var(--surface-3); border-color: var(--line); }
.badge.priority-critical { color: var(--bad); background: rgba(229,72,77,0.14); }
.badge.priority-high { color: var(--watch); background: rgba(240,162,2,0.14); }
.badge.priority-medium { color: var(--info); background: rgba(76,130,247,0.14); }

/* -------------------------------------------------- PROGRESS */
.bar { height: 8px; border-radius: 20px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width 0.8s cubic-bezier(.2,.8,.2,1); }
.bar.gold > i { background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.bar.ok > i { background: linear-gradient(90deg, #24a862, var(--ok)); }
.bar.bad > i { background: linear-gradient(90deg, #c53236, var(--bad)); }
.bar .marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: 0.5; }
.progress-row { margin: 10px 0; }
.progress-row .pr-top { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 5px; }
.progress-row .pr-top b { font-family: var(--mono); }

/* -------------------------------------------------- HEALTH SCORE */
.health {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center;
}
.gauge { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); }
.gauge .g-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .g-score { font-family: var(--mono); font-size: 46px; font-weight: 600; line-height: 1; }
.gauge .g-label { font-size: 12px; margin-top: 4px; letter-spacing: 0.5px; }
.health-break { display: grid; gap: 7px; }
.hb-row { display: grid; grid-template-columns: 150px 1fr 46px; gap: 10px; align-items: center; font-size: 11.5px; }
.hb-row .hb-name { color: var(--text-dim); }
.hb-row .hb-val { font-family: var(--mono); text-align: right; color: var(--text-mute); }

/* -------------------------------------------------- HERO */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.hero-main { background:
    radial-gradient(600px 300px at 100% 0%, rgba(233,185,73,0.10), transparent 60%),
    var(--surface); }
.hero-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; margin: 4px 0 14px; }
.fig .f-l { font-size: 10.5px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.6px; }
.fig .f-v { font-family: var(--mono); font-size: 19px; font-weight: 600; margin-top: 2px; }
.fig .f-v.pos { color: var(--ok); } .fig .f-v.neg { color: var(--bad); }
.hero-summary { display: grid; gap: 8px; }
.summary-line { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-dim); padding: 9px 11px; background: var(--surface-2); border-radius: 10px; border-left: 3px solid var(--brand); }

/* -------------------------------------------------- FUNNEL */
.funnel { display: grid; gap: 8px; }
.funnel-stage { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.funnel-stage .fs-label { font-size: 12px; color: var(--text-dim); }
.funnel-stage .fs-label b { display: block; font-family: var(--mono); color: var(--text); font-size: 15px; }
.funnel-bar { height: 34px; border-radius: 9px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); display: flex; align-items: center; padding: 0 12px; color: #04120f; font-family: var(--mono); font-weight: 600; font-size: 12px; min-width: 40px; transition: width 0.8s; }
.funnel-conv { font-size: 10.5px; color: var(--text-mute); font-family: var(--mono); }
.funnel-arrow { text-align: center; color: var(--text-mute); font-size: 11px; padding-left: 142px; }

/* -------------------------------------------------- DEPT + BOTTLENECK + ACTION CARDS */
.dept-card { display: flex; flex-direction: column; gap: 8px; }
.dept-card .dc-top { display: flex; justify-content: space-between; align-items: center; }
.dept-card .dc-name { font-weight: 600; font-size: 13px; }
.dept-card .dc-score { font-family: var(--mono); font-size: 22px; font-weight: 600; }

.bottleneck { border-left: 4px solid var(--bad); }
.bottleneck.supporting { border-left-color: var(--watch); }
.bottleneck .bn-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.bn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.bn-metric { background: var(--surface-2); border-radius: 9px; padding: 8px 10px; }
.bn-metric .m-l { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; }
.bn-metric .m-v { font-family: var(--mono); font-size: 15px; font-weight: 600; margin-top: 2px; }
.bn-action { font-size: 12.5px; color: var(--text-dim); background: var(--surface-2); padding: 10px 12px; border-radius: 9px; }

.action-card { position: relative; padding-left: 18px; }
.action-card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--gold); }
.action-card .ac-num { font-family: var(--mono); color: var(--gold); font-size: 12px; font-weight: 700; }
.action-card .ac-title { font-size: 14px; font-weight: 600; margin: 2px 0 6px; }
.action-card .ac-do { font-size: 13px; margin-bottom: 8px; }
.action-card .ac-why { font-size: 11.5px; color: var(--text-mute); }
.action-card .ac-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11px; color: var(--text-dim); }
.action-card .ac-meta b { font-family: var(--mono); color: var(--text); }

/* -------------------------------------------------- TABLES */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
table.data th {
  text-align: left; padding: 10px 12px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-mute); background: var(--surface-2);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; cursor: pointer; white-space: nowrap;
}
table.data th:hover { color: var(--text); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); }
.table-toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 12px; }
.table-toolbar input, .table-toolbar select {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 11px; font-size: 12.5px; font-family: inherit;
}
.table-toolbar .grow { flex: 1; min-width: 160px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--text-mute); }

/* -------------------------------------------------- BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 12.5px; font-weight: 600; transition: all 0.15s;
}
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #04120f; }
.btn-primary:hover { background: var(--brand-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1c1400; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 11.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* -------------------------------------------------- FORMS */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11.5px; color: var(--text-dim); font-weight: 500; }
.field label .req { color: var(--bad); }
.field input, .field select, .field textarea {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 13px; font-family: inherit; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18,181,165,0.15);
}
.field .err { font-size: 10.5px; color: var(--bad); }
.field.invalid input, .field.invalid select { border-color: var(--bad); }
.form-note { font-size: 11px; color: var(--text-mute); }

/* -------------------------------------------------- ENTRY CARDS */
.entry-card { display: flex; flex-direction: column; gap: 9px; }
.entry-card .ec-top { display: flex; justify-content: space-between; align-items: flex-start; }
.entry-card .ec-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; font-size: 19px; }
.entry-card .ec-name { font-weight: 600; font-size: 13.5px; }
.entry-card .ec-meta { font-size: 11px; color: var(--text-mute); }

/* -------------------------------------------------- MODAL */
body.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; inset: 0; background: rgba(4,8,12,0.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 560px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); animation: pop 0.22s cubic-bezier(.2,.9,.3,1.2); }
.modal-wide { width: 920px; }
@keyframes pop { from { transform: translateY(14px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-x { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--surface-2); color: var(--text-dim); font-size: 20px; line-height: 1; }
.modal-x:hover { color: var(--text); background: var(--surface-3); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.confirm-text { font-size: 13.5px; color: var(--text-dim); }

/* -------------------------------------------------- TOAST */
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; animation: slidein 0.25s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.out { animation: fadeout 0.3s forwards; }
@keyframes fadeout { to { opacity: 0; transform: translateX(30px); } }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.toast-success .toast-icon { background: rgba(47,191,113,0.18); color: var(--ok); }
.toast-error .toast-icon { background: rgba(229,72,77,0.18); color: var(--bad); }
.toast-warning .toast-icon { background: rgba(240,162,2,0.18); color: var(--watch); }
.toast-info .toast-icon, .toast-realtime .toast-icon { background: rgba(76,130,247,0.18); color: var(--info); }
.toast-msg { flex: 1; color: var(--text); }
.toast-close { background: none; border: none; color: var(--text-mute); font-size: 17px; line-height: 1; }

/* -------------------------------------------------- SKELETON / EMPTY */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-line { height: 12px; margin: 8px 0; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-mute); }
.empty .em-ico { font-size: 34px; opacity: 0.5; }
.empty p { margin-top: 8px; font-size: 13px; }

/* -------------------------------------------------- CHARTS */
.chart-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-box { position: relative; height: 300px; }
.chart-box canvas { max-height: 300px; }

/* -------------------------------------------------- MISC */
.mono { font-family: var(--mono); }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.pos { color: var(--ok); } .neg { color: var(--bad); } .warn { color: var(--watch); }
.right { text-align: right; } .center { text-align: center; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.tag { font-size: 10px; font-family: var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-dim); }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }

/* -------------------------------------------------- KAXON CREDIT */
.kaxon-credit {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: 10px; padding: 9px 8px; border-radius: 11px; text-align: center;
  border: 1px solid transparent; transition: all 0.2s; text-decoration: none;
}
.kaxon-credit span { font-size: 8.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-mute); }
.kaxon-credit b {
  font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: 3px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--brand));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: kaxonShine 4.5s linear infinite;
}
.kaxon-credit b i {
  display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold); margin-left: 5px; vertical-align: middle;
  -webkit-text-fill-color: var(--gold); box-shadow: 0 0 6px var(--gold);
}
@keyframes kaxonShine { to { background-position: 200% center; } }
.kaxon-credit:hover { border-color: var(--line); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.login-kaxon { align-items: flex-start; margin-top: 14px; padding-left: 0; }
.login-kaxon span { text-align: left; }
.login-kaxon b { letter-spacing: 4px; }

/* -------------------------------------------------- MOBILE BOTTOM NAV */
.bottomnav { display: none; }

/* -------------------------------------------------- RESPONSIVE */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g6 { grid-template-columns: repeat(3, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .health { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%);
    transition: transform 0.25s; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 39; }
  .hamburger { display: grid; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .content { padding: 14px 14px 90px; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px;
    justify-content: space-around;
  }
  .bottomnav button { background: none; border: none; color: var(--text-mute); font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 8px; }
  .bottomnav button.active { color: var(--brand); }
  .bottomnav button .ico { font-size: 18px; }
}
@media (max-width: 560px) {
  .g4, .g6, .gauto { grid-template-columns: 1fr 1fr; }
  .hero-figures { grid-template-columns: repeat(2, 1fr); }
  .funnel-stage { grid-template-columns: 92px 1fr; }
  .funnel-arrow { padding-left: 100px; }
  .kpi .k-value { font-size: 21px; }
  .modal { border-radius: 14px 14px 0 0; align-self: flex-end; }
  .modal-overlay { place-items: end center; padding: 0; }
}
@media (max-width: 380px) {
  .g4, .g6, .gauto { grid-template-columns: 1fr; }
}
