/* Kasilan Naidoo <Kasilan@BTLR.vip> — © 2026 Kasilan Naidoo. All rights reserved.
   BTLR ops control panel (22 Oct 2026). Light by default, dark with the system. */
:root {
  color-scheme: light;
  --bg: #F6F7F6; --surface: #FFFFFF; --lift: #F0F2F1; --line: #DDE2E0;
  --text: #16201C; --muted: #66726D; --accent: #1F8F6D; --accent-ink: #FFFFFF;
  --ok: #1F8F6D; --warn: #B7791F; --bad: #C2413A; --info: #3B6EA8;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0B0F0E; --surface: #131A18; --lift: #1A2321; --line: #26312E;
    --text: #E8EEEC; --muted: #8E9B96; --accent: #4FC6A0; --accent-ink: #062018;
    --ok: #4FC6A0; --warn: #E0A84B; --bad: #E0625A; --info: #7BA7DB;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
.brand { font-weight: 700; letter-spacing: .16em; font-size: 16px; }
.brand span { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.narrow { max-width: 380px; margin: 12vh auto 0; }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
input, select, textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--lift); color: var(--text); font: inherit; }
textarea { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
button { font: inherit; border-radius: 8px; padding: 7px 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
button.ghost { background: transparent; }
.wide-btn { width: 100%; margin-top: 16px; padding: 10px; }
.msg { min-height: 1.4em; margin: 10px 0 0; color: var(--bad); font-size: 13px; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.nav { border-right: 1px solid var(--line); background: var(--surface); padding: 16px 10px;
  display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.nav .brand { padding: 0 8px 8px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 8px 2px; }
.nav a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--text); text-decoration: none; }
.nav a.active, .nav a:hover { background: var(--lift); }
.nav a.active { color: var(--accent); font-weight: 600; }
.nav-foot { margin-top: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.main { padding: 20px 24px 60px; min-width: 0; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 22px 0 8px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 80ch; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 200px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid currentColor; white-space: nowrap; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .info { color: var(--info); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--lift); position: sticky; top: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--lift); }
tr.sel td { background: var(--lift); }
td.trunc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor { margin-top: 14px; }
.editor .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 14px; }
.editor .help { font-size: 11px; color: var(--muted); margin-top: 2px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.notice { border-left: 3px solid var(--info); background: var(--lift); padding: 8px 12px; border-radius: 6px; margin: 10px 0; font-size: 13px; }
.notice.warn { border-color: var(--warn); color: var(--text); }
.notice.bad { border-color: var(--bad); color: var(--text); }
.check-item { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal-card { max-width: 520px; width: 100%; }
.modal-card ul { padding-left: 18px; }
.toast { position: fixed; bottom: 16px; right: 16px; background: var(--text); color: var(--bg); padding: 10px 14px;
  border-radius: 8px; max-width: 420px; z-index: 20; font-size: 13px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--lift); padding: 8px; border-radius: 6px; margin: 4px 0; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 16px; }
}
input[type=checkbox] { width: auto; min-width: 0 !important; vertical-align: middle; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
