/* Cion control plane — dark dashboard. Vanilla CSS, no build step. */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2330;
  --border: #283040;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4493f8;
  --green: #3fb950;
  --red: #f85149;
  --amber: #d29922;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); margin: 8px 0 0; font-size: 13px; }

.brand { font-size: 20px; font-weight: 700; letter-spacing: 0.3px; margin: 0; }
.brand span { color: var(--accent); font-weight: 600; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.btn:hover { background: #232c3b; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0b1220; font-weight: 600; }
.btn-primary:hover { background: #5aa0fb; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #1a0c0c; font-weight: 600; }
.btn-danger:hover { background: #ff6258; }
.btn-warn { background: var(--amber); border-color: var(--amber); color: #1a1405; font-weight: 600; }
.btn-warn:hover { background: #e8ad33; }
.btn-sm { padding: 4px 9px; font-size: 12px; }

/* Login -------------------------------------------------------------------- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 340px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-card h1 { margin-bottom: 2px; }
.login-card input {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

/* Topbar ------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.pill {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

main { padding: 20px 24px 60px; max-width: 1320px; margin: 0 auto; }
.section-title { font-size: 15px; color: var(--muted); margin: 24px 0 10px; text-transform: uppercase; letter-spacing: 0.6px; }

/* Tables ------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.audit-wrap { max-height: 360px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 11px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #1a2230; }
.empty { text-align: center; color: var(--muted); padding: 22px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* Status dot --------------------------------------------------------------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot-online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-offline { background: var(--red); }
.status-cell { white-space: nowrap; }

/* Directive + seat badges -------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-run { background: rgba(63,185,80,0.16); color: var(--green); }
.badge-deactivate { background: rgba(210,153,34,0.16); color: var(--amber); }
.badge-wipe { background: rgba(248,81,73,0.16); color: var(--red); }
.badge-mode { background: rgba(68,147,248,0.16); color: var(--accent); }

.seats-over { color: var(--red); font-weight: 600; }
.days-warn { color: var(--amber); }
.days-bad { color: var(--red); font-weight: 600; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions-col { width: 1%; white-space: nowrap; }

/* Modal -------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 440px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 10px; font-size: 17px; }
.modal-body { color: var(--text); line-height: 1.5; margin: 0 0 18px; }
.modal-body strong { color: var(--red); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
