:root {
  --bg: #0b0f17;
  --card: #121a2a;
  --text: #e6eefc;
  --muted: #a7b3ca;
  --border: rgba(255,255,255,0.08);
  --danger: #ff5d5d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, #05060a, var(--bg));
  color: var(--text);
}

a { color: #94b9ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(5,6,10,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-right: 18px;
}

.nav a {
  margin-right: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav a:hover {
  border-color: var(--border);
  background: rgba(255,255,255,0.03);
}

.user {
  margin-right: 12px;
  color: var(--muted);
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 14px;
}

.pagehead__actions {
  display: flex;
  gap: 10px;
}

.card {
  background: rgba(18,26,42,0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { text-align: left; color: var(--muted); font-weight: 600; }

.form label { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; }

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
  margin-top: 6px;
}

textarea { resize: vertical; }

.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.btn:hover { background: rgba(255,255,255,0.09); }

.btn--ghost {
  background: transparent;
}

.btn--danger {
  border-color: rgba(255,93,93,0.5);
  color: #ffd5d5;
}

.alert {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  margin-bottom: 10px;
}

.alert--danger {
  border-color: rgba(255,93,93,0.5);
  background: rgba(255,93,93,0.08);
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.pill--approved { color: #b0ffcc; border-color: rgba(176,255,204,0.25); }
.pill--pending { color: #ffe7a6; border-color: rgba(255,231,166,0.25); }
.pill--declined { color: #ffd5d5; border-color: rgba(255,93,93,0.25); }
.pill--running { color: #a6d0ff; border-color: rgba(166,208,255,0.25); }
.pill--completed { color: #b0ffcc; border-color: rgba(176,255,204,0.25); }
.pill--needs_revision { color: #ffe7a6; border-color: rgba(255,231,166,0.25); }
.pill--ok { color: #b0ffcc; border-color: rgba(176,255,204,0.25); }
.pill--fail { color: #ffd5d5; border-color: rgba(255,93,93,0.25); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; }

.code { white-space: pre-wrap; background: rgba(0,0,0,0.25); padding: 10px; border-radius: 12px; border: 1px solid var(--border); }

.footer {
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.gate {
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 20px;
  align-items: stretch;
}

.gate__panel {
  position: relative;
  overflow: hidden;
}

.gate__panel::before {
  content: "";
  position: absolute;
  inset: -40% 40% 20% -40%;
  background: radial-gradient(circle at 30% 30%, rgba(94, 140, 255, 0.22), transparent 60%);
  pointer-events: none;
}

.gate__badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.gate__hint {
  margin-top: 12px;
  font-size: 13px;
}

.gate__panel .btn {
  width: 100%;
}

.gate__aside {
  background: linear-gradient(160deg, rgba(18,26,42,0.9), rgba(11,15,23,0.6));
}

.gate__stats {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.gate__stat {
  display: block;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

@media (max-width: 900px) {
  .gate {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 150ms ease;
  pointer-events: none;
}

.toast--show {
  opacity: 1;
  transform: translateY(0);
}
