:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #657089;
  --line: #dfe5ee;
  --primary: #2065d1;
  --primary-dark: #174da3;
  --danger: #c73d4a;
  --success: #1f8a5b;
  --warning: #bd741d;
  --radius: 8px;
  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: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 248px;
  padding: 22px 16px;
  background: #101828;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  color: #cbd5e1;
  padding: 11px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.nav-link:hover,
.nav-link.is-active {
  color: white;
  background: #1f2a44;
}

.main {
  flex: 1;
  width: 100%;
  padding: 28px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.page-head h1,
.login-panel h1,
.public-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
.login-panel,
.public-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .06);
}

.metric {
  padding: 18px;
  min-height: 120px;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 34px;
}

.panel {
  padding: 18px;
  overflow-x: auto;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid h2,
.span,
.form-grid button,
.form-grid .muted {
  grid-column: 1 / -1;
}

.stack {
  display: grid;
  gap: 14px;
}

.field,
.inline-form label,
.filters {
  display: grid;
  gap: 7px;
}

.field span,
.inline-form span {
  color: #2d3748;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cad3df;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  padding: 9px 11px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

button,
.small {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.small:hover {
  background: var(--primary-dark);
}

.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.ghost {
  background: #eef3fb;
  color: var(--primary);
}

.ghost:hover {
  background: #dce9fb;
}

.danger {
  background: #fff1f2;
  color: var(--danger);
}

.danger:hover {
  background: #ffe1e4;
}

.full {
  width: 100%;
}

.inline-form,
.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.filters {
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, .7fr) minmax(160px, .8fr) auto;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.table-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
  color: var(--muted);
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td small,
td code {
  display: block;
  margin-top: 5px;
}

code {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 2px 5px;
  color: #24324b;
  word-break: break-word;
}

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

.actions form {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge-active,
.badge-confirmed {
  background: #e8f7ef;
  color: var(--success);
}

.badge-review {
  background: #fff4df;
  color: var(--warning);
}

.badge-canceled,
.badge-invalid,
.badge-disabled {
  background: #f2f4f7;
  color: #667085;
}

.badge-archived {
  background: #eef2ff;
  color: #4751a3;
}

.notice {
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 700;
}

.notice.error {
  background: #fff1f2;
  color: var(--danger);
}

.notice.success {
  background: #e8f7ef;
  color: var(--success);
}

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

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px minmax(100px, 1fr) 130px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.bar-row div {
  height: 10px;
  background: #e8edf5;
  border-radius: 999px;
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  min-width: 6px;
  background: var(--primary);
  border-radius: 999px;
}

.login-panel,
.public-card {
  width: min(460px, calc(100vw - 32px));
  margin: 9vh auto;
  padding: 28px;
}

.public-card {
  width: min(560px, calc(100vw - 32px));
}

.public-brand {
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 900;
  color: var(--primary);
}

.lead {
  color: var(--muted);
  line-height: 1.55;
}

.instruction {
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
  background: #f6f9fe;
  color: #344054;
  border-radius: 4px;
  line-height: 1.5;
}

.status-card {
  text-align: center;
}

.big-status {
  border-radius: var(--radius);
  padding: 24px;
  font-size: 28px;
  font-weight: 900;
}

.big-status.review {
  background: #fff4df;
  color: var(--warning);
}

.big-status.confirmed {
  background: #e8f7ef;
  color: var(--success);
}

.big-status.invalid {
  background: #f2f4f7;
  color: #667085;
}

.big-status.canceled {
  background: #fff1f2;
  color: var(--danger);
}

.status-description {
  margin: 16px auto 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.55;
}

.countdown-note {
  margin: 18px auto 0;
  max-width: 430px;
  padding: 12px 14px;
  border: 1px solid #ffd6dc;
  border-radius: 6px;
  background: #fff7f8;
  color: #8f2e3a;
  font-weight: 800;
  line-height: 1.45;
}

.countdown-note span {
  display: inline-block;
  min-width: 2ch;
  color: var(--danger);
}

.public-view {
  min-height: 100vh;
  overflow-x: hidden;
  background: #0b0f14;
  color: #f8fafc;
}

.public-view::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 20% 18%, rgba(34, 197, 94, .16), transparent 28%),
    radial-gradient(circle at 78% 72%, rgba(16, 185, 129, .12), transparent 32%),
    linear-gradient(180deg, #0b0f14 0%, #0f1722 55%, #080b10 100%);
}

.public-view::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(248, 250, 252, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 250, 252, .025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), rgba(0,0,0,.25));
}

.public-view .app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.public-view .main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.code-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.public-view .public-card {
  position: relative;
  width: min(540px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, .28);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(17, 24, 39, .96), rgba(8, 13, 20, .94)),
    #111827;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, .48),
    0 0 0 1px rgba(255, 255, 255, .035) inset,
    0 0 42px rgba(22, 163, 74, .12);
  backdrop-filter: blur(14px);
}

.public-view .public-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(34, 197, 94, .16), transparent 38%, rgba(16, 185, 129, .1)),
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 34%);
}

.public-view .public-card > * {
  position: relative;
  z-index: 1;
}

.public-view .public-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: #22c55e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(34, 197, 94, .45);
}

.public-view .public-brand::before {
  content: ">";
  color: #16a34a;
}

.public-view .eyebrow {
  color: #86efac;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.public-view .public-card h1 {
  color: #f8fafc;
  font-size: 34px;
  letter-spacing: 0;
}

.public-view .lead {
  color: #cbd5e1;
}

.public-view .field span {
  color: #bbf7d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.public-view input {
  min-height: 48px;
  border: 1px solid rgba(34, 197, 94, .22);
  background: rgba(3, 7, 18, .7);
  color: #f8fafc;
  caret-color: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}

.public-view input:hover,
.public-view input:focus {
  outline: none;
  border-color: #22c55e;
  background: rgba(2, 6, 14, .9);
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, .13),
    0 0 24px rgba(34, 197, 94, .2);
}

.public-view .instruction {
  border-left-color: #22c55e;
  background: rgba(3, 7, 18, .46);
  color: #d1fae5;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .12) inset;
}

.public-view button {
  min-height: 50px;
  border: 1px solid rgba(187, 247, 208, .2);
  background: linear-gradient(135deg, #16a34a, #10b981);
  color: #f8fafc;
  box-shadow: 0 14px 30px rgba(22, 163, 74, .26);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.public-view button:hover {
  background: linear-gradient(135deg, #22c55e, #10b981);
  box-shadow: 0 18px 38px rgba(34, 197, 94, .34);
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.public-view .big-status {
  border: 1px solid rgba(34, 197, 94, .25);
  background: rgba(3, 7, 18, .62);
  color: #f8fafc;
  box-shadow: 0 0 28px rgba(34, 197, 94, .14) inset;
}

.public-view .big-status.review {
  color: #facc15;
  border-color: rgba(250, 204, 21, .25);
  box-shadow: 0 0 28px rgba(250, 204, 21, .1) inset;
}

.public-view .big-status.confirmed {
  color: #22c55e;
}

.public-view .big-status.canceled,
.public-view .big-status.invalid {
  color: #fb7185;
  border-color: rgba(251, 113, 133, .28);
  box-shadow: 0 0 28px rgba(251, 113, 133, .1) inset;
}

.public-view .status-description {
  color: #cbd5e1;
}

.public-view .countdown-note {
  border-color: rgba(251, 113, 133, .26);
  background: rgba(3, 7, 18, .52);
  color: #fecdd3;
}

.public-view .countdown-note span {
  color: #fb7185;
}

.report-preview {
  white-space: pre-wrap;
  font: 16px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metrics,
  .grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .main {
    padding: 16px;
  }

  .sidebar nav,
  .metrics,
  .grid.two,
  .form-grid,
  .inline-form,
  .filters {
    grid-template-columns: 1fr;
  }

  .page-head h1,
  .login-panel h1,
  .public-card h1 {
    font-size: 26px;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .big-status {
    font-size: 23px;
  }
}
