/* GigPilot operator dashboard — Python-rendered (no Node build step).
 *
 * Hand-written CSS served as a static file: the dashboard has no bundler, no Tailwind, and no
 * generated utility classes, so a venue value can never land in a class attribute by accident.
 */

:root {
  --bg: #0b0d10;
  --panel: #161b22;
  --panel-2: #0f1319;
  --border: #30363d;
  --border-soft: #21262d;
  --fg: #e6edf3;
  --muted: #8b949e;
  --pos: #7ee787;
  --neg: #ff7b72;
  --warn: #e3b341;
  --accent: #58a6ff;
  --armed: #0d3a1e;
  --disarmed: #3a0d0d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

a { color: var(--accent); }

.wrap { max-width: 1700px; margin: 0 auto; padding: 14px 16px 48px; }

/* ---------------------------------------------------------------- header */

header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

header.top h1 { margin: 0; font-size: 15px; color: var(--pos); letter-spacing: .4px; }

.top .spacer { flex: 1 1 auto; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}

.badge.armed { background: var(--armed); color: var(--pos); }
.badge.disarmed { background: var(--disarmed); color: var(--neg); }
.badge.unknown { background: #22262c; color: var(--muted); }

.hosttag { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- buttons */

button {
  background: #21262d;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font: inherit;
  cursor: pointer;
}

button:hover { background: #30363d; }
button:disabled { opacity: .5; cursor: not-allowed; }

button.primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
button.primary:hover { background: #2d7ff9; }
button.kill { background: #3d1216; border-color: var(--neg); color: var(--neg); }
button.kill:hover { background: #55191f; }

/* ---------------------------------------------------------------- panels */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.card > .k {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 4px;
}

.card > .v { font-size: 18px; font-weight: 700; }

section { margin-top: 14px; }

section > h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 600;
}

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 500; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }

.tablewrap { overflow-x: auto; }

/* ---------------------------------------------------------------- L2 bar */

.l2bar {
  position: relative;
  height: 22px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.l2bar > .fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1f6feb, #58a6ff);
  transition: width .4s ease;
}

.l2bar.ready > .fill { background: linear-gradient(90deg, #238636, #7ee787); }

.l2bar > .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}

.l2legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 6px; }

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  padding: 18px;
}

.modal h3 { margin: 0 0 4px; font-size: 14px; }
.modal p.hint { color: var(--muted); font-size: 11px; margin: 0 0 14px; line-height: 1.6; }

.field { margin-bottom: 12px; }
.field label { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }

.inputrow { display: flex; gap: 6px; }

input[type="password"], input[type="text"] {
  flex: 1 1 auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  padding: 8px 10px;
  font: inherit;
  min-width: 0;
}

input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

.reveal { padding: 8px 10px; font-size: 11px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.notice {
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  margin-bottom: 12px;
}

.notice.error { background: #3d1216; border: 1px solid var(--neg); color: #ffb3ae; }
.notice.info { background: #152238; border: 1px solid #1f6feb; color: #a9cdff; }
.notice[hidden] { display: none; }

/* ---------------------------------------------------------------- login */

.login-shell { display: flex; align-items: center; justify-content: center; min-height: 92vh; }
.login-card { width: 100%; max-width: 420px; }
.login-card .card { padding: 22px; }
.login-card h1 { font-size: 16px; margin: 0 0 4px; color: var(--pos); }
.login-card .sub { color: var(--muted); font-size: 11px; margin: 0 0 18px; line-height: 1.6; }
.login-actions { display: flex; gap: 8px; margin-top: 16px; }
.login-actions button { flex: 1 1 0; }

footer.foot { color: var(--muted); font-size: 11px; margin-top: 22px; border-top: 1px solid var(--border); padding-top: 10px; }

[hidden] { display: none !important; }
