/* ════════════════════════════════════════════
   RAKAMIN WIP — style.css
   DashStack-inspired layout, fully responsive
   ════════════════════════════════════════════ */

:root {
  /* Brand */
  --brand-teal: #00B3AB;
  --brand-yellow: #F5A623;

  /* Blues */
  --blue:    #4361EE;
  --blue-lt: #EEF2FF;
  --blue-dk: #3451D1;

  /* Semantic */
  --green:    #00B894;
  --green-lt: #E8FDF9;
  --amber:    #E17055;
  --amber-lt: #FFF3EE;
  --red:      #D63031;
  --red-lt:   #FFF0F0;
  --purple:   #6C5CE7;
  --purple-lt:#F3F1FF;

  /* Neutrals */
  --white:   #FFFFFF;
  --bg:      #F6F7FB;
  --bg-card: #FFFFFF;
  --border:  #E9ECF2;
  --s50:     #F8FAFC;
  --s100:    #F1F5F9;
  --s200:    #E2E8F0;
  --s300:    #CBD5E1;
  --s400:    #94A3B8;
  --s500:    #64748B;
  --s600:    #475569;
  --s700:    #334155;
  --s800:    #1E293B;
  --s900:    #0F172A;

  /* Sidebar */
  --sb-bg:      #FFFFFF;
  --sb-width:   240px;
  --sb-border:  #E9ECF2;

  /* Topbar */
  --tb-height: 64px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  /* Shadow */
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--s800); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }

a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; }
input, select { font-family: var(--font); }

/* ── LAYOUT ─────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-width);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  overflow-x: hidden;
}

.main-wrap {
  margin-left: var(--sb-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s;
}

/* ── SIDEBAR LOGO ────────────────────────────────── */
.sb-logo-wrap {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-logo {
  height: 36px;
  width: auto;
  display: block;
}

/* ── SIDEBAR NAV ─────────────────────────────────── */
.sb-nav {
  padding: 16px 12px;
  flex: 1;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--s400);
  letter-spacing: .08em;
  padding: 0 10px;
  margin-bottom: 6px;
  margin-top: 20px;
}
.nav-section-label:first-child { margin-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--s500);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg); color: var(--s800); }
.nav-item.active {
  background: var(--blue-lt);
  color: var(--blue);
  font-weight: 600;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

/* ── TOPBAR ──────────────────────────────────────── */
.topbar {
  height: var(--tb-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--s500);
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.hamburger:hover { background: var(--bg); }
.hamburger svg { width: 20px; height: 20px; }

.search-wrap {
  position: relative;
  max-width: 320px;
  width: 100%;
}
.search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--s400);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--s700);
  background: var(--bg);
  outline: none;
  transition: border .15s;
}
.search-wrap input:focus { border-color: var(--blue); background: white; }
.search-wrap input::placeholder { color: var(--s400); }

/* Dataset Toggle */
.ds-toggle-wrap {
  display: flex;
  background: var(--bg);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}
.ds-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--s500);
  transition: all .15s;
  white-space: nowrap;
}
.ds-pill.active {
  background: white;
  box-shadow: var(--shadow-sm);
  color: var(--s800);
}
.ds-pill.messy.active { color: var(--amber); }
.ds-pill.clean.active { color: var(--green); }

/* Topbar icon button */
.tb-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--s500);
  cursor: pointer;
  transition: background .14s;
}
.tb-icon-btn svg { width: 20px; height: 20px; }
.tb-icon-btn:hover { background: var(--bg); }
.notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 20px;
  min-width: 16px;
  text-align: center;
  border: 1.5px solid white;
}
.tb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background .14s;
}
.tb-user:hover { background: var(--bg); }
.tb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tb-user-info {
  display: flex;
  flex-direction: column;
}
.tb-user-name { font-size: 13px; font-weight: 600; color: var(--s800); line-height: 1.2; }
.tb-user-role { font-size: 11px; color: var(--s400); }

/* ── CONTENT ─────────────────────────────────────── */
.content { padding: 24px; flex: 1; }

/* ── PAGE HEADER ─────────────────────────────────── */
.page-hd {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-hd h1 { font-size: 22px; font-weight: 700; color: var(--s900); }
.page-hd p  { font-size: 13px; color: var(--s500); margin-top: 3px; }

/* ── KPI CARDS (DashStack style) ─────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.kpi-card-body { flex: 1; }
.kpi-label { font-size: 12px; color: var(--s500); font-weight: 500; margin-bottom: 6px; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--s900); line-height: 1; margin-bottom: 8px; }
.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}
.kpi-trend.up   { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend.neu  { color: var(--s400); }
.kpi-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon-wrap svg { width: 26px; height: 26px; }
.kpi-icon-wrap.blue   { background: #EEF2FF; color: var(--blue); }
.kpi-icon-wrap.green  { background: #E8FDF9; color: var(--green); }
.kpi-icon-wrap.amber  { background: #FFF3EE; color: var(--amber); }
.kpi-icon-wrap.purple { background: #F3F1FF; color: var(--purple); }
.kpi-icon-wrap.red    { background: var(--red-lt); color: var(--red); }

/* ── CARD ────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--s50);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--s800); }
.card-subtitle { font-size: 12px; color: var(--s400); margin-top: 2px; }
.card-action { font-size: 12px; color: var(--blue); font-weight: 500; cursor: pointer; }
.card-action:hover { text-decoration: underline; }
.card-body { padding: 20px; }
.card-body.np { padding: 0; }

/* Grid */
.g2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.g3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.gw  { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.gwl { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; margin-bottom: 24px; }

/* ── TABLE ───────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--s500);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--s50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--s50);
  color: var(--s700);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover td { background: var(--bg); }
.mono { font-family: var(--mono); font-size: 11.5px; color: var(--s400); }

/* ── BADGES ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}
.b-high   { background: var(--green-lt); color: var(--green); }
.b-med    { background: var(--amber-lt); color: var(--amber); }
.b-low    { background: var(--red-lt);   color: var(--red); }
.b-neu    { background: var(--s100);     color: var(--s500); }
.b-blue   { background: var(--blue-lt);  color: var(--blue); }
.b-flag   { background: var(--red-lt);   color: var(--red); }
.b-purple { background: var(--purple-lt); color: var(--purple); }

/* Status pill (like DashStack delivered badge) */
.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}
.sp-green  { background: var(--green-lt);  color: var(--green); }
.sp-amber  { background: var(--amber-lt);  color: var(--amber); }
.sp-red    { background: var(--red-lt);    color: var(--red); }
.sp-blue   { background: var(--blue-lt);   color: var(--blue); }

/* ── BARS ────────────────────────────────────────── */
.cbar-wrap {
  display: flex; align-items: center; gap: 8px;
}
.cbar-track {
  flex: 1; height: 6px;
  background: var(--s100);
  border-radius: 3px;
  overflow: hidden;
}
.cbar-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.cbar-fill.high   { background: var(--green); }
.cbar-fill.medium { background: var(--amber); }
.cbar-fill.low    { background: var(--red); }
.cbar-pct { font-size: 11px; font-family: var(--mono); color: var(--s500); width: 30px; text-align: right; }

.gbar-wrap { display: flex; align-items: center; gap: 8px; }
.gbar-track { flex: 1; height: 7px; background: var(--s100); border-radius: 4px; overflow: hidden; }
.gbar-fill { height: 100%; border-radius: 4px; }
.gbar-fill.g-lo { background: var(--green); }
.gbar-fill.g-me { background: var(--amber); }
.gbar-fill.g-hi { background: var(--red); }
.gscore { font-size: 11.5px; font-family: var(--mono); font-weight: 600; color: var(--s700); width: 24px; text-align: right; }

/* ── SKILL CHIPS ─────────────────────────────────── */
.chip     { display: inline-block; padding: 2px 8px; background: var(--blue-lt); color: var(--blue); border-radius: 5px; font-size: 11px; font-weight: 500; margin: 1px 2px 1px 0; }
.chip.inf { background: #FFF7ED; color: #C2410C; border: 1px dashed #FED7AA; }
.chip.mis { background: var(--red-lt); color: var(--red); }
.chip.ok  { background: var(--green-lt); color: var(--green); }
.inf-tag  { font-size: 9px; font-weight: 700; padding: 1px 5px; background: #FFF7ED; color: #C2410C; border-radius: 3px; border: 1px dashed #FED7AA; vertical-align: middle; margin-left: 3px; }

/* ── ALERT BANNERS ───────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
  border-left: 3px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert.warn { background: var(--amber-lt); border-color: var(--amber); }
.alert.info { background: var(--blue-lt);  border-color: var(--blue); }
.alert.ok   { background: var(--green-lt); border-color: var(--green); }
.alert-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-txt  { font-size: 13px; color: var(--s700); line-height: 1.5; }
.alert-txt strong { font-weight: 600; }

/* ── QUALITY BARS ────────────────────────────────── */
.qbar { margin-bottom: 14px; }
.qbar-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.qbar-row span:first-child { font-size: 12.5px; color: var(--s600); }
.qbar-row span:last-child  { font-size: 12px; font-family: var(--mono); font-weight: 600; color: var(--s800); }
.qbar-track { height: 6px; background: var(--s100); border-radius: 3px; overflow: hidden; }
.qbar-fill  { height: 100%; border-radius: 3px; transition: width .5s; }

/* ── TOOLBAR ─────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.search-field .s-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--s400);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  background: white;
  color: var(--s800);
  outline: none;
}
.search-field input:focus { border-color: var(--blue); }
.fsel {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  background: white;
  color: var(--s700);
  outline: none;
  cursor: pointer;
}
.fsel:focus { border-color: var(--blue); }
.rcount { font-size: 12px; color: var(--s400); margin-left: auto; white-space: nowrap; }

/* ── PAGINATION ──────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  justify-content: center;
  flex-wrap: wrap;
}
.pg-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: white;
  color: var(--s600);
}
.pg-btn:hover { background: var(--bg); }
.pg-btn.active { background: var(--blue); color: white; border-color: var(--blue); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-info { font-size: 12px; color: var(--s400); margin-left: 8px; }

/* ── STAT ROW ────────────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--s50);
}
.stat-row:last-child { border-bottom: none; }
.stat-lbl { font-size: 12.5px; color: var(--s500); }
.stat-val { font-size: 13px; font-weight: 600; color: var(--s800); }

/* ── DETAIL OVERLAY ──────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay.open { display: flex; }
.detail-panel {
  background: white;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dp-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}
.dp-body { overflow-y: auto; padding: 20px 24px; flex: 1; }
.dp-name { font-size: 18px; font-weight: 700; color: var(--s900); }
.dp-sub  { font-size: 13px; color: var(--s500); margin-top: 3px; }
.dp-badges { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.close-btn {
  width: 30px; height: 30px;
  border: none;
  background: var(--s100);
  border-radius: 6px;
  font-size: 16px;
  color: var(--s500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.close-btn:hover { background: var(--s200); }

.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.det-field label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--s400); font-weight: 600; }
.det-field p { font-size: 13px; color: var(--s800); margin-top: 3px; font-weight: 500; }
.sec-title { font-size: 11px; font-weight: 700; color: var(--s600); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; margin-top: 18px; }
.sec-title:first-child { margin-top: 0; }

.score-2up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.score-box {
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 14px;
}
.score-box-lbl { font-size: 10px; color: var(--s400); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; font-weight: 600; }
.score-big { font-size: 30px; font-weight: 700; font-family: var(--mono); color: var(--s900); line-height: 1; }

/* ── ACTION BUTTONS ──────────────────────────────── */
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .14s;
}
.act-primary { background: var(--blue); color: white; }
.act-primary:hover { background: var(--blue-dk); }
.act-secondary { background: var(--s100); color: var(--s700); }
.act-secondary:hover { background: var(--s200); }
.act-danger { background: var(--red-lt); color: var(--red); }
.act-btn:disabled { opacity: .4; cursor: not-allowed; }
.act-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── REVIEW ITEMS ────────────────────────────────── */
.rev-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--s50);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background .12s;
}
.rev-item:hover { background: var(--bg); }
.rev-item:last-child { border-bottom: none; }
.rev-av {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.rev-meta { flex: 1; min-width: 0; }
.rev-name { font-size: 13.5px; font-weight: 600; color: var(--s800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rev-detail { font-size: 12px; color: var(--s400); margin-top: 2px; }
.rev-flags { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── CHART WRAP ──────────────────────────────────── */
.chart-wrap { position: relative; width: 100%; }

/* ── TOAST ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--s900);
  color: white;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: all .2s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; color: var(--s400); }
.empty .eico { font-size: 32px; margin-bottom: 12px; }
.empty p { font-size: 13px; line-height: 1.6; }

/* ── DIVIDER ─────────────────────────────────────── */
.hdivider { height: 1px; background: var(--s100); margin: 14px 0; }

/* ── LEGEND DOT ──────────────────────────────────── */
.ldot {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
.legend-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--s500); }

/* ── SIDEBAR OVERLAY (mobile) ────────────────────── */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 199;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

/* Large → Medium (1200px) */
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .gw  { grid-template-columns: 1fr; }
  .gwl { grid-template-columns: 1fr; }
}

/* Medium (900px) */
@media (max-width: 900px) {
  :root { --sb-width: 240px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sb-overlay.open { display: block; }

  .main-wrap { margin-left: 0; }

  .hamburger { display: flex; }

  .topbar { padding: 0 16px; }
  .search-wrap { max-width: 200px; }

  .tb-user-info { display: none; }
  .tb-user svg  { display: none; }

  .content { padding: 16px; }

  .g2, .g3 { grid-template-columns: 1fr; }
  .gw, .gwl { grid-template-columns: 1fr; }

  .score-2up { grid-template-columns: 1fr 1fr; }
  .det-grid  { grid-template-columns: 1fr 1fr; }
}

/* Small (640px) */
@media (max-width: 640px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-icon-wrap { width: 42px; height: 42px; }
  .kpi-icon-wrap svg { width: 20px; height: 20px; }

  .ds-toggle-wrap { display: none; }

  .topbar-right { gap: 8px; }

  .search-wrap { max-width: 140px; }
  .search-wrap input { font-size: 12px; padding: 7px 10px 7px 30px; }

  .content { padding: 12px; }

  .page-hd h1 { font-size: 18px; }

  .detail-panel { max-height: 95vh; }
  .dp-header { padding: 16px; }
  .dp-body { padding: 16px; }
  .det-grid { grid-template-columns: 1fr; }
  .score-2up { grid-template-columns: 1fr; }

  .act-btn { padding: 8px 14px; font-size: 12px; }
  .act-row { gap: 8px; }

  .tbl th, .tbl td { padding: 10px 12px; }

  .g2, .g3 { gap: 12px; }
  .card-body { padding: 14px; }

  .toast { left: 12px; right: 12px; bottom: 16px; }
}

/* Extra small (400px) */
@media (max-width: 400px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 12px; }
  .kpi-icon-wrap { display: none; }
  .kpi-value { font-size: 20px; }
}

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--s200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--s300); }
