:root {
  --bg: #0b1020; --panel: #141b2e; --panel2: #1b2541; --line: #243154;
  --text: #e8edf7; --muted: #8b9bc4; --accent: #4f7cff; --accent2: #7aa2ff;
  --ok: #2ecc71; --warn: #f1c40f; --crit: #e74c3c; --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1a2b4d 0, transparent 60%), var(--bg);
  background-color: var(--bg); color: var(--text); min-height: 100vh;
}
a { color: var(--accent2); text-decoration: none; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* layout */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: rgba(20,27,46,.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; }
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; display: block; }
nav { display: flex; gap: 4px; }
nav a { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
nav a.active, nav a:hover { background: var(--panel2); color: var(--text); }
.right { display: flex; align-items: center; gap: 14px; }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.pill .dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--muted); margin-right:7px; }
.pill.live .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
main { max-width: 1140px; margin: 0 auto; padding: 26px; }

/* cards + grid */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 32px; font-weight: 700; margin-top: 4px; }
h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 28px 0 12px; text-transform: uppercase; letter-spacing: .08em; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel2); }
.empty { color: var(--muted); padding: 28px; text-align: center; }

/* badges */
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.badge.online, .badge.done { background: rgba(46,204,113,.15); color: var(--ok); }
.badge.offline { background: rgba(139,155,196,.15); color: var(--muted); }
.badge.warning { background: rgba(241,196,15,.15); color: var(--warn); }
.badge.critical, .badge.failed, .badge.timeout { background: rgba(231,76,60,.15); color: var(--crit); }
.badge.pending, .badge.sent { background: rgba(79,124,255,.15); color: var(--accent2); }

/* forms + buttons */
button { background: var(--accent); color:#fff; border:0; padding:9px 16px; border-radius:10px; font-weight:600; cursor:pointer; font-size:13px; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 10px 12px; font-size: 14px; width: 100%;
}
label { font-size: 12px; color: var(--muted); display: block; margin: 0 0 6px; }
.row { display: flex; gap: 10px; align-items: flex-end; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 360px; }
.login-card .logo-big { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; font-size: 26px; }
.err { color: var(--crit); font-size: 13px; min-height: 18px; }

/* meters */
.meter { height: 8px; background: var(--panel2); border-radius: 999px; overflow: hidden; min-width: 90px; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter.warn > span { background: var(--warn); }
.meter.crit > span { background: var(--crit); }

/* terminal */
.term { background:#05080f; border:1px solid var(--line); border-radius:10px; padding:12px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size:12.5px; line-height:1.5;
  white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow:auto; color:#cfe3ff; }
.term .cmd { color: var(--accent2); }
.term .meta { color: var(--muted); }
.muted { color: var(--muted); }
.spark { width: 100%; height: 60px; display:block; }
.hide { display: none; }
