:root {
    color-scheme: light dark;
    --bg: #0d1117;
    --card: #161b22;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
    --accent: #2f81f7;
    --danger: #da3633;
    --success: #238636;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}
a { color: inherit; }
.shell { width: min(1100px, calc(100% - 28px)); margin: 36px auto; }
.shell.narrow { width: min(500px, calc(100% - 28px)); }
.shell.wide { width: min(1320px, calc(100% - 28px)); }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
}
.login-card { margin-top: 8vh; }
h1, h2 { line-height: 1.2; margin-top: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.brand-mark {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    font-weight: 800; background: var(--accent); color: white; margin-bottom: 18px;
}
label { display: block; margin: 14px 0; font-weight: 600; }
input {
    width: 100%; margin-top: 7px; padding: 12px 13px; border-radius: 10px;
    border: 1px solid var(--border); background: #0d1117; color: var(--text); font-size: 16px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.code-input { text-transform: uppercase; letter-spacing: 1px; }
button, .button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
    border: 0; border-radius: 10px; padding: 10px 15px; background: var(--accent); color: white;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.08); }
.button.secondary { background: transparent; border: 1px solid var(--border); }
.button.danger { background: var(--danger); }
.button.small, button.small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
form > button { width: 100%; margin-top: 8px; }
.actions form, .topbar form, td form { display: inline; margin: 0; }
.actions form > button, .topbar form > button, td form > button { width: auto; margin: 0; }
.notice { border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; margin: 14px 0; }
.notice.error { border-color: #f8514966; background: #f8514914; }
.notice.success { border-color: #3fb95066; background: #3fb95014; }
.code-reveal { border-color: #2f81f766; background: #2f81f712; }
.big-code { font-size: clamp(20px, 4vw, 34px); font-weight: 800; letter-spacing: 2px; margin: 8px 0; word-break: break-word; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.stats div { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.stats span { display: block; color: var(--muted); font-size: 13px; }
.stats strong { display: block; margin-top: 5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 840px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); }
.pill.ok { border-color: #3fb95066; }
.pill.off { border-color: #f8514966; }
.ua { max-width: 430px; word-break: break-word; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code { padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); }
@media (max-width: 760px) {
    .shell { margin-top: 18px; }
    .login-card { margin-top: 4vh; }
    .grid-two, .stats { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; }
}
@media (prefers-color-scheme: light) {
    :root { --bg: #f6f8fa; --card: #ffffff; --text: #1f2328; --muted: #656d76; --border: #d0d7de; }
    input { background: #ffffff; color: #1f2328; }
}
