:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2f7df6;
  --blue-dark: #1e5ed8;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { padding: 28px 22px; background: rgba(255,255,255,.78); border-right: 1px solid var(--line); backdrop-filter: blur(20px); }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; }
.brand span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.logo { width: 42px; height: 42px; border-radius: 16px; display: grid; place-items: center; color: white; font-weight: 800; background: linear-gradient(135deg, var(--blue), #7c3aed); box-shadow: var(--shadow); }
.nav { display: grid; gap: 8px; }
.nav a { padding: 12px 14px; border-radius: 14px; color: var(--muted); font-weight: 650; }
.nav a.active, .nav a:hover { background: #eef4ff; color: var(--blue-dark); }
.main { padding: 30px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.04em; }
.user-pill { padding: 10px 14px; border-radius: 999px; background: var(--card); color: var(--muted); box-shadow: var(--shadow); }

.card { background: var(--card); border: 1px solid rgba(229,231,235,.9); border-radius: 24px; box-shadow: var(--shadow); padding: 22px; }
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; }
.stat strong { display: block; font-size: 32px; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: 14px; }
.two { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); }

.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #f9fafb; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #eef2ff; color: #3730a3; }
.badge.ok { background: #eafaf0; color: #16803b; }
.badge.warn { background: #fff7ed; color: #b45309; }
.badge.danger { background: #fef2f2; color: #b91c1c; }

.form { display: grid; gap: 14px; max-width: 430px; }
.field label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 7px; }
input, select, textarea { width: 100%; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line); background: white; font: inherit; }
button, .button { border: 0; border-radius: 14px; background: var(--blue); color: white; padding: 12px 16px; font-weight: 750; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; }
button:hover, .button:hover { background: var(--blue-dark); }
.button.secondary { background: #eef2ff; color: var(--blue-dark); }
.button.danger { background: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notice { border-radius: 16px; padding: 12px 14px; background: #eef4ff; color: #1e40af; margin-bottom: 16px; }
.notice.danger { background: #fef2f2; color: #b91c1c; }
pre { overflow: auto; padding: 16px; background: #0f172a; color: #dbeafe; border-radius: 18px; max-height: 460px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .stats, .two { grid-template-columns: 1fr; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
