/* Minimal on purpose. This is an operator's tool: legibility, dense tables,
   and nothing that needs a designer to change a label. */

:root {
  --bg: #12141a;
  --panel: #1a1d26;
  --line: #2b3040;
  --ink: #e6e8ef;
  --dim: #949bb0;
  --accent: #6ea8fe;
  --bad: #ff8080;
  --good: #7ee2a8;
  --warn: #ffcc66;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.boot, .signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--dim);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  width: min(360px, 92vw);
  display: grid;
  gap: 12px;
}

.card h1 { margin: 0 0 4px; font-size: 20px; }

label { display: grid; gap: 4px; font-size: 13px; color: var(--dim); }

input, select, textarea {
  font: inherit;
  background: #0f1116;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 0;
}

input[type=checkbox] { width: auto; justify-self: start; }

button {
  font: inherit;
  background: #2a3350;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}
button:hover { background: #35406a; }
button.danger { background: #4a2530; }
button.danger:hover { background: #63303e; }
button.link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 2px 0;
  text-align: left;
}

.app { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }

.nav {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand { font-weight: 600; margin-bottom: 10px; }
.brand span { color: var(--dim); font-weight: 400; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav li button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 6px;
}
.nav li button:hover { background: #232838; }
.nav li button[aria-current="page"] { background: #2a3350; }
.who {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
  display: grid;
  gap: 4px;
  word-break: break-all;
}

main { padding: 22px 26px 60px; max-width: 1100px; }

h2 { font-size: 19px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }

section.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row > label { flex: 1 1 150px; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 500; white-space: nowrap; }
td.actions { white-space: nowrap; }
td.actions button { padding: 4px 8px; font-size: 12px; }
.scroll { overflow-x: auto; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; word-break: break-word; }

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.pill.good { color: var(--good); border-color: #2e5a44; }
.pill.bad { color: var(--bad); border-color: #5a2e33; }
.pill.warn { color: var(--warn); border-color: #5a4c2e; }

.error { color: var(--bad); font-size: 13px; margin: 0; min-height: 1em; }
.note { color: var(--dim); font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 380px;
  font-size: 13px;
  box-shadow: 0 8px 24px #0008;
}
.toast.bad { border-left-color: var(--bad); }

dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  width: min(420px, 92vw);
}
dialog::backdrop { background: #000a; }
dialog form { display: grid; gap: 10px; }
dialog h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 16px; }

iframe.proof { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
img.proof { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .nav { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav ul { display: flex; flex-wrap: wrap; }
  .who { margin: 0; border: none; padding: 0; }
}

.gap-top { margin-top: 12px; }
dialog .note { white-space: pre-line; }

/* A `display` rule of our own beats the UA's [hidden] rule, so the shell and
   the sign-in card were both on screen at once. Say it louder than they do. */
[hidden] { display: none !important; }

/* ── charts ─────────────────────────────────────────────────────────────── */

.bars {
  display: grid;
  grid-template-columns: minmax(90px, max-content) 1fr;
  gap: 6px 12px;
  align-items: center;
  font-size: 13px;
}
.bar-label { color: var(--dim); word-break: break-word; }
.bar-track {
  position: relative;
  background: #0f1116;
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 22px;
  display: flex;
  align-items: center;
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #2a3350, #4a6bd0);
  border-radius: 3px;
}
.bar-value { position: relative; padding: 0 8px; font-size: 12px; }

.daychart { width: 100%; min-width: 520px; height: auto; }
.daychart .axis { stroke: var(--line); stroke-width: 1; }
.daychart .daybar { fill: #4a6bd0; }
.daychart .daybar:hover { fill: #6ea8fe; }

th button.link { font: inherit; color: var(--dim); }
th button.link:hover { color: var(--accent); }
