@font-face { font-family: "Black Ops One"; src: url("/static/fonts/BlackOpsOne-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --ink: #0b0a0b;
  --bg: #121012;
  --panel: #1a1719;
  --panel2: #221e21;
  --line: #2e292c;
  --text: #ece6df;
  --muted: #9a918b;
  --red: #db1f1a;
  --red-hot: #ff5c38;
  --good: #4fc26b;
  --warn: #e8a83a;
  --bad: #ff5a4e;
  --radius: 10px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #2a0d0b 0%, transparent 60%) fixed, var(--ink);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }
a { color: var(--red-hot); }
code { font-family: var(--mono); font-size: 12.5px; background: #ffffff10; padding: 1px 5px; border-radius: 4px; }
h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; letter-spacing: .2px; }
h4 { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.muted { color: var(--muted); margin: 2px 0 12px; }
.mt { margin-top: 22px; }
.error { color: var(--bad); min-height: 1.2em; margin: 6px 0; }
.empty { color: var(--muted); text-align: center; padding: 18px 0 8px; margin: 0; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; }
.wordmark { font-family: "Black Ops One", system-ui, sans-serif; font-size: 24px; color: var(--red); letter-spacing: 2px;
  text-shadow: 0 2px 0 #00000099, 0 0 18px #db1f1a55; }

/* ---------- controls ---------- */
input, select {
  background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font: inherit; min-width: 0;
}
input:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px #db1f1a33; }
.small-input { padding: 6px 9px; width: 180px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 15px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: #4a4246; background: #2a2528; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #ef2b24; }
.btn.good { background: #1f4d2b; border-color: #2c6b3c; }
.btn.good:hover { background: #276236; }
.btn.bad { background: #4a1714; border-color: #6e221d; color: #ffd6d1; }
.btn.bad:hover { background: #5d1d19; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--red); }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 30px 28px; box-shadow: 0 30px 80px #000a; }
.login-card .brand { justify-content: center; }
.login-card .wordmark { font-size: 34px; }
.login-card > .muted { text-align: center; margin-bottom: 22px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
.side { background: #0e0c0dcc; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px 22px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; gap: 10px; align-items: center; color: var(--muted); text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 550; }
nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
nav a:hover { background: #ffffff08; color: var(--text); }
nav a.on { background: #db1f1a1f; color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.me { font-size: 12.5px; color: var(--muted); line-height: 1.3; overflow: hidden; }
.me b { color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; }
main { padding: 18px 26px 40px; min-width: 0; max-width: 1280px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.top-name { color: var(--muted); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 99px; font-weight: 650; font-size: 12.5px;
  background: var(--panel2); border: 1px solid var(--line); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.good::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.pill.warn::before { background: var(--warn); }
.pill.bad::before { background: var(--bad); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.two > .card { margin-bottom: 16px; }

/* ---------- dashboard ---------- */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(120deg, #2a0f0d 0%, var(--panel) 55%); }
.hero-state { font-family: "Black Ops One", system-ui, sans-serif; font-size: 30px; letter-spacing: 1px; color: var(--muted); }
.hero-state.good { color: var(--good); }
.hero-state.warn { color: var(--warn); }
.hero-state.bad { color: var(--bad); }
.hero-name { font-size: 16px; font-weight: 650; margin-top: 2px; }
.hero-facts { color: var(--muted); margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.hero-facts b { color: var(--text); font-weight: 600; }
.hero-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.meters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.meter { margin: 0; padding: 14px 16px; }
.meter b { display: block; font-size: 22px; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.meter small { color: var(--muted); font-size: 12px; }
.bar { height: 5px; background: #ffffff12; border-radius: 9px; overflow: hidden; margin-bottom: 6px; }
.bar span { display: block; height: 100%; width: 0; background: var(--good); border-radius: 9px; transition: width .4s, background .4s; }
.bar span.warn { background: var(--warn); }
.bar span.bad { background: var(--bad); }
.log { background: #070607; border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 10px 12px;
  font: 12px/1.5 var(--mono); color: #cfc8c0; height: 430px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.log.short { height: 260px; }
.log .t { color: #6f6761; }
.log .e { color: #ff8a7f; }
.log .w { color: #f3c470; }
.log .p { color: #8fd0ff; }
.log .c { color: #ffd27a; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px solid #ffffff0a; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn { margin-left: 4px; }
.table select { padding: 5px 8px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hp { display: inline-block; width: 70px; height: 6px; background: #ffffff14; border-radius: 6px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.hp span { display: block; height: 100%; background: var(--good); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: #ffffff12; color: var(--muted); }
.tag.good { background: #4fc26b22; color: var(--good); }
.tag.warn { background: #e8a83a22; color: var(--warn); }
.tag.red { background: #db1f1a22; color: #ff8a7f; }

/* ---------- updates ---------- */
.drop { display: block; position: relative; border: 2px dashed #463e42; border-radius: 12px; padding: 34px 20px; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--red); background: #db1f1a0d; color: var(--text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { color: var(--text); }
.progress { height: 8px; background: #ffffff12; border-radius: 9px; overflow: hidden; margin: 14px auto 0; max-width: 420px; }
.progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.warn { background: #e8a83a18; border: 1px solid #e8a83a55; color: #f3c470; border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv span { color: var(--muted); }

/* ---------- settings ---------- */
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 600; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
.field.toggle { flex-direction: row; align-items: center; justify-content: space-between; background: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; }
.field.toggle small { display: block; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #3a3337; border-radius: 22px; cursor: pointer; transition: background .15s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + i { background: var(--red); }
.switch input:checked + i::after { transform: translateX(18px); }

/* ---------- account ---------- */
.steps { padding-left: 18px; color: var(--muted); }
.steps li { margin-bottom: 8px; }
.secret { font: 600 16px/1.4 var(--mono); letter-spacing: 1.5px; color: var(--text); background: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; margin-top: 6px; user-select: all; word-break: break-all; }
#pw-form .field { margin-bottom: 12px; }

/* ---------- modal & toasts ---------- */
.modal { position: fixed; inset: 0; background: #000b; display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: 100%; max-width: 440px; box-shadow: 0 30px 80px #000; }
.modal-card .row.end { margin-top: 18px; }
#modal-body { color: var(--muted); }
#modal-body input { width: 100%; margin-top: 10px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 8px; padding: 11px 14px;
  box-shadow: 0 10px 30px #000a; animation: slide .2s ease-out; white-space: pre-wrap; }
.toast.err { border-left-color: var(--bad); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

/* ---------- small screens ---------- */
@media (max-width: 1100px) { .meters { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
  .side .brand { padding: 0; }
  nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; min-width: 0; }
  nav a { white-space: nowrap; padding: 7px 10px; }
  nav a.on { box-shadow: inset 0 -2px 0 var(--red); }
  .side-foot { margin: 0 0 0 auto; border: none; padding: 0; }
  main { padding: 14px; }
  .two, .fields { grid-template-columns: 1fr; }
  .meters { grid-template-columns: repeat(2, 1fr); }
  .table { font-size: 13px; display: block; overflow-x: auto; }
  .hero-buttons .btn { flex: 1; }
  .table td, .table th { padding: 7px 6px; }
}
