:root {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --text: #102033;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.24);
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
  --blue: #2563eb;
  --green: #0f766e;
  --amber: #d97706;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 22px 70px rgba(2, 6, 23, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top, rgba(37, 99, 235, 0.10), transparent 30%), var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
body { padding: 20px; }
.app-shell { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.sidebar, .card, .panel, .mini-card { backdrop-filter: blur(14px); background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 20px; }
.sidebar { padding: 22px; position: sticky; top: 20px; height: calc(100vh - 40px); display: flex; flex-direction: column; justify-content: space-between; }
.brand { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.04em; }
.brand-copy, .muted, .card p { color: var(--muted); }
.nav { display: grid; gap: 12px; margin-top: 24px; }
.nav-link, .nav-group a { padding: 10px 12px; border-radius: 12px; color: var(--text); }
.nav-link:hover, .nav-group a:hover { background: rgba(37, 99, 235, 0.10); }
.nav-group { display: grid; gap: 8px; padding-top: 6px; }
.nav-group span, .eyebrow, .card-label { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--muted); }
.main { display: grid; gap: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 4px; }
.topbar h1, .panel h2, .card h2, .card h3 { margin: 0; }
.theme-toggle, .inline-form button, .inline-form input { border-radius: 12px; border: 1px solid var(--border); background: var(--panel-strong); color: var(--text); padding: 11px 14px; }
.theme-toggle { cursor: pointer; }
.content { display: grid; gap: 20px; }
.card-grid { display: grid; gap: 20px; }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .panel { padding: 20px; }
.card { min-height: 150px; }
.card.accent-blue { border-top: 4px solid var(--blue); }
.card.accent-green { border-top: 4px solid var(--green); }
.card.accent-amber { border-top: 4px solid var(--amber); }
.card-link { display: inline-block; margin-top: 12px; color: var(--blue); font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.chart { width: 100%; min-height: 360px; }
.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,0.02); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stack { display: grid; gap: 12px; }
.mini-card { padding: 14px; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { min-width: 260px; }
.empty-state { padding: 30px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted); }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .card-grid.two, .card-grid.three { grid-template-columns: 1fr; }
}