:root {
  color-scheme: dark;
  --bg: #090b0d;
  --panel: #111519;
  --panel-raised: #171c21;
  --line: #293039;
  --muted: #8c98a4;
  --text: #f3f5f7;
  --accent: #ff6a3d;
  --accent-bright: #ff805b;
  --green: #4bd890;
  --red: #ff5864;
  --amber: #ffbf4b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 106, 61, 0.10), transparent 30rem),
    linear-gradient(180deg, #0c0f12, var(--bg) 30rem);
  color: var(--text);
}

button, input { font: inherit; }

.masthead {
  height: 68px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 13, 0.84);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 750;
}

.brand b { color: var(--muted); font-weight: 650; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #130703;
  font-weight: 950;
  clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
}

.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 191, 75, 0.12);
}

.connection.is-online .pulse {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(75, 216, 144, 0.12);
}

main, .page-footer {
  width: min(1100px, calc(100% - 40px));
  margin-inline: auto;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 64px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(34px, 6vw, 62px); line-height: 0.98; letter-spacing: -0.055em; }
.lede { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.toolbar, .actions { display: flex; gap: 10px; }

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--text);
  background: var(--panel-raised);
  cursor: pointer;
  font-weight: 720;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.button:hover { border-color: #53606d; transform: translateY(-1px); }
.button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button:disabled { cursor: wait; opacity: 0.5; transform: none; }
.button-approve { background: var(--accent); border-color: var(--accent); color: #190a05; }
.button-approve:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.button-deny { background: transparent; color: #ff9299; border-color: rgba(255, 88, 100, 0.48); }
.button-quiet { padding: 9px 12px; font-size: 13px; background: transparent; }

.message {
  border: 1px solid rgba(255, 88, 100, 0.45);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: rgba(255, 88, 100, 0.08);
  color: #ffb3b8;
}

.loading, .empty {
  min-height: 340px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.loading[hidden], .empty[hidden] { display: none; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-glyph { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(75, 216, 144, 0.35); color: var(--green); font-size: 24px; }
.empty h2 { margin: 4px 0 -8px; color: var(--text); }
.empty p { margin: 0; }

.approval-list { display: grid; gap: 18px; padding-bottom: 30px; }

.approval-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(23, 28, 33, 0.96), rgba(14, 18, 21, 0.96));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  transition: border-color 180ms ease, opacity 180ms ease;
}

.approval-card.is-approved { border-color: rgba(75, 216, 144, 0.55); }
.approval-card.is-denied { border-color: rgba(255, 88, 100, 0.55); }
.card-header, .facts, .payload-wrap, .reason-label, .actions, .card-status { margin-inline: 24px; }
.card-header { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 24px 0 20px; }
.provider { margin: 0 0 6px; color: var(--accent-bright); font: 700 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase; }
.title { margin: 0; font-size: 24px; letter-spacing: -0.025em; }
.timer { min-width: 70px; padding: 7px 10px; border-radius: 999px; background: rgba(255, 191, 75, 0.10); color: var(--amber); text-align: center; font: 750 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.timer.is-urgent { background: rgba(255, 88, 100, 0.13); color: #ff9299; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 0; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.facts div { padding: 13px 15px; background: rgba(9, 11, 13, 0.7); min-width: 0; }
.facts dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; }

.payload-wrap { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.payload-label { padding: 10px 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.payload { max-height: 310px; margin: 0; padding: 16px; overflow: auto; background: #090c0e; color: #d5dbe0; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.reason-label { display: grid; gap: 8px; margin-top: 18px; color: var(--text); font-size: 13px; font-weight: 700; }
.reason-label span { color: var(--muted); font-weight: 500; }
.reason { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #0b0e11; color: var(--text); }
.reason::placeholder { color: #65717d; }
.actions { justify-content: flex-end; padding: 18px 0 22px; }
.card-status { margin-top: -8px; margin-bottom: 20px; color: var(--muted); font-size: 13px; }

.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: #68737e; font-size: 12px; }

@media (max-width: 760px) {
  .hero { align-items: stretch; flex-direction: column; padding-top: 42px; }
  .toolbar { flex-wrap: wrap; }
  .facts { grid-template-columns: 1fr; }
  .actions { flex-direction: column-reverse; }
  .actions .button { width: 100%; }
  .page-footer { flex-direction: column; }
}
