:root {
  --bg: #f5f6f8; --panel: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #2563eb; --accent-text: #fff; --danger: #c62828; --ok: #1b7f3b; --warn: #b26a00;
  --side: #161b26; --side-text: #c9d1e0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f131a; --panel: #171c25; --text: #e6e9ef; --muted: #9aa3b2; --line: #2a313d; --accent: #4f8cff; --side: #0b0e14; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Segoe UI", "Malgun Gothic", system-ui, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 16px 0 8px; }
a { color: var(--accent); text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 16px 0; flex-shrink: 0; }
.sidebar .brand { font-weight: 700; font-size: 16px; padding: 0 20px 16px; color: #fff; }
.sidebar a { color: var(--side-text); padding: 9px 20px; display: block; }
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 12px 20px; font-size: 12px; }
main { flex: 1; padding: 24px 28px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 180px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
textarea { min-height: 90px; }
input[type=checkbox] { display: inline; width: auto; margin: 0 6px 0 0; }
.check { display: flex; align-items: center; color: var(--text); font-size: 13px; }
button { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--danger); border-color: var(--danger); }
button.link { border: 0; background: none; color: var(--side-text); padding: 4px 0; }
button.small { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.actions { white-space: nowrap; text-align: right; }
td.actions button { margin-left: 4px; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; word-break: break-all; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--danger); } .badge.info { color: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.stat { font-size: 26px; font-weight: 700; }
.toast { position: fixed; right: 24px; top: 20px; padding: 10px 16px; border-radius: 8px; background: var(--ok); color: #fff; z-index: 10; max-width: 420px; }
.toast.err { background: var(--danger); }
.secret { background: var(--bg); border: 1px dashed var(--warn); padding: 10px; border-radius: 6px; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; }
.login-card button { width: 100%; margin-top: 6px; }
.banner { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--warn); color: var(--warn); margin-bottom: 16px; }
.pager { margin-top: 10px; text-align: right; }
@media (max-width: 760px) { .layout { flex-direction: column; } .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; } .sidebar-foot { margin: 0; } main { padding: 16px; } }
