:root {
  color-scheme: dark;
  --bg: #0b0d0f;
  --panel: #15191c;
  --panel-2: #1b2024;
  --line: #2b3237;
  --text: #f2f5f1;
  --muted: #98a19a;
  --green: #7ee787;
  --amber: #f2cc60;
  --red: #ff7b72;
  --blue: #79c0ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% -10%, #183127 0, transparent 36rem), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar, main { width: min(1040px, calc(100% - 32px)); margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 34px 0 20px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; letter-spacing: -.04em; }
h2 { margin-bottom: 4px; }
.eyebrow { margin-bottom: 6px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--muted); }
.hero { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(135deg, #171c1f, #111517); box-shadow: 0 25px 80px #0007; }
.status-orb { width: 18px; height: 18px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 8px #98a19a17; }
.status-orb.online { background: var(--green); box-shadow: 0 0 0 8px #7ee78718, 0 0 24px #7ee78788; }
.status-orb.busy { background: var(--amber); box-shadow: 0 0 0 8px #f2cc6018; }
.status-orb.error { background: var(--red); box-shadow: 0 0 0 8px #ff7b7218; }
.actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 20px 0; }
.action, .primary, .quiet, .danger { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--text); background: var(--panel-2); }
.action { min-height: 92px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; }
.action span { font-weight: 750; }
.action small { color: var(--muted); line-height: 1.3; }
.action:hover, .quiet:hover { border-color: #4b575f; transform: translateY(-1px); }
.primary { background: var(--green); border-color: var(--green); color: #071109; font-weight: 800; }
.warn { border-color: #5b4d25; }
.danger { background: var(--red); border-color: var(--red); color: #1b0504; font-weight: 800; }
button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.progress-card { display: flex; gap: 14px; align-items: center; padding: 16px 18px; margin-bottom: 20px; border: 1px solid #3e563f; border-radius: 14px; background: #142018; }
.progress-card p { margin: 3px 0 0; }
.spinner { width: 20px; height: 20px; border: 2px solid #ffffff30; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats article { min-height: 92px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.stats span { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 12px; }
.stats strong { overflow-wrap: anywhere; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 30px 0 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.danger-actions { display: flex; gap: 10px; }
.error { padding: 14px; border: 1px solid #67342f; background: #261311; color: #ffb4ad; border-radius: 12px; }
.hidden { display: none !important; }
dialog { width: min(520px, calc(100% - 28px)); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 30px 100px #000c; }
dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
dialog select, dialog input, .login-card input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #0c0f11; margin: 7px 0 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.check input { width: auto; margin: 3px 0 0; }
code { color: var(--amber); font-weight: 800; }
.login-page { display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 25px 80px #0008; }
.login-card form { display: grid; margin-top: 28px; }
.login-card label { margin-bottom: 7px; }

@media (max-width: 820px) {
  .actions { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .topbar, main { width: min(100% - 20px, 1040px); }
  .hero { grid-template-columns: auto 1fr; padding: 20px; }
  .refresh { grid-column: 1 / -1; }
  .actions { grid-template-columns: 1fr; }
  .action { min-height: 76px; }
  .danger-zone, .danger-actions { align-items: stretch; flex-direction: column; }
}
