:root {
  --ink: #182033;
  --muted: #697386;
  --line: #d8dee8;
  --surface: #ffffff;
  --page: #f4f7fb;
  --brand: #c9202d;
  --brand-dark: #951821;
  --ok: #166534;
  --warn: #a16207;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #101624; color: #fff; padding: 22px 18px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 32px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: var(--brand); border-radius: 6px; font-weight: 800;
}
.brand small { display: block; color: #aeb7c8; margin-top: 2px; }
.nav { display: grid; gap: 4px; }
.nav a { color: #d8deea; padding: 10px 12px; border-radius: 6px; }
.nav a:hover { background: #1c2638; color: #fff; }
.main { padding: 24px 30px 42px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: 0; }
h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.eyebrow { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 700; margin-bottom: 5px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer;
  font: inherit; font-weight: 700;
}
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.button.ghost { background: transparent; }
.actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 8px; font-size: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 8px 0 12px; }
.table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; background: #f9fbfe; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--brand-dark); font-weight: 700; }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 0 9px; background: #eef2f7; color: #344054; font-size: 12px; font-weight: 700; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.muted { background: #f1f5f9; color: var(--muted); }
.summary-strip { display: flex; flex-wrap: wrap; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.link-card:hover { border-color: var(--brand); }
.card h2 { margin: 4px 0 8px; }
.card p { margin: 0; color: var(--muted); }
.form-card {
  display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 20px; max-width: 420px;
}
.form-card.wide { max-width: 720px; }
.auth-panel { display: grid; place-items: start center; padding-top: 36px; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
.input {
  min-height: 40px; width: 100%; border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font: inherit; background: #fff;
}
.checkbox { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.messages { display: grid; gap: 8px; margin-bottom: 16px; }
.message { padding: 10px 12px; border-radius: 6px; background: #eef2f7; border: 1px solid var(--line); }
.message.success { background: #dcfce7; border-color: #86efac; }
.message.error { background: #fee2e2; border-color: #fca5a5; }
.empty, .empty-row { color: var(--muted); text-align: center; padding: 28px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main { padding: 18px; }
  .topbar { align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
}

