:root {
  --sidebar-w: 240px;
  --topnav-h: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);

  --bg: #ffffff;
  --bg-2: #f8f9fa;
  --bg-3: #f1f3f5;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.15);
  /* Light mode: ALL text is pure black — client wants no gray anywhere (hierarchy via weight/size). */
  --text: #000000;
  --text-2: #000000;
  --text-3: #000000;
  --accent: #18181b;
  --accent-fg: #fafafa;
  --ring: rgba(24,24,27,0.12);

  --sidebar-bg: #ffffff;
  --topnav-bg: rgba(255,255,255,0.92);
  --card-bg: #ffffff;
  --input-bg: #ffffff;

  --blue: #3b82f6; --blue-bg: #eff6ff; --blue-fg: #1e40af;
  --green: #22c55e; --green-bg: #f0fdf4; --green-fg: #166534;
  --amber: #f59e0b; --amber-bg: #fffbeb; --amber-fg: #92400e;
  --red: #ef4444; --red-bg: #fef2f2; --red-fg: #991b1b;
  --violet: #8b5cf6; --violet-bg: #f5f3ff; --violet-fg: #5b21b6;
}

[data-theme="dark"] {
  --bg: #09090b;
  --bg-2: #18181b;
  --bg-3: #27272a;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #52525b;
  --accent: #fafafa;
  --accent-fg: #09090b;
  --ring: rgba(255,255,255,0.12);

  --sidebar-bg: #09090b;
  --topnav-bg: rgba(9,9,11,0.92);
  --card-bg: #18181b;
  --input-bg: #27272a;

  --blue-bg: #1e3a5f; --blue-fg: #93c5fd;
  --green-bg: #14532d; --green-fg: #86efac;
  --amber-bg: #451a03; --amber-fg: #fcd34d;
  --red-bg: #450a0a; --red-fg: #fca5a5;
  --violet-bg: #2e1065; --violet-fg: #c4b5fd;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Geist', -apple-system, sans-serif;
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1040;
  transform: translateX(0);
  transition: transform var(--transition);
}

.sidebar-brand {
  height: var(--topnav-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 15px; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}

.sidebar-brand .brand-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--accent-fg);
  font-size: 14px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3);
  padding: 12px 8px 6px; margin-top: 4px;
}

.nav-item-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  position: relative;
  margin-bottom: 1px;
  border: none; background: transparent; width: 100%; text-align: left;
}

.nav-item-link i { font-size: 16px; flex-shrink: 0; }

.nav-item-link:hover { background: var(--bg-3); color: var(--text); }
.nav-item-link.active { background: var(--bg-3); color: var(--text); font-weight: 600; }
.nav-item-link.active::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 99px;
  background: var(--bg-3); color: var(--text-2);
  flex-shrink: 0;
}
.nav-badge.blue   { background: var(--blue-bg);   color: var(--blue-fg); }
.nav-badge.green  { background: var(--green-bg);  color: var(--green-fg); }
.nav-badge.red    { background: var(--red-bg);    color: var(--red-fg); }
.nav-badge.amber  { background: var(--amber-bg);  color: var(--amber-fg); }
.nav-badge.violet { background: var(--violet-bg); color: var(--violet-fg); }

/* ── Submenu chevron ──────────────────────── */
.nav-chevron {
  margin-left: auto; font-size: 12px; color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.nav-item-link.open > .nav-chevron,
.nav-item-link[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }

/* Button styled as a nav row (collapsible group header) */
.nav-group-toggle {
  background: transparent; border: none; width: 100%;
  cursor: pointer; font-family: inherit;
}

/* ── Level-1 submenu ──────────────────────── */
.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1),
              opacity   0.22s ease;
  opacity: 0;
}
.nav-sub.open {
  max-height: 600px;
  opacity: 1;
}

/* L1 items */
.nav-sub-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px 6px 30px;
  border-radius: var(--radius);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; position: relative;
  border: none; background: transparent; width: 100%; text-align: left;
  margin-bottom: 1px;
  transition: background var(--transition), color var(--transition);
}
.nav-sub-item::before {
  content: '';
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--border-hover);
  transition: background var(--transition), transform var(--transition);
}
.nav-sub-item:hover { background: var(--bg-3); color: var(--text); }
.nav-sub-item:hover::before { background: var(--text-3); }
.nav-sub-item.active { color: var(--text); font-weight: 600; }
.nav-sub-item.active::before { background: var(--accent); transform: translateY(-50%) scale(1.3); }

/* ── Level-2 submenu (nested) ─────────────── */
.nav-sub-2 {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.24s cubic-bezier(0.4,0,0.2,1),
              opacity   0.2s ease;
  opacity: 0;
}
.nav-sub-2.open { max-height: 400px; opacity: 1; }

.nav-sub-2-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 46px;
  border-radius: var(--radius);
  color: var(--text-3); font-size: 12.5px; font-weight: 500;
  cursor: pointer; position: relative;
  border: none; background: transparent; width: 100%; text-align: left;
  margin-bottom: 1px;
  transition: background var(--transition), color var(--transition);
}
.nav-sub-2-item::before {
  content: '–';
  position: absolute; left: 34px;
  color: var(--border-hover);
  font-size: 11px;
  transition: color var(--transition);
}
.nav-sub-2-item:hover { background: var(--bg-3); color: var(--text-2); }
.nav-sub-2-item:hover::before { color: var(--text-3); }
.nav-sub-2-item.active { color: var(--text); font-weight: 600; }
.nav-sub-2-item.active::before { color: var(--accent); }

/* L1 item that has children gets a chevron on right */
.nav-sub-item.has-sub { padding-right: 28px; }
.nav-sub-item .nav-chevron-sm {
  position: absolute; right: 10px; font-size: 11px; color: var(--text-3);
  transition: transform 0.2s ease;
}
.nav-sub-item.open .nav-chevron-sm { transform: rotate(90deg); }

/* vertical guide line for open L1 group */
.nav-sub-group {
  position: relative;
  padding-left: 0;
}
.nav-sub-group.open::before {
  content: '';
  position: absolute; left: 20px; top: 0; bottom: 8px;
  width: 1px; background: var(--border);
  border-radius: 1px;
}

/* ── Recursive Solutions tree (sidebar, arbitrary depth) ───── */
.nav-tree-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer; position: relative;
  border: none; background: transparent; width: 100%; text-align: left;
  margin-bottom: 1px; line-height: 1.3;
  transition: background var(--transition), color var(--transition);
}
.nav-tree-item i { font-size: 14px; flex-shrink: 0; }
.nav-tree-item > span { flex: 1; min-width: 0; }     /* allow long document names to wrap */
.nav-tree-item:hover { background: var(--bg-3); color: var(--text); }
.nav-tree-item.active { background: var(--bg-3); color: var(--text); font-weight: 600; }
.nav-tree-toggle .nav-chevron { flex-shrink: 0; }
.nav-tree-toggle.open > .nav-chevron { transform: rotate(90deg); }
.nav-tree-root { color: var(--text); font-weight: 600; font-size: 13.5px; margin-top: 14px; }
.nav-tree-root i:first-child { font-size: 16px; }
.nav-tree-sub { display: none; }
.nav-tree-sub.open { display: block; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px;
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer; text-decoration: none; color: inherit;
}
.user-card:hover { background: var(--bg-3); }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-info .user-role { font-size: 11px; color: var(--text-3); }

/* ── Overlay ─────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 1039;
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity var(--transition);
}
.sidebar-overlay.show { display: block; opacity: 1; }

/* ── Top Nav ─────────────────────────────── */
.topnav {
  position: fixed; top: 0; right: 0;
  left: var(--sidebar-w);
  height: var(--topnav-h);
  background: var(--topnav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  z-index: 1030;
  transition: left var(--transition);
}

.topnav-toggle {
  display: none;
  border: none; background: transparent;
  padding: 6px; border-radius: var(--radius);
  color: var(--text-2); cursor: pointer; font-size: 18px;
  transition: background var(--transition);
}
.topnav-toggle:hover { background: var(--bg-3); }

.topnav-search {
  flex: 1; max-width: 320px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.topnav-search:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--ring);
}
.topnav-search i { color: var(--text-3); font-size: 15px; }
.topnav-search input {
  border: none; background: transparent; outline: none;
  font-size: 13.5px; color: var(--text); width: 100%;
  font-family: inherit;
}
.topnav-search input::placeholder { color: var(--text-3); }

.topnav-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius);
  border: 1px solid var(--border); background: transparent;
  display: grid; place-items: center;
  color: var(--text-2); cursor: pointer; font-size: 16px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text); border-color: var(--border-hover); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); border: 1.5px solid var(--bg);
}

/* ── Main ─────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topnav-h);
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.page { display: none; padding: 24px; animation: fadeUp 0.22s ease both; }
.page.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }

/* ── Cards ────────────────────────────────── */
.card-base {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.stat-label {
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.stat-icon {
  width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center; font-size: 15px;
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-change { font-size: 12px; margin-top: 6px; font-weight: 500; display: flex; align-items: center; gap: 3px; }
.stat-change.up { color: var(--green-fg); }
.stat-change.down { color: var(--red-fg); }

/* ── Table ────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3);
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 12px 16px; font-size: 13.5px; color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg-2); }
.tbl tbody tr { transition: background var(--transition); }

/* ── Badge ────────────────────────────────── */
.badge-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  border-radius: 99px;
}
.badge-green  { background: var(--green-bg);  color: var(--green-fg); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber-fg); }
.badge-red    { background: var(--red-bg);    color: var(--red-fg); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue-fg); }
.badge-violet { background: var(--violet-bg); color: var(--violet-fg); }
.badge-gray   { background: var(--bg-3);      color: var(--text-2); }

/* ── Buttons ──────────────────────────────── */
.btn-primary-custom {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-fg);
  border: none; font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-primary-custom:hover { opacity: 0.88; }
.btn-primary-custom:active { transform: scale(0.97); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius);
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border); font-size: 13.5px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--border-hover); }

/* ── Sparkline ────────────────────────────── */
.sparkline { width: 100%; height: 56px; }

/* ── Progress Bar ─────────────────────────── */
.prog-bar-wrap { background: var(--bg-3); border-radius: 99px; height: 6px; overflow: hidden; }
.prog-bar { height: 100%; border-radius: 99px; transition: width 0.6s cubic-bezier(.4,0,.2,1); }

/* ── Mini Chart ───────────────────────────── */
canvas.chart-canvas { width: 100%; }

/* ── Activity Feed ────────────────────────── */
.activity-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; margin-top: 1px;
}

/* ── Modal ────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 2000; display: none; place-items: center;
  backdrop-filter: blur(4px);
  animation: none;
}
.modal-overlay.show { display: grid; }

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: modalIn 0.2s cubic-bezier(.4,0,.2,1) both;
  margin: 16px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-closing .modal-box { animation: modalOut 0.15s ease both; }
@keyframes modalOut {
  to { opacity: 0; transform: scale(0.96); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}

/* ── Form ─────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-ctrl {
  width: 100%; padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--input-bg);
  color: var(--text); font-size: 13.5px; font-family: inherit; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-ctrl:focus { border-color: var(--border-hover); box-shadow: 0 0 0 3px var(--ring); }
.form-ctrl::placeholder { color: var(--text-3); }
select.form-ctrl { cursor: pointer; }

/* ── Toast ────────────────────────────────── */
.toast-wrap {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast-item {
  background: var(--accent); color: var(--accent-fg);
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
  animation: toastIn 0.2s ease both;
  min-width: 240px;
}
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } }
@keyframes toastOut { to { opacity:0; transform:translateY(8px); } }

/* ── Dropdown ─────────────────────────────── */
.dropdown-menu-custom {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  min-width: 160px; z-index: 1050;
  animation: fadeUp 0.15s ease both;
  display: none;
}
.dropdown-menu-custom.show { display: block; }
.dropdown-item-custom {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-2);
  cursor: pointer; transition: background var(--transition), color var(--transition);
  border: none; background: transparent; width: 100%; text-align: left;
}
.dropdown-item-custom:hover { background: var(--bg-3); color: var(--text); }
.dropdown-item-custom.danger:hover { background: var(--red-bg); color: var(--red-fg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Chart Bars ───────────────────────────── */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 80px; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-chart-bar {
  width: 100%; border-radius: 4px 4px 0 0;
  background: var(--accent); opacity: 0.15;
  transition: opacity var(--transition), height 0.5s cubic-bezier(.4,0,.2,1);
}
.bar-chart-bar.active { opacity: 1; }
.bar-chart-label { font-size: 10px; color: var(--text-3); }

/* ── Responsive ───────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    z-index: 1045;
  }
  .sidebar.open { transform: translateX(0); }
  .topnav { left: 0; }
  .topnav-toggle { display: grid; }
  .main-content { margin-left: 0; }
}

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Dashboard Header ─────────────────────── */
.dash-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
.dash-greeting { font-size: 13px; color: var(--text-3); font-weight: 500; }
.date-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2); font-weight: 500;
  padding: 7px 13px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card-bg);
}

/* ── KPI Cards ────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 0;
  position: relative; overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  cursor: default;
}
.kpi-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  transform: translateY(-1px);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.kpi-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; font-size: 15px;
}
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 8px; }
.kpi-footer { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.kpi-change { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 2px; padding: 2px 7px; border-radius: 99px; }
.kpi-change.up   { background: var(--green-bg); color: var(--green-fg); }
.kpi-change.down { background: var(--red-bg);   color: var(--red-fg); }
.kpi-vs { font-size: 12px; color: var(--text-3); }

/* Sparklines */
.kpi-spark { width: 100%; height: 44px; display: block; margin: 0 -18px; width: calc(100% + 36px); }
.spark-line-green  { fill:none; stroke:#22c55e; stroke-width:1.5; }
.spark-fill-green  { fill:rgba(34,197,94,0.12); stroke:none; }
.spark-line-blue   { fill:none; stroke:#3b82f6; stroke-width:1.5; }
.spark-fill-blue   { fill:rgba(59,130,246,0.12); stroke:none; }
.spark-line-violet { fill:none; stroke:#8b5cf6; stroke-width:1.5; }
.spark-fill-violet { fill:rgba(139,92,246,0.12); stroke:none; }
.spark-line-amber  { fill:none; stroke:#f59e0b; stroke-width:1.5; }
.spark-fill-amber  { fill:rgba(245,158,11,0.12); stroke:none; }

/* ── Chart Card ───────────────────────────── */
.chart-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.chart-title { font-size: 15px; font-weight: 700; color: var(--text); }
.chart-sub   { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.chart-legend { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.area-labels {
  display: flex; justify-content: space-between;
  margin-top: 4px;
}
.area-labels span { font-size: 10px; color: var(--text-3); }

/* ── SVG Area Chart paths ─────────────────── */
.area-revenue { fill: rgba(59,130,246,0.12); }
.area-profit  { fill: rgba(34,197,94,0.10); }
.line-revenue { fill:none; stroke:#3b82f6; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.line-profit  { fill:none; stroke:#22c55e; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.area-dot     { fill:#fff; stroke-width:2; }
.area-dot-r   { stroke:#3b82f6; }
.area-dot-g   { stroke:#22c55e; }
.axis-line    { stroke: var(--border); stroke-width: 0.5; }
.axis-label   { font-size: 9px; fill: var(--text-3); font-family: 'Geist', sans-serif; }
.grid-line    { stroke: var(--border); stroke-width: 0.5; stroke-dasharray: 3 3; }

/* ── Donut Legend ─────────────────────────── */
.donut-leg-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.donut-leg-row:last-child { border-bottom: none; }
.donut-leg-left { display: flex; align-items: center; gap: 8px; }
.donut-leg-dot  { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-leg-label { font-size: 13px; color: var(--text); font-weight: 500; }
.donut-leg-pct  { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'Geist Mono', monospace; }

/* ── Goal Rings ───────────────────────────── */
.goal-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.goal-ring-wrap { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
.goal-ring-wrap svg { width: 42px; height: 42px; transform: rotate(-90deg); }
.goal-ring-bg   { fill:none; stroke-width: 4; }
.goal-ring-fill { fill:none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1); }
.goal-ring-label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: var(--text);
  line-height: 1;
  transform: none;
}
.goal-info { flex: 1; }
.goal-name  { font-size: 13.5px; font-weight: 600; color: var(--text); }
.goal-meta  { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.goal-num   { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'Geist Mono', monospace; text-align: right; }

/* ── Team Online ──────────────────────────── */
.team-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }
.team-avatar-wrap { position: relative; flex-shrink: 0; }
.team-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.team-online-dot {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--card-bg);
}
.team-online-dot.on  { background: var(--green); }
.team-online-dot.off { background: var(--text-3); }
.team-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.team-role { font-size: 12px; color: var(--text-3); }
.team-time { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
