:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dde3ec;
  --brand: #1464d2;
  --brand-dark: #0f4ea6;
  --danger: #d92d20;
  --ok: #12805c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card, .surface {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}
.login-card {
  width: min(420px, 100%);
  padding: 28px;
}
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.field { display: grid; gap: 7px; margin: 12px 0; }
.field span { color: var(--muted); font-size: 13px; }
input, select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}
.button, .ghost, .danger {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
.button { background: var(--brand); color: #fff; }
.button:hover { background: var(--brand-dark); }
.ghost { background: #edf3fb; color: var(--brand); }
.danger { background: #fff1f0; color: var(--danger); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar {
  background: #0f172a;
  color: #e7edf8;
  padding: 18px 14px;
}
.brand { padding: 8px 10px 18px; }
.brand strong { display: block; font-size: 18px; }
.brand span { color: #a9b5c8; font-size: 12px; }
.nav { display: grid; gap: 6px; }
.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #d7deea;
  border: 0;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
}
.nav button.active, .nav button:hover { background: rgba(255,255,255,.1); color: #fff; }
.main { padding: 22px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0; font-size: 22px; }
.grid { display: grid; gap: 16px; }
.surface { overflow: hidden; }
.surface-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.surface-head h2, .surface-head h3 { margin: 0; font-size: 17px; }
.surface-body { padding: 16px 18px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcff;
}
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 8px; font-size: 20px; }
.toolbar, .filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .field { margin: 0; min-width: 180px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { color: var(--muted); background: #f9fafb; font-weight: 600; }
.pill { display: inline-flex; align-items: center; min-height: 22px; border-radius: 999px; padding: 0 8px; background: #eef4ff; color: var(--brand); font-size: 12px; }
.pill.ok { background: #e8f7f1; color: var(--ok); }
.pill.danger { background: #fff1f0; color: var(--danger); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 2; }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav button { text-align: center; }
  .main { padding: 14px; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
