:root {
  --bg: #0f1419; --card: #182028; --line: #2a3540; --text: #e6edf3; --muted: #8b98a5;
  --accent: #1e9688; --ok: #2ea043; --warn: #d29922; --bad: #da3633; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 8px 0 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; color: var(--muted); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pre { white-space: pre-wrap; }

header.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 2; }
header.top .brand { font-weight: 700; }
header.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
header.top nav a { padding: 6px 10px; border-radius: 8px; color: var(--text); }
header.top nav a.on { background: var(--accent); }
header.top nav a:hover { text-decoration: none; background: #23303b; }
header.top nav a.on:hover { background: var(--accent); }
header.top .logout { color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; width: 100%; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13.5px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
input, select, textarea { background: #0d1117; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn { display: inline-block; background: #21262d; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #30363d; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.warn { background: #3d2e00; border-color: var(--warn); color: #f0c040; }
.btn.bad { background: #3d0f0f; border-color: var(--bad); color: #ff7b72; }
.danger-zone { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: #1f2a36; border: 1px solid var(--line); }
.alert.ok { background: #0f2d18; border-color: var(--ok); }
.alert.bad { background: #3d0f0f; border-color: var(--bad); }
.alert.big { font-size: 16px; }
.keybox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.keybox code { font-size: 20px; letter-spacing: 1px; background: #0d1117; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.stat b { font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn b { color: var(--warn); }
.stat.bad b { color: var(--bad); }
.filters { margin-bottom: 12px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 180px; }
.filters select { width: auto; }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: 13px; background: #141b22; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: #1d2731; }
table.list tr.unseen td { font-weight: 600; }
table.list.compact td { padding: 6px 10px; font-size: 13.5px; }
@media (max-width: 760px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.list td { display: flex; gap: 8px; border: 0; padding: 4px 12px; }
  table.list td::before { content: attr(data-l); color: var(--muted); min-width: 96px; font-size: 12.5px; }
}

.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.badge.active { background: #0f2d18; color: #56d364; }
.badge.expiring { background: #3d2e00; color: #f0c040; }
.badge.expired { background: #3d0f0f; color: #ff7b72; }
.badge.disabled { background: #2a2f36; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: #21262d; }
.tag.bad { background: #3d0f0f; color: #ff7b72; }
.pill { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }
ul.checks { list-style: none; padding: 0; }
ul.checks li.ok { color: #56d364; }
ul.checks li.bad { color: #ff7b72; }
pre.log { white-space: pre-wrap; font-size: 12.5px; max-height: 520px; overflow: auto; background: #0d1117; padding: 12px; border-radius: 8px; }
.shots { display: flex; gap: 10px; flex-wrap: wrap; }
.shots img { max-width: 100%; max-height: 300px; border: 1px solid var(--line); border-radius: 6px; image-rendering: pixelated; }
