/* Batmash superadmin. Colours from brand/tokens.json. */
:root {
  --yellow: #F4E04D;
  --brick: #C4623A;
  --asphalt: #34353A;
  --night: #1E1F23;
  --chalk: #F2F2EA;
  --kerb: #8A8A86;
  --red: #D8342C;
  --green: #3E9B5B;
  --bg: #F6F6F1;
  --panel: #FFFFFF;
  --line: #E2E2DA;
  --text: #1E1F23;
  --muted: #6B6B67;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181B;
    --panel: #222327;
    --line: #34353A;
    --text: #F2F2EA;
    --muted: #A3A39E;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
p { margin: 0 0 10px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 420px; overflow: auto; }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--night); color: var(--chalk); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; letter-spacing: .5px; }
.brand img { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 600; color: var(--yellow); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.nav a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #D7D7CF; margin-bottom: 2px; }
.nav a:hover { background: #2C2D32; }
.nav a.on { background: var(--yellow); color: var(--night); font-weight: 700; }
.nav .sep { height: 1px; background: #34353A; margin: 10px 4px; }
.who { margin-top: 18px; padding: 10px; font-size: 13px; color: var(--kerb); border-top: 1px solid #34353A; word-break: break-all; }
.who button { margin-top: 8px; }
.main { padding: 24px 28px 60px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head p { color: var(--muted); margin: 0; }
.btn.menu-btn { display: none; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .main { padding: 16px; }
  .btn.menu-btn { display: inline-flex; margin-bottom: 12px; }
}

/* Pieces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile .n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.hidden { display: none !important; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 12px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--kerb); }
.btn.primary { background: var(--yellow); border-color: #D9C43A; color: var(--night); font-weight: 700; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }

input[type=text], input[type=email], input[type=number], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
.row input, .row select { width: auto; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .help { color: var(--muted); font-size: 13px; margin-top: 4px; }
.field .state { font-size: 12px; margin-top: 4px; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: color-mix(in srgb, var(--yellow) 10%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--line); color: var(--text); text-transform: uppercase; letter-spacing: .4px; }
.badge.ok { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); }
.badge.bad { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.badge.warn { background: color-mix(in srgb, var(--yellow) 35%, transparent); color: #8A7700; }
.badge.info { background: color-mix(in srgb, var(--brick) 20%, transparent); color: var(--brick); }

.checks div { padding: 6px 0; display: flex; gap: 8px; align-items: center; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--night); color: var(--chalk); padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast.bad { background: var(--red); }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 40; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 12px; padding: 20px; width: min(640px, 100%); }

/* Sign-in */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--night); }
.login .box { background: var(--panel); border-radius: 14px; padding: 28px; width: min(380px, 100%); }
.login .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login .logo img { width: 40px; height: 40px; }
.login .code { font-size: 26px; letter-spacing: 10px; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.error { color: var(--red); font-size: 14px; margin-top: 8px; }
