:root {
  --ink: #07171c;
  --ink-2: #0d2a32;
  --panel: rgba(12, 38, 44, 0.72);
  --panel-solid: #0f3038;
  --line: rgba(214, 232, 228, 0.12);
  --text: #e8f2ef;
  --muted: #92aea8;
  --accent: #2bb8a8;
  --accent-2: #7ed9cf;
  --warn: #d9923a;
  --danger: #e25a4a;
  --ready: #2a6fd4;
  --done: #6b8280;
  --green: #2f9e6c;
  --font: "Figtree", system-ui, sans-serif;
  --display: "Syne", "Figtree", sans-serif;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--ink);
  line-height: 1.45;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(43, 184, 168, 0.22), transparent 60%),
    radial-gradient(700px 420px at 90% 0%, rgba(217, 146, 58, 0.16), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(42, 111, 212, 0.18), transparent 50%),
    linear-gradient(160deg, #061218 0%, #0a2229 45%, #07161b 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(232, 242, 239, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 242, 239, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  background: rgba(7, 23, 28, 0.65);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  background: linear-gradient(135deg, #1d8f84, #2a6fd4);
  box-shadow: 0 8px 24px rgba(43, 184, 168, 0.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--display); font-size: 1rem; letter-spacing: 0.01em; }
.brand-text small { color: var(--muted); font-size: 0.75rem; }
.topnav { display: flex; gap: 1rem; margin-left: 0.5rem; }
.topnav a { color: var(--muted); font-weight: 600; }
.topnav a:hover { color: var(--text); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.userchip { text-align: right; }
.userchip-role { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.userchip-name { font-weight: 600; font-size: 0.92rem; }

.bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.bell-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(226, 90, 74, 0.25);
}

.main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 1.75rem 0 3rem; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-head.compact { align-items: center; }
.page-head h1 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
  font-weight: 800;
}
.eyebrow {
  margin: 0;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}
.lede { margin: 0; color: var(--muted); max-width: 42rem; }
.back { color: var(--muted); font-size: 0.9rem; display: inline-block; margin-bottom: 0.4rem; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(43, 184, 168, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(43, 184, 168, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(43, 184, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 184, 168, 0); }
}

.btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(214, 232, 228, 0.28); }
.btn-primary {
  background: linear-gradient(135deg, #1f9e91, #2a6fd4);
  border-color: transparent;
  box-shadow: 0 10px 28px rgba(42, 111, 212, 0.28);
}
.btn-ghost { background: rgba(255,255,255,0.03); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.btn-block { width: 100%; }

.queue { display: grid; gap: 0.75rem; }
.queue-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1fr 0.9fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, background 0.25s ease, transform 0.15s ease;
}
.queue-row:hover { transform: translateY(-2px); border-color: rgba(126, 217, 207, 0.35); color: inherit; }
.queue-row.is-ready {
  background: linear-gradient(120deg, rgba(42, 111, 212, 0.28), rgba(12, 38, 44, 0.7));
  border-color: rgba(42, 111, 212, 0.5);
}
.queue-row.is-paid {
  background: linear-gradient(120deg, rgba(47, 158, 108, 0.28), rgba(12, 38, 44, 0.7));
  border-color: rgba(47, 158, 108, 0.5);
}
.queue-client strong { display: block; font-size: 1.05rem; }
.queue-client span, .queue-state, .meta { color: var(--muted); font-size: 0.88rem; }
.queue-timer { display: flex; align-items: center; gap: 0.5rem; }
.timer-value, .session-timer, .mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.timer-value { font-size: 1.25rem; font-weight: 700; }
.session-timer { margin: 0; font-size: 2.4rem; font-weight: 750; letter-spacing: -0.02em; }
.timer-value.is-critical, .session-timer.is-critical, .queue-timer.is-critical .timer-value {
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-danger { color: #ffc5bf; border-color: rgba(226, 90, 74, 0.45); background: rgba(226, 90, 74, 0.15); }
.badge-warn { color: #ffd7a8; border-color: rgba(217, 146, 58, 0.45); background: rgba(217, 146, 58, 0.15); }
.badge-ready { color: #cfe0ff; border-color: rgba(42, 111, 212, 0.45); background: rgba(42, 111, 212, 0.18); }
.badge-paid { color: #c8f0d8; border-color: rgba(47, 158, 108, 0.45); background: rgba(47, 158, 108, 0.18); }
.badge-muted { color: var(--muted); }

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  width: 100%;
}
.bar.wide { height: 10px; min-width: 160px; }
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ready));
  transition: width 0.45s ease;
}
.queue-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.client-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  padding: 1.25rem 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  transition: background 0.35s ease, border-color 0.35s ease;
}
.client-card.is-ready {
  background: linear-gradient(145deg, rgba(42, 111, 212, 0.34), rgba(12, 38, 44, 0.85));
  border-color: rgba(126, 180, 255, 0.45);
}
.client-card.is-paid {
  background: linear-gradient(145deg, rgba(47, 158, 108, 0.34), rgba(12, 38, 44, 0.85));
  border-color: rgba(126, 220, 170, 0.45);
}
.client-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}
.label { margin: 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.ready-flag {
  font-family: var(--display);
  font-weight: 750;
  font-size: 1.15rem;
  color: #d7e8ff;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: rgba(42, 111, 212, 0.35);
  border: 1px solid rgba(126, 180, 255, 0.4);
  animation: fadeUp 0.45s ease;
}
.paid-flag {
  font-family: var(--display);
  font-weight: 750;
  font-size: 1.15rem;
  color: #d8ffe8;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: rgba(47, 158, 108, 0.35);
  border: 1px solid rgba(126, 220, 170, 0.45);
  animation: fadeUp 0.45s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.progress-ring { display: grid; gap: 0.35rem; justify-items: end; min-width: 180px; }

.split {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  gap: 1.25rem;
}
.split h2, .timeline h2 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 1.05rem;
}

.blocks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.blocks-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.blocks-table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(214, 232, 228, 0.08);
  vertical-align: top;
}
.blocks-table small { display: block; color: var(--muted); margin-top: 0.2rem; }
.block-row { transition: background 0.25s ease, opacity 0.25s ease; }
.block-row.color-green { background: rgba(47, 158, 108, 0.08); }
.block-row.color-orange { background: rgba(217, 146, 58, 0.12); }
.block-row.color-red { background: rgba(226, 90, 74, 0.14); }
.block-row.color-red:not(.is-done) { animation: blinkSoft 1.1s ease-in-out infinite; }
@keyframes blinkSoft {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
.block-row.is-done,
.block-row.color-done {
  background: rgba(107, 130, 128, 0.12);
  color: var(--done);
}
.block-row.is-done strong,
.block-row.color-done strong {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.actions form { display: inline; }

.timeline ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.timeline li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(214, 232, 228, 0.06);
}
.timeline time { color: var(--accent-2); font-variant-numeric: tabular-nums; font-weight: 650; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.stat span { display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 0.25rem; }
.stat strong { font-family: var(--display); font-size: 1.8rem; }
.stat.accent { border-color: rgba(42, 111, 212, 0.45); }
.stat.paid { border-color: rgba(47, 158, 108, 0.45); }
.stat.danger { border-color: rgba(226, 90, 74, 0.45); }

.verifier-list { display: grid; gap: 0.85rem; }
.verifier-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.verifier-item h2 { margin: 0.2rem 0; font-family: var(--display); font-size: 1.2rem; }
.verifier-item.color-green { box-shadow: inset 4px 0 0 var(--green); }
.verifier-item.color-orange { box-shadow: inset 4px 0 0 var(--warn); }
.verifier-item.color-red { box-shadow: inset 4px 0 0 var(--danger); }
.verifier-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.sla-banner {
  position: sticky;
  top: 68px;
  z-index: 15;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(226, 90, 74, 0.92);
  color: #fff;
  font-weight: 700;
  text-align: center;
  animation: blinkBanner 0.9s ease-in-out infinite;
}
.sla-banner.is-hidden { display: none; }
@keyframes blinkBanner {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.flash-wrap { width: min(1180px, calc(100% - 2rem)); margin: 1rem auto 0; display: grid; gap: 0.5rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(43, 184, 168, 0.12);
}
.flash-error, .flash-warning { background: rgba(217, 146, 58, 0.16); }
.flash-success { background: rgba(47, 158, 108, 0.16); }

.notify-panel {
  position: fixed;
  top: 72px;
  right: 1rem;
  width: min(360px, calc(100% - 2rem));
  max-height: 70vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 30;
  padding: 0.85rem;
}
.notify-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.notify-head h2 { margin: 0; font-size: 1rem; font-family: var(--display); }
.notify-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.notify-panel li {
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(214, 232, 228, 0.08);
}
.notify-panel li.warn { border-color: rgba(217, 146, 58, 0.4); }
.notify-panel li.danger { border-color: rgba(226, 90, 74, 0.45); }
.notify-panel li small { color: var(--muted); }

.toast-stack {
  position: fixed;
  top: 84px;
  right: 1rem;
  z-index: 40;
  display: grid;
  gap: 0.5rem;
  width: min(340px, calc(100% - 2rem));
}
.toast {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(15, 48, 56, 0.95);
  border: 1px solid rgba(126, 217, 207, 0.35);
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease;
}
.toast.warn { border-color: rgba(217, 146, 58, 0.55); }
.toast.danger { border-color: rgba(226, 90, 74, 0.6); }

.empty { color: var(--muted); padding: 2rem 0; }

/* Integrations */
.head-actions { display: flex; gap: 0.5rem; align-items: center; }
.sync-meta { color: var(--muted); margin: -0.5rem 0 1.25rem; }
.integ-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.integ-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1rem 1.15rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.integ-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.1rem;
}
.integ-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.integ-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(214, 232, 228, 0.08);
}
.integ-row strong { display: block; }
.integ-row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.schedule-form p { margin: 0.5rem 0; }
.schedule-form label { color: var(--muted); font-weight: 600; }
.schedule-form input[type="number"] {
  margin-left: 0.5rem;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  width: 5rem;
}
.integ-form, .map-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.integ-form p { display: grid; gap: 0.3rem; margin: 0 0 0.85rem; }
.integ-form label { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.integ-form input, .integ-form select, .integ-form textarea,
.map-input {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  width: 100%;
}
.map-table code { color: var(--accent-2); font-size: 0.78rem; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.map-fieldset { border: 1px solid var(--line); }
.map-fieldset legend {
  padding: 0 0.4rem;
  font-family: var(--display);
  font-weight: 700;
}

@media (max-width: 900px) {
  .integ-grid { grid-template-columns: 1fr; }
}

/* Login gate */
body.gate .main { width: min(1100px, calc(100% - 2rem)); }
.gate-stage {
  min-height: calc(100vh - 4rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
}
.gate-copy h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0.4rem 0 0.8rem;
  letter-spacing: -0.03em;
}
.gate-form {
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(12, 38, 44, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.gate-form h2 { margin: 0 0 1rem; font-family: var(--display); }
.gate-form label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.gate-form input {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
}
.gate-form input:focus {
  outline: none;
  border-color: rgba(43, 184, 168, 0.7);
  box-shadow: 0 0 0 3px rgba(43, 184, 168, 0.18);
}
.form-error { color: #ffb4ab; margin: 0 0 0.75rem; }
.demo-accounts {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
.demo-accounts ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.demo-accounts code {
  color: var(--accent-2);
  background: rgba(255,255,255,0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .queue-row, .split, .stat-row, .gate-stage { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .client-card-head, .verifier-item, .page-head { flex-direction: column; align-items: flex-start; }
  .userchip { display: none; }
}
