:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #263449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #2563eb;
  --accent-2: #22c55e;
  --danger: #dc2626;
  --border: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
}

.card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.card p.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 13px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); }

/* Password field with a Show/Hide toggle (js/loginForm.js) */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
button.reveal-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: auto;
  margin: 0;
  padding: 4px 10px;
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
button.reveal-btn:hover { text-decoration: underline; }

select option { background: var(--panel-2); color: var(--text); }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}

button.primary {
  background: var(--accent);
  color: white;
  width: 100%;
  margin-top: 20px;
}

button.primary:hover { background: #2563eb; }

.error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 18px; margin: 0; }
.topbar .who { color: var(--muted); font-size: 13px; }

.container { padding: 24px; max-width: 1000px; margin: 0 auto; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.panel h2 { font-size: 15px; margin: 0 0 16px; }

.new-seat-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.new-seat-form .field { flex: 1; min-width: 140px; }
.new-seat-form label { margin-top: 0; }
.new-seat-form button { white-space: nowrap; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 500; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.pending { background: rgba(148,163,184,0.15); color: var(--muted); }
.badge.registered { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.badge.online { background: rgba(34,197,94,0.15); color: var(--accent-2); }
.badge.offline { background: rgba(148,163,184,0.15); color: var(--muted); }

button.link {
  background: none;
  color: var(--danger);
  padding: 4px 8px;
}

.credential-banner {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.4);
  color: #bbf7d0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.credential-banner code {
  background: rgba(0,0,0,0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

.muted { color: var(--muted); }

a.device-link {
  color: #60a5fa;
  text-decoration: none;
}
a.device-link:hover { text-decoration: underline; }

/* ---------- Check-in (public/checkin.html, checkin-mobile.html) ---------- */

.checkin-card { max-width: 420px; }

.checkin-card .org-name { color: var(--muted); font-size: 13px; margin: 0 0 2px; }
.checkin-card h1 { margin: 0 0 20px; }

.pin-input {
  font-size: 28px;
  letter-spacing: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.notice-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.status-line {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  min-height: 16px;
  text-align: center;
}

.status-line.success { color: var(--accent-2); }
.status-line.warn { color: #f59e0b; }

video.face-preview {
  width: 100%;
  border-radius: 10px;
  background: #000;
  transform: scaleX(-1); /* mirror, so it feels like a mirror not a security cam */
  border: 1px solid var(--border);
}

.face-frame { position: relative; }
.face-frame .face-ring {
  position: absolute;
  inset: 8%;
  border: 3px solid rgba(59,130,246,0.5);
  border-radius: 50%;
  pointer-events: none;
}
.face-frame.matched .face-ring { border-color: var(--accent-2); }
.face-frame.mismatched .face-ring { border-color: var(--danger); }

button.secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 10px;
}
button.secondary:hover { background: #2b3b52; }

button.link-btn {
  background: none;
  color: #60a5fa;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  font-weight: 500;
  text-decoration: underline;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.qr-box canvas { border-radius: 8px; background: #fff; padding: 10px; }

.success-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(34,197,94,0.15);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.step { }
.step[hidden] { display: none; }

.method-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 18px; }
.method-tabs .tab-btn {
  background: none; color: var(--muted); border: none; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 8px 4px; margin-right: 20px; font-size: 14px; cursor: pointer;
}
.method-tabs .tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.method-panel { display: none; }
.method-panel.active { display: block; }

/* ---------- Typography: Fira Sans for UI text, Fira Code for tabular/data
   values (stat numbers, timestamps, IDs) — a dashboard/ops-tool pairing, not
   the system-font default, used consistently via .font-mono-data. ---------- */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

body { font-family: "Fira Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

.font-mono-data {
  font-family: "Fira Code", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- Admin shell (sidebar + topbar), public/js/adminShell.js ---------- */

.shell-section-label {
  padding: 16px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #5b6678;
  letter-spacing: 0.02em;
}

.shell-link {
  position: relative;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 8px;
  font-size: 13.5px; color: #9aa5b8; text-decoration: none; cursor: pointer; border: none;
  background: none; font-family: inherit; text-align: left;
  transition: color 150ms ease, background-color 150ms ease;
}
.shell-link:hover { color: #e7ebf3; background: #141b2e; }
.shell-link-active { color: #e7ebf3; background: rgba(37, 99, 235, 0.14); }
.shell-link-bar {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 999px; background: var(--accent);
  transition: height 150ms ease;
}
.shell-link-active .shell-link-bar { height: 16px; }

.shell-sublink {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px;
  font-size: 13px; color: #7c879c; text-decoration: none; cursor: pointer; border: none;
  background: none; font-family: inherit; text-align: left;
}
.shell-sublink:hover { color: #e7ebf3; }
.shell-sublink-active { color: var(--accent); }

.shell-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: rgba(37, 99, 235, 0.16); color: #7ea2fb;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

/* Employees list: name+avatar opens Monitoring, the small device icon opens
   Device — both live on one row so a seat's two pages are one click away
   without splitting them across the app. */
.shell-employee-row {
  display: flex; align-items: center; gap: 2px; border-radius: 8px;
}
.shell-employee-row:hover, .shell-employee-row-active { background: #141b2e; }
.shell-employee-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 14px; border-radius: 8px; text-decoration: none;
  color: #9aa5b8; font-size: 13px;
}
.shell-employee-link:hover { color: #e7ebf3; }
.shell-employee-link.shell-sublink-active { color: var(--accent); }
.shell-avatar-mini {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  background: rgba(148, 163, 184, 0.16); color: #b7c0d1;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
}
.shell-employee-icon {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; color: #5b6678;
  margin-right: 6px;
}
.shell-employee-icon:hover { color: #e7ebf3; background: #182238; }
.shell-employee-icon.shell-sublink-active { color: var(--accent); }

/* ---------- Live status dot: a real-time cue for Online/Checked-in, not
   decoration — pulses only while the state is actually live. ---------- */

.live-dot {
  position: relative;
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: currentColor;
}
.live-dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 999px;
  background: currentColor;
  animation: live-dot-pulse 1.8s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .live-dot::after { animation: none; opacity: 0; }
}
@keyframes live-dot-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ---------- Data table density + row affordance ---------- */

.data-table thead th {
  position: sticky; top: 0;
  background: var(--panel);
  z-index: 1;
}
.data-table tbody tr { transition: background-color 120ms ease; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.avatar-chip {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; color: #e7ebf3;
}
