/* Slate dark base (Linear/Vercel/Supabase-style) + one accent per data
   family, each used as a subtle tint (per KPI-card design best practice:
   neutral base, semantic status colors, tiered opacity backgrounds) --
   deliberately NOT one flat color for the whole page. */
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #253347;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;

  --accent: #3b82f6;        /* blue -- overall/neutral metrics */
  --accent-soft: rgba(59, 130, 246, 0.14);
  --success: #22c55e;       /* green -- NSI metrics */
  --success-soft: rgba(34, 197, 94, 0.14);
  --violet: #a78bfa;        /* violet -- Non-NSI metrics */
  --violet-soft: rgba(167, 139, 250, 0.14);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;

  --radius: 10px;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8a5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.brand-title { font-weight: 700; font-size: 15px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.main { flex: 1; padding: 18px 24px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }

.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-ghost { background: transparent; }

.view.hidden { display: none; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.kpi-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 9px 12px;
}
.kpi-label { font-size: 10.5px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; }
.kpi-value { font-size: 15px; font-weight: 700; font-family: var(--mono); color: var(--accent); }

.kpi-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 12px 0 6px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  padding: 14px 16px;
}
.card-header { margin-bottom: 10px; }
.card-header h2 { font-size: 13px; margin: 0; color: var(--text); font-weight: 600; }

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-family: var(--mono);
}
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-nsi { background: var(--accent-soft); color: var(--accent); }
.badge-nonnsi { background: var(--accent-soft); color: var(--accent); }
.badge-neutral { background: rgba(148, 163, 184, 0.14); color: var(--muted); }
.badge-delivered { background: var(--success-soft); color: var(--success); }
.badge-progress { background: var(--warning-soft); color: var(--warning); }
.badge-notprocess { background: rgba(148, 163, 184, 0.14); color: var(--muted); }

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-row select, .filter-row input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.filter-row input { flex: 1; min-width: 200px; }
.result-count { margin-left: auto; font-size: 12px; color: var(--muted); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px;
}
#page-label { font-size: 13px; color: var(--muted); font-family: var(--mono); }
