:root {
  --ink: #111111;
  --forest: #12205a;
  --pine: #1a2d7a;
  --leaf: #00aeef;
  --brass: #00aeef;
  --brass-deep: #008dc0;
  --cream: #f5f8fc;
  --paper: #ffffff;
  --sand: #e6eef6;
  --line: #c9d6e6;
  --muted: #4a5568;
  --soft: #7a8799;
  --ok: #0d6e4f;
  --ok-bg: #e5f3ea;
  --wait: #8a5a12;
  --wait-bg: #f8ecd4;
  --no: #9b2c1f;
  --no-bg: #f8e6e3;
  --shadow: 0 18px 50px rgba(18, 32, 90, 0.12);
  --radius: 22px;
  --font: "Outfit", sans-serif;
  --display: "Outfit", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(0, 174, 239, 0.1), transparent 50%),
    radial-gradient(900px 420px at -10% 20%, rgba(18, 32, 90, 0.08), transparent 45%),
    var(--cream);
  line-height: 1.5;
  min-height: 100vh;
}

img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo {
  height: 44px;
  width: auto;
  display: block;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--forest);
  color: #f6e7c4;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(246, 231, 196, 0.2);
}

.brand-copy strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
}

.nav a[aria-current="page"],
.nav a:hover { color: var(--ink); background: rgba(255, 253, 247, 0.8); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 560;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--forest); color: #ffffff; }
.btn-brass { background: var(--brass); color: #041018; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-ok { background: var(--ok); color: white; }
.btn-no { background: var(--no-bg); color: var(--no); }
.btn-wide { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

.hero {
  padding: 54px 0 28px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brass-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker i {
  width: 22px;
  height: 1px;
  background: var(--brass);
  display: inline-block;
}

h1, h2, h3, .display { font-family: var(--display); font-weight: 560; letter-spacing: -0.03em; }
h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.02; margin: 14px 0 16px; }
h1 em { font-style: italic; color: var(--pine); }
.lead { font-size: 18px; color: var(--muted); max-width: 48ch; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.trust { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; color: var(--muted); font-size: 13px; }
.trust b { color: var(--ink); font-weight: 600; }

.pass {
  background: var(--paper);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(216, 207, 190, 0.8);
}

.pass-top {
  background: var(--forest);
  color: #f6eedd;
  padding: 22px 24px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.pass-top small { color: #c9d5ce; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }
.pass-top strong { display: block; font-family: var(--display); font-size: 24px; margin-top: 4px; }
.pass-body { padding: 22px 24px 26px; display: grid; grid-template-columns: 1fr 150px; gap: 18px; align-items: center; }
.meta { display: grid; gap: 10px; }
.meta p { margin: 0; }
.meta span { display: block; color: var(--soft); font-size: 12px; }
.qr-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  display: grid;
  place-items: center;
}
.qr-box canvas, .qr-box img, .qr-box table { width: 128px; height: 128px; }
.qr-card .qr-box { width: 168px; height: 168px; margin: 4px 0; padding: 8px; }
.qr-card .qr-box canvas, .qr-card .qr-box img { width: 168px; height: 168px; }

.section { padding: 34px 0 10px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.section-head h2 { font-size: 34px; margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 210px;
}
.num {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e8f6fd;
  color: var(--brass-deep);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 20px;
  margin-bottom: 16px;
}
.step h3 { margin: 0 0 8px; font-size: 24px; }
.step p { margin: 0; color: var(--muted); }

.routes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.route {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.route:hover { transform: translateY(-3px); border-color: var(--brass); }
.route b { font-family: var(--display); font-size: 20px; line-height: 1.15; }
.route span { color: var(--muted); font-size: 13px; }
.route em { margin-top: auto; font-style: normal; color: var(--brass-deep); font-size: 12px; font-weight: 600; }

.note {
  margin: 28px 0 48px;
  padding: 18px 20px;
  border-radius: 16px;
  background: #e8f6fd;
  color: #4d4330;
  font-size: 14px;
}

.site-foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.page { padding: 28px 0 64px; }
.form-card, .panel-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.form-card { width: min(720px, 100%); margin: 0 auto; overflow: hidden; }
.form-hero {
  background: #ffffff;
  color: var(--ink);
  padding: 28px;
  text-align: center;
}
.form-hero h1 { font-size: 28px; margin: 10px 0 8px; color: var(--forest); }
.form-hero p { margin: 16px 0 0; color: var(--muted); }
.form-logo {
  display: block;
  width: min(280px, 80%);
  margin: 0 auto;
}
.form-hero .form-logo {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.page-banner {
  text-align: center;
  margin: 0 0 22px;
}
.page-banner h1 {
  font-size: clamp(26px, 5vw, 36px);
  margin: 0;
  color: var(--forest);
}
.form-body { padding: 26px 28px 30px; border-top: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; }
.choice {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.choice-item {
  margin: 0;
}
.choice-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-item span {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.choice-item input:checked + span {
  background: var(--forest);
  border-color: var(--forest);
  color: #f7f1e4;
}
.choice-item input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(60, 125, 98, 0.12);
}
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}
.field textarea {
  display: block;
  width: 100%;
  resize: none;
  overflow: hidden;
  min-height: 96px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(60, 125, 98, 0.12);
}
.help { color: var(--soft); font-size: 12px; }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 18px;
}
.check input { margin-top: 4px; }

.success {
  width: min(640px, 100%);
  margin: 20px auto 0;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 42px 28px;
  box-shadow: var(--shadow);
}
.stamp {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  display: grid;
  place-items: center;
  font-size: 34px;
}
.success h1 { font-size: 40px; margin: 0 0 10px; }
.success p { color: var(--muted); }
.success-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.admin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #ece6d8;
}

.side {
  background: var(--ink);
  color: #e8e0d0;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.side .brand-copy strong { color: #fffdf7; }
.side .brand-copy span { color: #b7c2bb; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav button, .side-nav a {
  text-align: left;
  background: transparent;
  color: #c9d2cc;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  text-decoration: none;
}
.side-nav button.is-on, .side-nav a.is-on, .side-nav button:hover, .side-nav a:hover {
  background: rgba(255, 253, 247, 0.08);
  color: #fffdf7;
}
.side-foot { margin-top: auto; font-size: 12px; color: #8d9993; }

.main { padding: 22px 22px 40px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.admin-top h1 { font-size: 34px; margin: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.pill.is-on { background: var(--ink); color: #f7f1e4; border-color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
}
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-family: var(--display); font-size: 32px; margin-top: 4px; }

.table-wrap, .stack { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--sand); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; background: #faf6ec; }
tr:last-child td { border-bottom: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
}
.chip-pending { background: var(--wait-bg); color: var(--wait); }
.chip-approved { background: var(--ok-bg); color: var(--ok); }
.chip-rejected { background: var(--no-bg); color: var(--no); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-list { display: grid; gap: 12px; }
.person {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.person h3 { margin: 0 0 4px; font-size: 22px; }
.person p { margin: 0; color: var(--muted); font-size: 14px; }

.qr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.qr-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qr-card h3 { margin: 0; font-size: 24px; }
.qr-card canvas { width: 180px !important; height: 180px !important; background: white; border-radius: 12px; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(440px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 36px; margin: 10px 0 8px; }
.hidden { display: none !important; }
.demo-banner {
  background: #e8f6fd;
  color: #4d4330;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #f7f1e4;
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 50;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 36, 30, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}
.modal-card {
  width: min(480px, 100%);
  background: var(--paper);
  border-radius: 22px;
  padding: 22px;
}
.view { display: none; }
.view.is-on { display: block; }

.poster {
  width: min(560px, 100%);
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.poster h1 { font-size: 28px; margin: 8px 0 8px; color: var(--forest); }
.poster-qr {
  width: 280px;
  height: 280px;
  margin: 22px auto 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  place-items: center;
  padding: 16px;
}
.poster-qr canvas,
.poster-qr img {
  width: 248px !important;
  height: 248px !important;
}
.poster-url {
  word-break: break-all;
  font-size: 13px;
  color: var(--muted);
  background: #eef5fb;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 16px;
}

#exitTimeShow { cursor: pointer; background: #ffffff; }
.ios-root {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.ios-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
}
.ios-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f2f2f7;
  border-radius: 14px 14px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
.ios-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.82);
}
.ios-bar strong { font-size: 16px; }
.ios-link {
  border: 0;
  background: none;
  color: #007aff;
  font-size: 17px;
  padding: 8px 0;
  cursor: pointer;
}
.ios-link.is-strong { font-weight: 650; }
.ios-picker {
  position: relative;
  height: 216px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  background: #fff;
}
.ios-col {
  height: 216px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ios-col::-webkit-scrollbar { display: none; }
.ios-item {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 22px;
  font-weight: 400;
  color: rgba(60, 60, 67, 0.36);
}
.ios-item.is-on { color: #000; font-weight: 510; }
.ios-pad { height: 90px; flex-shrink: 0; }
.ios-colon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -56%);
  color: #000;
  font-size: 22px;
  z-index: 3;
  pointer-events: none;
}
.ios-band {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 90px;
  height: 36px;
  border-radius: 8px;
  background: rgba(120, 120, 128, 0.16);
  pointer-events: none;
  z-index: 2;
}
.ios-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 2;
  pointer-events: none;
}
.ios-fade-top { top: 0; background: linear-gradient(#fff, rgba(255, 255, 255, 0)); }
.ios-fade-bot { bottom: 0; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }

@media (max-width: 980px) {
  .hero, .steps, .routes, .stats, .qr-grid, .pass-body, .grid-2, .admin {
    grid-template-columns: 1fr;
  }
  .routes { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .admin { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 5; }
  .side-nav { flex-direction: row; overflow: auto; }
  .side-foot { display: none; }
}

@media (max-width: 640px) {
  .wrap { width: min(1120px, calc(100% - 24px)); }
  .routes { grid-template-columns: 1fr; }
  .form-body, .form-hero { padding: 20px; }
  .person { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .side, .admin-top, .demo-banner, .row-actions, .btn, .toast { display: none !important; }
  .admin { display: block; background: white; }
  body { background: white; }
  .view { display: none !important; }
  .view.is-on { display: block !important; }
}
