/* Kubbaan Admin — Dashboard Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Lao:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --kb-orange: #FF8900;
  --kb-orange-2: #FFA033;
  --kb-orange-soft: #FFF3E2;
  --kb-orange-soft-2: #FFE4C2;
  --kb-navy: #0A2540;
  --kb-navy-2: #13345B;
  --kb-navy-3: #1C4675;

  /* light */
  --bg: #F6F7F9;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --border: #E7EAF0;
  --border-2: #EEF1F5;
  --text: #0A2540;
  --text-2: #4B5A70;
  --text-3: #8894A8;
  --shadow-sm: 0 1px 2px rgba(10,37,64,0.04), 0 1px 1px rgba(10,37,64,0.03);
  --shadow-md: 0 4px 12px rgba(10,37,64,0.06), 0 1px 3px rgba(10,37,64,0.04);
  --shadow-lg: 0 12px 28px rgba(10,37,64,0.08), 0 4px 8px rgba(10,37,64,0.04);

  --green: #10B981;
  --green-soft: #D1FAE5;
  --red: #EF4444;
  --red-soft: #FEE2E2;
  --yellow: #F59E0B;
  --yellow-soft: #FEF3C7;
  --blue: #3B82F6;
  --blue-soft: #DBEAFE;
  --violet: #8B5CF6;
  --violet-soft: #EDE9FE;
  --teal: #14B8A6;
  --teal-soft: #CCFBF1;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sidebar-w: 248px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #0A1626;
  --bg-2: #0E1B2E;
  --surface: #122339;
  --surface-2: #0E1B2E;
  --border: #1F3656;
  --border-2: #182B47;
  --text: #F0F4FA;
  --text-2: #A6B5CB;
  --text-3: #6F809A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.5);
}

[data-density="compact"] {
  --row-h: 40px;
  --pad-cell: 10px 12px;
  --gap: 14px;
  --card-pad: 16px;
}
[data-density="comfortable"], :root {
  --row-h: 52px;
  --pad-cell: 14px 16px;
  --gap: 18px;
  --card-pad: 20px;
}
[data-density="spacious"] {
  --row-h: 64px;
  --pad-cell: 18px 20px;
  --gap: 24px;
  --card-pad: 28px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans Lao', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.lao { font-family: 'Noto Sans Lao', 'Inter', sans-serif; }
.mono { font-family: 'JetBrains Mono', monospace; }

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

.mi {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.mi.fill { font-variation-settings: 'FILL' 1, 'wght' 500; }
.mi.bold { font-variation-settings: 'FILL' 0, 'wght' 700; }

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

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--kb-navy);
  color: #fff;
  padding: 18px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 18px;
}
.sidebar .brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--kb-orange);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(255,137,0,0.4);
}
.sidebar .brand-name {
  font-weight: 800; font-size: 16px; letter-spacing: -0.2px;
}
.sidebar .brand-tag {
  font-size: 10.5px; color: rgba(255,255,255,0.55); font-weight: 600;
  letter-spacing: 0.4px; text-transform: uppercase;
}

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,137,0,0.16);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--kb-orange);
  border-radius: 0 3px 3px 0;
}
.nav-item .mi { font-size: 19px; }
.nav-item .badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--kb-orange);
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.4;
}
.nav-item .badge.gray { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); }
.nav-item .badge.red { background: var(--red); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
  padding-left: 10px; padding-right: 10px;
}
.sidebar-footer .ava {
  width: 34px; height: 34px; border-radius: 999px;
  background: linear-gradient(135deg, var(--kb-orange), #FF6B35);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.sidebar-footer .name { font-size: 13px; font-weight: 600; }
.sidebar-footer .role { font-size: 11px; color: rgba(255,255,255,0.55); }

/* ---------- Main / Header ---------- */
.main {
  display: flex; flex-direction: column;
  background: var(--bg);
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; gap: 20px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
}
.topbar .crumbs .current {
  color: var(--text); font-weight: 600;
}
.topbar-search {
  flex: 1; max-width: 460px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px 0 38px;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}
.topbar-search input:focus { border-color: var(--kb-orange); background: var(--surface); }
.topbar-search .mi {
  position: absolute; left: 12px; top: 9px;
  color: var(--text-3); font-size: 19px;
}
.topbar-search .kbd {
  position: absolute; right: 8px; top: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 6px;
  background: var(--surface);
}

.topbar-actions {
  display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot-red {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 999px; background: var(--red);
  border: 2px solid var(--surface);
}
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.topbar-user .ava {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(135deg, var(--kb-orange), #FF6B35);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px;
}
.topbar-user .name {
  font-size: 13px; font-weight: 600;
}

/* ---------- Page ---------- */
.page {
  padding: 24px;
  display: flex; flex-direction: column;
  gap: var(--gap);
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding-bottom: 4px;
}
.page-title {
  font-size: 24px; font-weight: 700; letter-spacing: -0.4px; margin: 0;
}
.page-subtitle {
  font-size: 13.5px; color: var(--text-2); margin-top: 4px;
}
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--card-pad); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.card-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.card-subtitle { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* ---------- Stat Card ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.stat-card .top {
  display: flex; align-items: center; justify-content: space-between;
}
.stat-card .icon-box {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange-soft); color: var(--kb-orange);
}
.stat-card .label {
  font-size: 12.5px; color: var(--text-2); font-weight: 500;
}
.stat-card .value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.5px;
  font-family: 'Inter', sans-serif;
}
.stat-card .delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
}
.stat-card .delta.up { color: var(--green); }
.stat-card .delta.down { color: var(--red); }
.stat-card .spark {
  position: absolute; right: -10px; bottom: -10px;
  opacity: 0.15;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  transition: background 0.12s, border 0.12s, color 0.12s;
}
.btn .mi { font-size: 16px; }
.btn-primary {
  background: var(--kb-orange);
  color: #fff;
  border-color: var(--kb-orange);
  box-shadow: 0 4px 10px rgba(255,137,0,0.25);
}
.btn-primary:hover { background: #E87A00; border-color: #E87A00; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg); }
.btn-danger {
  background: var(--red); color: #fff; border-color: var(--red);
}
.btn-danger:hover { background: #DC2626; }
.btn-success {
  background: var(--green); color: #fff; border-color: var(--green);
}
.btn-soft {
  background: var(--bg); color: var(--text); border-color: transparent;
}
.btn-soft:hover { background: var(--border-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; gap: 4px; }
.btn-sm .mi { font-size: 14px; }
.btn-icon { padding: 6px; aspect-ratio: 1; }

/* ---------- Pills / Tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pill.green { background: var(--green-soft); color: #047857; border-color: transparent; }
.pill.red { background: var(--red-soft); color: #B91C1C; border-color: transparent; }
.pill.yellow { background: var(--yellow-soft); color: #92400E; border-color: transparent; }
.pill.blue { background: var(--blue-soft); color: #1D4ED8; border-color: transparent; }
.pill.violet { background: var(--violet-soft); color: #6D28D9; border-color: transparent; }
.pill.teal { background: var(--teal-soft); color: #0F766E; border-color: transparent; }
.pill.orange { background: var(--kb-orange-soft); color: #B45309; border-color: transparent; }
.pill.gray { background: var(--bg); color: var(--text-2); }
.pill.dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor;
}

[data-theme="dark"] .pill.green { background: rgba(16,185,129,0.15); color: #6EE7B7; }
[data-theme="dark"] .pill.red { background: rgba(239,68,68,0.15); color: #FCA5A5; }
[data-theme="dark"] .pill.yellow { background: rgba(245,158,11,0.15); color: #FCD34D; }
[data-theme="dark"] .pill.blue { background: rgba(59,130,246,0.15); color: #93C5FD; }
[data-theme="dark"] .pill.violet { background: rgba(139,92,246,0.15); color: #C4B5FD; }
[data-theme="dark"] .pill.teal { background: rgba(20,184,166,0.15); color: #5EEAD4; }
[data-theme="dark"] .pill.orange { background: rgba(255,137,0,0.18); color: #FFB257; }

/* ---------- Tables ---------- */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.tbl thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-3);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0;
}
.tbl tbody td {
  padding: var(--pad-cell);
  border-bottom: 1px solid var(--border-2);
  color: var(--text);
  vertical-align: middle;
}
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .row-ava {
  display: flex; align-items: center; gap: 10px;
}
.tbl .row-ava .ava {
  width: 32px; height: 32px; border-radius: 999px;
  background: linear-gradient(135deg, var(--kb-navy-2), var(--kb-navy-3));
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tbl .row-ava .ava.orange { background: linear-gradient(135deg, var(--kb-orange), #FF6B35); }
.tbl .row-ava .name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.tbl .row-ava .sub { font-size: 11.5px; color: var(--text-3); }

.tbl-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tbl-toolbar .search {
  position: relative; flex: 1; max-width: 320px; min-width: 180px;
}
.tbl-toolbar .search input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px 0 34px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.tbl-toolbar .search .mi {
  position: absolute; left: 9px; top: 8px;
  color: var(--text-3); font-size: 18px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
}
.filter-chip:hover { background: var(--bg); }
.filter-chip.on {
  background: var(--kb-orange);
  color: #fff;
  border-color: var(--kb-orange);
}

.checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox.on { background: var(--kb-orange); border-color: var(--kb-orange); }
.checkbox.on::after {
  content: ''; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.toggle {
  width: 32px; height: 18px; border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
}
.toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 999px;
  background: #fff; transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on { background: var(--kb-orange); }
.toggle.on::after { transform: translateX(14px); }

/* ---------- Charts container ---------- */
.chart-wrap { position: relative; width: 100%; height: 100%; }

/* ---------- Activity feed ---------- */
.activity-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-2);
}
.activity-item:last-child { border-bottom: none; }
.activity-item .dot {
  width: 28px; height: 28px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.activity-item .text { font-size: 13px; line-height: 1.45; }
.activity-item .time { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,37,64,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  border: 1px solid var(--border);
  animation: pop 0.22s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal.lg { max-width: 720px; }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
  font-size: 13px;
  animation: slidein 0.22s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

/* ---------- Empty state ---------- */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty .mi { font-size: 36px; color: var(--text-3); margin-bottom: 8px; }

/* ---------- Skeleton ---------- */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skel {
  background: linear-gradient(90deg, var(--bg) 0%, var(--surface-2) 50%, var(--bg) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ---------- Drawer (notification panel) ---------- */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(10,37,64,0.4);
  z-index: 90;
  animation: fade 0.18s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  display: flex; flex-direction: column;
  animation: slideleft 0.22s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes slideleft { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ---------- Tweaks panel ---------- */
.tweaks {
  position: fixed; bottom: 24px; right: 24px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 90;
  font-size: 13px;
}
.tweaks h4 {
  font-size: 11.5px; text-transform: uppercase;
  font-weight: 700; letter-spacing: 0.6px;
  color: var(--text-3); margin: 0 0 10px;
}
.tweaks .row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.tweak-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.tweak-pills button {
  padding: 4px 9px; font-size: 11.5px; font-weight: 600;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
}
.tweak-pills button.on { background: var(--kb-orange); color: #fff; border-color: var(--kb-orange); }
.tweak-swatch {
  width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid var(--surface);
  outline: 1px solid var(--border);
  cursor: pointer;
}
.tweak-swatch.on { outline: 2px solid var(--text); }

/* ---------- Misc ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--gap); }
.row-flex { display: flex; gap: var(--gap); }
.col-flex { display: flex; flex-direction: column; gap: var(--gap); }

.kpi-bar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border-2);
}
.kpi-bar .item {
  padding: 14px 16px;
  border-right: 1px solid var(--border-2);
}
.kpi-bar .item:last-child { border-right: none; }
.kpi-bar .item .lbl { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; font-weight: 600; letter-spacing: 0.4px; }
.kpi-bar .item .val { font-size: 18px; font-weight: 700; margin-top: 2px; }

/* tiny scrollbars in tables */
.scroll-area { max-height: 100%; overflow: auto; }
.scroll-area::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* approval card grid */
.approval-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 10px;
}
.approval-card.pending { border-color: var(--yellow); border-left-width: 3px; background: linear-gradient(180deg, var(--yellow-soft) 0%, var(--surface) 30%); }
[data-theme="dark"] .approval-card.pending { background: linear-gradient(180deg, rgba(245,158,11,0.1) 0%, var(--surface) 30%); }

/* Responsive */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page { padding: 16px; }
}
