/* LiveCore admin console.
   Dense on purpose: this is read during incidents, and scrolling to find a number is a cost. */

:root {
  --bg: #0b0f14;
  --panel: #121821;
  --panel-2: #172030;
  --line: #23303f;
  --text: #dce6f2;
  --dim: #7d8fa3;
  --dimmer: #55677a;
  --accent: #37d67a;
  --accent-dim: #1d6b40;
  --warn: #f0b429;
  --bad: #f2545b;
  --info: #4aa3f0;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 200px;
  flex: 0 0 200px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 16px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 0 18px 18px; font-weight: 600; letter-spacing: .3px;
}
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.brand small { display: block; color: var(--dimmer); font-weight: 400; font-size: 11px; letter-spacing: 0; }

.nav a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 18px; color: var(--dim); font-size: 13px;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { color: var(--text); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count { font: 11px var(--mono); color: var(--dimmer); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 18px; }

.main { flex: 1; min-width: 0; padding: 20px 24px 60px; }

.head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { font-size: 19px; margin: 0; font-weight: 600; }
.head .sub { color: var(--dimmer); font-size: 12px; }
.head .spacer { flex: 1; }

/* ---------------------------------------------------------------- panels */
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.panel > h2 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--dimmer); margin: 0 0 12px; font-weight: 600;
}
.panel.flush { padding: 0; }
.panel.flush > h2 { padding: 14px 16px 10px; margin: 0; }

.stat .v { font: 600 26px/1.1 var(--mono); letter-spacing: -.5px; }
.stat .l { color: var(--dimmer); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; }
.stat .n { color: var(--dim); font-size: 12px; margin-top: 5px; }
.stat.good .v { color: var(--accent); }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--dimmer); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; background: var(--panel);
}
td { padding: 9px 12px; border-bottom: 1px solid rgba(35,48,63,.55); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.mono { font-family: var(--mono); font-size: 12px; }
.empty { padding: 26px 16px; color: var(--dimmer); text-align: center; font-size: 13px; }

/* ---------------------------------------------------------------- bits */
.tag {
  display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px;
  font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.tag.active { background: rgba(55,214,122,.14); color: var(--accent); }
.tag.suspended { background: rgba(240,180,41,.14); color: var(--warn); }
.tag.deleted { background: rgba(242,84,91,.13); color: var(--bad); }
.tag.retiring { background: rgba(74,163,240,.14); color: var(--info); }
.tag.neutral { background: var(--panel-2); color: var(--dim); }

.dot-s { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot-s.up { background: var(--accent); }
.dot-s.down { background: var(--bad); }
.dot-s.idle { background: var(--dimmer); }

button, .btn {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--dim); text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent-dim); border-color: var(--accent-dim); color: #eafff2; }
button.primary:hover { background: #23814e; }
button.danger { color: var(--bad); border-color: rgba(242,84,91,.35); }
button.danger:hover { background: rgba(242,84,91,.1); }
button.sm { padding: 3px 8px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

input, select, textarea {
  font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--info); }
label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--dimmer); margin-bottom: 5px; }
.field { margin-bottom: 13px; }
.hint { color: var(--dimmer); font-size: 11.5px; margin-top: 5px; line-height: 1.4; }

.bar { height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 7px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--bad); }

pre.creds {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 12px; font: 12px/1.6 var(--mono); overflow-x: auto; margin: 0;
  user-select: all; white-space: pre; color: var(--text);
}
.note {
  border-left: 2px solid var(--warn); background: rgba(240,180,41,.07);
  padding: 9px 12px; font-size: 12.5px; color: var(--dim); border-radius: 0 5px 5px 0;
}
.note.bad { border-color: var(--bad); background: rgba(242,84,91,.07); }
.note.ok { border-color: var(--accent); background: rgba(55,214,122,.06); }

/* ---------------------------------------------------------------- modal */
.mask {
  position: fixed; inset: 0; background: rgba(4,7,11,.72);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 4px; font-size: 16px; }
.modal .sub { color: var(--dimmer); font-size: 12.5px; margin-bottom: 16px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 10px 14px; font-size: 13px; max-width: 380px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.toast.err { border-left-color: var(--bad); }

/* ---------------------------------------------------------------- login */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login .panel { width: 100%; max-width: 340px; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: 120px; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .b { fill: var(--accent-dim); }
.chart .b:hover { fill: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--dimmer); margin-top: 8px; flex-wrap: wrap; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button {
  border: none; background: none; border-bottom: 2px solid transparent;
  border-radius: 0; color: var(--dim); padding: 8px 13px;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex: none; height: auto; position: static; padding: 10px 0; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav .sep { display: none; }
  .main { padding: 14px; }
}
