:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e6e8ee;
  --sidebar: #0f172a;
  --sidebar-soft: #1e293b;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #eef4ff 0%, var(--bg) 38%, #eff2f7 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, #111827 100%);
  color: #e5e7eb;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 800;
}
.brand h1 { margin: 0; font-size: 20px; color: #fff; }
.brand p { margin: 0; font-size: 12px; color: #94a3b8; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a {
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.sidebar nav a.active, .sidebar nav a:hover {
  background: var(--sidebar-soft);
  color: #fff;
  text-decoration: none;
}
.sidebar-foot { margin-top: auto; font-size: 13px; color: #cbd5e1; }
.sidebar-foot small { color: #94a3b8; display: block; margin: 4px 0 10px; }
.content { padding: 24px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.topbar h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.topbar span { color: var(--muted); font-size: 13px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi-box h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 700; }
.kpi-box p { margin: 8px 0 0; font-size: 28px; font-weight: 800; }
.list-table { width: 100%; border-collapse: collapse; }
.list-table th, .list-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
  vertical-align: top;
}
.list-table th { color: #334155; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
label { font-size: 13px; color: #334155; font-weight: 600; display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
button, .btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.btn.secondary { background: #0ea5e9; }
.btn.ghost { background: #e2e8f0; color: #0f172a; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: grid; gap: 12px; }
.alert { padding: 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.alert.success { background: #ecfdf5; color: var(--ok); border: 1px solid #bbf7d0; }
.alert.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: #1e40af;
}
.public-body { min-height: 100vh; display: grid; }
.public-wrap {
  max-width: 1180px;
  margin: auto;
  width: calc(100% - 32px);
  padding: 24px 0 40px;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: stretch;
}
.hero .card { padding: 26px; }
.hero h1 { margin-top: 0; font-size: 42px; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.portal-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 40; }
  .hero { grid-template-columns: 1fr; }
  .portal-grid { grid-template-columns: 1fr; }
}
