:root {
  --bg: #07090d;
  --panel: #0e1218;
  --panel-2: #141a22;
  --line: #1f2733;
  --text: #e6ebf2;
  --muted: #8794a6;
  --accent: #4ea1ff;
  --up: #2ecc71;
  --up-strong: #00e676;
  --down: #ff5c5c;
  --warn: #ffb547;
  --new: rgba(78, 161, 255, .22);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel-2); border-radius: 6px; padding: 6px 12px; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .4; cursor: default; border-color: var(--line); }
button.ghost { background: transparent; }
button.small { padding: 4px 8px; font-size: 12px; }
button.on { background: var(--warn); color: #111; border-color: var(--warn); }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; min-width: 0; }
input:focus, select:focus { outline: none; border-color: var(--accent); }

.top {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--up); box-shadow: 0 0 8px var(--up); }
.dot.bad { background: var(--down); }
.status { color: var(--muted); font-size: 12px; flex: 1; min-width: 200px; }
.status b { color: var(--text); font-weight: 600; }
.top-actions { display: flex; gap: 8px; }

.notes { background: #2a2110; border-bottom: 1px solid #4a3a16; color: #ffd591; padding: 8px 16px; font-size: 12px; }
.notes p { margin: 2px 0; }

.layout { flex: 1; display: flex; min-height: 0; }
.filters { width: 320px; flex: none; border-right: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 12px; }
.filters.hidden { display: none; }
.scan-actions { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.scan-title { font-weight: 600; margin-bottom: 6px; }
.scan-title em { color: var(--warn); font-style: normal; font-weight: 400; font-size: 12px; }
.scan-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.scan-msg { margin: 6px 0 0; font-size: 12px; color: var(--muted); min-height: 1em; }
.scan-msg.err { color: var(--down); }
.scan-tabs { display: flex; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.scan-tabs button { flex: none; border-radius: 999px; padding: 5px 12px; font-size: 13px; background: transparent; color: var(--muted); }
.scan-tabs button.on { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 600; }
.scan-tabs button.add { border-style: dashed; }
.frow { display: grid; grid-template-columns: 1fr 78px 78px; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.frow span { font-size: 12px; color: var(--muted); }
.frow.head span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.frow input { width: 100%; text-align: right; }
.frow.active span:first-child { color: var(--text); }
.opts { border: 0; padding: 10px 0 0; margin: 0; display: grid; gap: 8px; }
.opts label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.opts label.check { display: flex; gap: 8px; align-items: center; }
.opts input[type=number] { width: 90px; }
.form-actions { margin-top: 12px; }
.hint { color: var(--muted); font-size: 11px; }

.board { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.board-head { display: flex; justify-content: space-between; padding: 8px 16px; font-size: 12px; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }
.table-wrap { flex: 1; overflow: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead th {
  position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: var(--muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th.l, td.l { text-align: left; }
tbody tr { border-bottom: 1px solid var(--line); transition: transform .45s ease, background-color 1.2s ease; will-change: transform; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.new { background: var(--new); }
td { padding: 7px 10px; text-align: right; white-space: nowrap; }
td.sym { font-weight: 700; }
/* the symbol stays in view while the table scrolls sideways (phones) */
td.sym, th.l { position: sticky; left: 0; background: var(--bg); }
th.l { z-index: 2; background: var(--panel-2); }
tbody tr:hover td.sym, tbody tr.new td.sym { background: var(--panel-2); }
td.sym a { color: var(--text); text-decoration: none; }
td.sym a:hover { color: var(--accent); }
td.sym small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.up { color: var(--up); }
.up.big { color: var(--up-strong); font-weight: 700; }
.down { color: var(--down); }
.hot { color: var(--warn); font-weight: 700; }
.flash-up { animation: flashUp .8s ease; }
.flash-down { animation: flashDown .8s ease; }
@keyframes flashUp { from { background: rgba(46, 204, 113, .35); } to { background: transparent; } }
@keyframes flashDown { from { background: rgba(255, 92, 92, .35); } to { background: transparent; } }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* login */
.login { margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: grid; gap: 12px; width: min(340px, calc(100% - 32px)); }
.login h1 { margin: 0; font-size: 18px; }
.login .err { color: var(--down); font-size: 12px; }

@media (max-width: 800px) {
  .top { padding: 8px 16px; gap: 8px; }
  .status { order: 3; flex-basis: 100%; }
  .filters { position: fixed; inset: 0 0 0 auto; width: min(340px, 100%); z-index: 5; box-shadow: -8px 0 24px rgba(0, 0, 0, .6); }
  .filters:not(.open) { display: none; }
  .board-head { padding: 8px 16px; }
  td, thead th { padding: 6px 8px; }
  td.sym small { display: none; }
}
@media (min-width: 801px) {
  .filters.closed { display: none; }
}
