/* Stead Wars admin panel. Plain and monochrome: black, white and greys,
   one red for destructive actions, tints and spacing instead of lines. */
:root {
  --ink: #111;
  --ink-2: #444;
  --ink-3: #777;
  --paper: #fff;
  --tint: #f4f4f3;
  --tint-2: #ebebe9;
  --danger: #b3261e;
  --ok: #1d6b35;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.boot { padding: 40px; color: var(--ink-3); }

/* Shell */
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { font-weight: 700; font-size: 16px; margin: 0 6px 18px; }
.brand small { display: block; font-weight: 400; color: #aaa; font-size: 12px; }
.nav a { display: block; color: #ddd; text-decoration: none; padding: 7px 10px; border-radius: var(--radius); margin-bottom: 2px; }
.nav a:hover { background: #222; color: #fff; }
.nav a.on { background: #fff; color: var(--ink); font-weight: 600; }
.who { margin: 20px 6px 0; font-size: 13px; color: #aaa; }
.who b { color: #fff; }
.main { padding: 24px 28px 60px; min-width: 0; }

/* Cards and grids */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 18px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--tint); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); min-width: 0; }
.card.white { background: var(--paper); box-shadow: 0 0 0 1px var(--tint-2) inset; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--ink-2); font-size: 13px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }

/* Tables: zebra tint, no rules */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 6px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
td { padding: 6px 8px; vertical-align: top; overflow-wrap: break-word; }
td button, td .badge { white-space: nowrap; }
tbody tr:nth-child(odd) td { background: var(--paper); }
.card.white tbody tr:nth-child(odd) td { background: var(--tint); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--tint-2) !important; }
.kv td:first-child { color: var(--ink-2); width: 40%; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--ink-3); }
.pre { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--paper); padding: 8px; border-radius: var(--radius); max-height: 260px; overflow: auto; }

/* Badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--tint-2); margin-right: 4px; white-space: nowrap; }
.badge.dark { background: var(--ink); color: #fff; }
.badge.red { background: var(--danger); color: #fff; }

/* Forms */
form.act { display: grid; gap: 8px; }
label { display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius); background: var(--paper); box-shadow: 0 0 0 1px #d6d6d3 inset;
}
.card.white input, .card.white select, .card.white textarea { background: var(--tint); box-shadow: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
button { white-space: nowrap; background: var(--ink); color: #fff; border: 0; border-radius: var(--radius); padding: 8px 14px; cursor: pointer; font-weight: 600; }
button:hover { background: #333; }
button.ghost { background: var(--tint-2); color: var(--ink); }
button.ghost:hover { background: #ddd; }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.5; cursor: wait; }
.msg { font-size: 14px; padding: 8px 10px; border-radius: var(--radius); }
.msg.ok { background: #e7f2ea; color: var(--ok); }
.msg.err { background: #f8e6e4; color: var(--danger); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: var(--tint-2); color: var(--ink); }
.tabs button.on { background: var(--ink); color: #fff; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px; }
.auth .card { width: 100%; max-width: 380px; background: var(--paper); padding: 26px; }
.auth h1 { text-align: center; }
.auth p { color: var(--ink-2); font-size: 14px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, Menlo, monospace; }
.codes span { background: var(--tint); padding: 6px; border-radius: var(--radius); text-align: center; }
.secret { font-family: ui-monospace, Menlo, monospace; background: var(--tint); padding: 10px; border-radius: var(--radius); word-break: break-all; text-align: center; font-size: 16px; letter-spacing: 0.06em; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .cols { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}
