:root {
  --bg: #f4f6f9; --card: #fff; --text: #1d2733; --muted: #6b7684; --line: #dfe4ea;
  --accent: #1d5fd1; --danger: #c62828; --ok: #1b7f3b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
h1, h2, h3, h4 { margin: 0 0 8px; }
h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; margin-top: 12px; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
input, textarea, select, button {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff;
}
textarea { width: 100%; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
label { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; font-size: 13px; color: var(--muted); }
label > input, label > textarea { color: var(--text); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
button { cursor: pointer; background: #fff; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button.small { padding: 3px 8px; font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.spacer { flex: 1; }

.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 340px; display: flex; flex-direction: column; text-align: center; }
.login-card label { text-align: left; }
.login-logo { width: 150px; margin: 4px auto 14px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 26px; height: 26px; }
:root { --accent: #8b1a1e; }
.login-card button { margin-top: 10px; }

.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#tabs { display: flex; gap: 4px; }
#tabs button { border: 0; border-radius: 6px; }
#tabs button.active { background: #fbecec; color: var(--accent); font-weight: 600; }
main { max-width: 1150px; margin: 0 auto; padding: 18px 20px 60px; }
.tab { display: none; } .tab.active { display: block; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 10px; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { background: #f7f9fb; font-size: 12px; color: var(--muted); font-weight: 600; }
table.grid tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.badge.on { background: #e6f4ea; color: var(--ok); } .badge.off { background: #fdeaea; color: var(--danger); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; }
.features label { margin: 2px 0; }
.features small { color: var(--muted); }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(640px, 95vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog { padding: 18px 20px; max-height: 85vh; overflow: auto; }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1d2733; color: #fff; padding: 10px 16px; border-radius: 8px; max-width: 90vw; }
