/* ============ AUS School Operations Dashboard ============ */
:root {
  --bg: #FBFBF9;
  --surface: #FFFFFF;
  --surface-alt: #F7F7F4;
  --border: #E7E5E0;
  --border-strong: #D6D3CD;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-soft: #94A3B8;

  --accent: #059669;
  --accent-600: #047857;
  --accent-50: #ECFDF5;
  --accent-100: #D1FAE5;

  --danger: #DC2626;
  --danger-50: #FEF2F2;
  --warn: #D97706;
  --warn-50: #FFFBEB;
  --info: #2563EB;
  --info-50: #EFF6FF;
  --violet: #7C3AED;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-lg: 0 4px 12px rgba(15,23,42,0.06);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --sidebar-w: 260px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-hero {
  background: linear-gradient(155deg, #064E3B 0%, #065F46 45%, #047857 100%);
  color: white;
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute;
  right: -100px;
  top: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.login-hero::after {
  content: '';
  position: absolute;
  right: 100px;
  bottom: -160px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}
.login-hero-content { position: relative; z-index: 2; }
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.login-brand-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: white;
  color: var(--accent-600);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 15px;
}
.login-tagline {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 100px;
  max-width: 460px;
}
.login-sub {
  margin-top: 20px;
  color: rgba(255,255,255,0.75);
  max-width: 420px;
  font-size: 15px;
  line-height: 1.55;
}
.login-meta {
  position: relative; z-index: 2;
  display: flex; gap: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  width: 100%;
  max-width: 400px;
}
.login-card h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.login-card p.lead {
  color: var(--text-muted);
  margin: 0 0 32px;
}
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.role-pick {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  transition: all 0.15s;
}
.role-pick:hover { border-color: var(--border-strong); }
.role-pick.active {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.08);
}
.role-pick .role-name { font-weight: 600; font-size: 13px; }
.role-pick .role-desc { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  font-size: 13.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
}
.textarea { min-height: 80px; resize: vertical; font-family: var(--font); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.12s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-600); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

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

.sidebar {
  background: white;
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sidebar-brand-mark {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-600) 100%);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.sidebar-brand-name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.sidebar-brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.01em; }

.nav-group { margin-bottom: 14px; }
.nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--text-soft);
  text-transform: uppercase;
  padding: 8px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  transition: background 0.1s;
  cursor: pointer;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--surface-alt); text-decoration: none; }
.nav-item.active { background: var(--accent-50); color: var(--accent-600); font-weight: 600; }
.nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.nav-item.active .badge { background: white; color: var(--accent-600); }
.nav-item .badge.alert { background: var(--danger); color: white; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 4px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E0F2FE 0%, #DBEAFE 100%);
  color: var(--info);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ---------- Main content ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  min-height: var(--topbar-h);
  background: rgba(251,251,249,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: nowrap;
}
.topbar-title-block { min-width: 0; flex-shrink: 0; }
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.topbar-crumb { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }
.topbar-spacer { flex: 1; }

.school-switcher {
  display: flex;
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.school-btn {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.school-btn:hover { color: var(--text); }
.school-btn.active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.school-btn .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.school-btn.aus .dot { background: var(--accent); }
.school-btn.nais .dot { background: var(--text-soft); }
.school-btn.combined .dot { background: var(--info); }

.date-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.date-pill .icon { width: 14px; height: 14px; color: var(--text-muted); }
.date-pill:hover { border-color: var(--border-strong); }

.top-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--border);
}

.page {
  padding: 24px 32px 60px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.page-desc { color: var(--text-muted); font-size: 13.5px; margin: 0; max-width: 620px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-seg {
  display: flex;
  background: var(--surface-alt);
  border-radius: 6px;
  padding: 2px;
}
.filter-seg button {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.filter-seg button.active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.filter-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  background: white;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 4px 0 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-seg { flex-shrink: 0; }
.filter-select { flex-shrink: 0; }

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.kpi-card .kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-card .kpi-label .icon { width: 13px; height: 13px; }
.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 2px;
}
.kpi-card .kpi-value .unit { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.kpi-card .kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-card .kpi-spark {
  height: 32px;
  margin-top: 6px;
  margin-left: -8px;
  margin-right: -8px;
}
.delta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.delta-chip.up { background: var(--accent-50); color: var(--accent-600); }
.delta-chip.down { background: var(--danger-50); color: var(--danger); }
.delta-chip.flat { background: var(--surface-alt); color: var(--text-muted); }

/* ---------- Cards / panels ---------- */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 12px; }
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.card-desc {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 2px 0 0;
}
.card-actions { display: flex; gap: 6px; align-items: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--text); }
table.data thead th .sort-ind { margin-left: 4px; color: var(--text-soft); }
table.data thead th .sort-ind.active { color: var(--accent); }
table.data tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:hover { background: var(--surface-alt); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.total-row, table.data tr.total-row td {
  font-weight: 600;
  background: #FAFAF7 !important;
  border-top: 1px solid var(--border-strong);
}
table.data tr.hi td { background: var(--accent-50); }
table.data tr.warn td { background: var(--warn-50); }
table.data tr.danger td { background: var(--danger-50); }

.table-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.search-input {
  padding: 6px 10px 6px 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: white url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2364748B' stroke-width='2' viewBox='0 0 24 24'><circle cx='11' cy='11' r='7'/><path d='m20 20-3-3'/></svg>") no-repeat 10px center;
  min-width: 200px;
}

.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }
.pg-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; background: white; font-size: 12px; }
.pg-btn:disabled { opacity: 0.4; }
.pg-btn:hover:not(:disabled) { background: var(--surface-alt); }

/* ---------- Chips/badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip-green { background: var(--accent-50); color: var(--accent-600); }
.chip-red { background: var(--danger-50); color: var(--danger); }
.chip-amber { background: var(--warn-50); color: var(--warn); }
.chip-blue { background: var(--info-50); color: var(--info); }
.chip-slate { background: var(--surface-alt); color: var(--text-muted); }
.chip-violet { background: #F5F3FF; color: var(--violet); }

/* ---------- Insight / callout ---------- */
.insight {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.insight .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.insight.info { background: var(--info-50); border-color: #DBEAFE; }
.insight.info .icon { color: var(--info); }
.insight.warn { background: var(--warn-50); border-color: #FDE68A; }
.insight.warn .icon { color: var(--warn); }
.insight.success { background: var(--accent-50); border-color: var(--accent-100); }
.insight.success .icon { color: var(--accent-600); }
.insight.danger { background: var(--danger-50); border-color: #FECACA; }
.insight.danger .icon { color: var(--danger); }
.insight strong { font-weight: 600; }

/* ---------- Progress ---------- */
.progress-bar {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s;
}
.progress-bar.warn > span { background: var(--warn); }
.progress-bar.danger > span { background: var(--danger); }
.progress-bar .target-marker {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--text);
  opacity: 0.5;
}

/* ---------- Empty state (NAIS) ---------- */
.empty-skeleton { position: relative; }
.empty-skeleton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(251,251,249,0.55);
  backdrop-filter: blur(1.5px);
  border-radius: var(--radius);
  z-index: 1;
  pointer-events: none;
}
.empty-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  padding: 4px 10px;
  background: white;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
}
.pending-value {
  color: var(--text-soft);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
  white-space: nowrap;
  display: inline-block;
}
.kpi-card .kpi-value .pending-value { font-size: 14px; line-height: 28px; }
.empty-hero {
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: white;
}
.empty-hero .empty-icon {
  width: 48px; height: 48px;
  margin: 0 auto 14px;
  color: var(--text-soft);
}
.empty-hero h2 { font-size: 18px; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.01em; }
.empty-hero p { color: var(--text-muted); max-width: 460px; margin: 0 auto 20px; }

/* ---------- Modal ---------- */
.modal-scrim {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.35);
  display: grid; place-items: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(15,23,42,0.2);
}
.modal h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.modal p { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: white;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  font-size: 13px;
  animation: slideIn 0.2s ease-out;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-body { color: var(--text-muted); font-size: 12px; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Charts customisations */
.recharts-cartesian-axis-tick text { font-size: 11px; fill: var(--text-muted); }
.recharts-legend-wrapper { font-size: 12px !important; }
.recharts-tooltip-wrapper { outline: none; }
.chart-tooltip {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
}
.chart-tooltip .tt-label { color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.chart-tooltip .tt-item { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.chart-tooltip .tt-item .swatch { width: 8px; height: 8px; border-radius: 2px; }
.chart-tooltip .tt-item .name { color: var(--text-muted); flex: 1; }
.chart-tooltip .tt-item .val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  transition: all 0.15s;
  background: white;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-50);
}
.dropzone-icon {
  width: 40px; height: 40px;
  color: var(--text-soft);
  margin: 0 auto 12px;
}
.dropzone h3 { margin: 0 0 6px; font-weight: 600; font-size: 15px; }
.dropzone p { color: var(--text-muted); margin: 0; font-size: 12.5px; }

/* Helpers */
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-success { color: var(--accent-600); }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.text-info { color: var(--info); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.tiny { font-size: 11.5px; }
.small { font-size: 12.5px; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -300px; z-index: 30; transition: left 0.2s; width: 280px; }
  .sidebar.open { left: 0; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 30px 24px; }
  .login-tagline { font-size: 30px; margin-top: 20px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 16px; }
}
