:root {
  --primary: #f5c400;
  --primary-dark: #d9aa00;
  --accent: #111111;
  --bg: #f7f5ed;
  --card: #ffffff;
  --text: #171717;
  --muted: #68655c;
  --border: #e4dfcf;
  --success-bg: #e6f6ec; --success-fg: #1c7a43;
  --error-bg: #fdeaea;   --error-fg: #b3261e;
  --warn-bg: #fff6e5;    --warn-fg: #97631a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(17,17,17,.07), 0 2px 8px rgba(17,17,17,.04);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--primary); color: #fff; padding: .6rem 1.2rem;
}
.topbar a { color: #fff; }
.brand a { font-weight: 700; font-size: 1.1rem; }
.edition-pill {
  background: rgba(255,255,255,.18); padding: .1rem .55rem; border-radius: 999px;
  font-size: .78rem; margin-left: .5rem;
}
.mainnav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; align-items: center; }
.mainnav a {
  font-size: .875rem; font-weight: 500; letter-spacing: .01em;
  padding: .38rem .95rem; border-radius: 999px; opacity: .82;
  transition: background .18s ease, opacity .18s ease;
}
.mainnav a:hover { background: rgba(255,255,255,.14); opacity: 1; text-decoration: none; }
.mainnav a.active { background: rgba(255,255,255,.2); opacity: 1; font-weight: 600; }
.userbox {
  display: flex; align-items: center; gap: .65rem; font-size: .88rem;
  padding-left: .9rem; border-left: 1px solid rgba(255,255,255,.2);
}
.uname { opacity: .85; }
.nav-signout {
  font-size: .82rem; padding: .3rem .75rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3); opacity: .85;
  transition: background .18s ease, opacity .18s ease;
}
.nav-signout:hover { background: rgba(255,255,255,.12); opacity: 1; text-decoration: none; }
.sync-status { color: #8ee6a8; font-size: 1.1rem; line-height: 1; }
.sync-status.pending { color: var(--accent); }

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none; margin-left: auto;
  width: 40px; height: 36px; padding: 0;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  border-radius: 9px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; display: block; width: 18px; height: 2px; border-radius: 2px;
  background: #fff; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after  { position: absolute; top: 6px; }
.topbar.open .nav-toggle-bars { background: transparent; }
.topbar.open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.topbar.open .nav-toggle-bars::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: .6rem 1rem; }
  .nav-toggle { display: inline-flex; }

  /* Collapse the menu; reveal it when the bar has .open */
  .mainnav, .userbox { flex-basis: 100%; display: none; margin-left: 0; }
  .topbar.open .mainnav { display: flex; flex-direction: column; align-items: stretch; gap: .15rem; }
  .topbar.open .userbox {
    display: flex; padding-left: 0; border-left: 0;
    border-top: 1px solid rgba(255,255,255,.18); padding-top: .7rem; margin-top: .2rem;
  }

  /* Full-width tap targets in the stacked menu */
  .mainnav a { padding: .65rem .8rem; border-radius: 9px; opacity: .95; }
  .mainnav a.active::after { display: none; }   /* dot not needed when stacked */
  .userbox { gap: .8rem; }
  .uname { margin-right: auto; }                 /* push Sign out to the right */
}

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 1.5rem auto; padding: 0 1.2rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.muted { color: var(--muted); }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.stat { text-align: center; }
.stat .num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat .lbl { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.field .req { color: var(--error-fg); }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], select, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .row, .row.three { grid-template-columns: 1fr; } }
.help { color: var(--muted); font-size: .82rem; margin-top: .2rem; }

.btn {
  display: inline-block; background: var(--primary); color: #fff; border: 0;
  padding: .6rem 1.1rem; border-radius: 8px; font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:hover td { background: #fafbfd; }

/* On narrow screens, let wide tables scroll sideways inside their card
   instead of overflowing the page (keeps all columns reachable). */
@media screen and (max-width: 720px) {
  .card table {
    display: block; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .card table th, .card table td { padding: .55rem .6rem; }
}
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge.group   { background: #e8f0fb; color: var(--primary); }
.badge.solo    { background: #eef7ee; color: #2f7d32; }
.badge.visitor { background: #fdf0e6; color: #b5651d; }
.badge.pending { background: var(--warn-bg); color: var(--warn-fg); }

/* ---------- Flash & banners ---------- */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-success { background: var(--success-bg); color: var(--success-fg); }
.flash-error   { background: var(--error-bg); color: var(--error-fg); }
.flash-warn    { background: var(--warn-bg); color: var(--warn-fg); }
.offline-banner { background: var(--warn-bg); color: var(--warn-fg); padding: .6rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 380px; margin: 6vh auto; }
.auth-wrap .card { padding: 1.6rem; }
.auth-wrap h1 { margin-top: 0; }

/* ---------- Login page (centered, branded) ---------- */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.2rem 2rem 1.8rem;
  box-shadow: 0 24px 60px rgba(16, 38, 73, .18);
  animation: fadeInUp .5s cubic-bezier(.2,.7,.3,1) both;
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-logo {
  width: 66px; height: 66px; margin: 0 auto .9rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: .04em;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), #1466a8 70%, var(--accent));
  box-shadow: 0 10px 24px rgba(15, 76, 129, .35);
}
.login-card h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.01em; }
.login-sub { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }
.login-form { margin-top: .5rem; }
.btn-block { width: 100%; padding: .7rem 1rem; font-size: 1rem; margin-top: .3rem; }
.login-foot {
  text-align: center; color: var(--muted);
  font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border);
}
.demo-note {
  background: var(--warn-bg); color: var(--warn-fg);
  border: 1px solid #f0d9a8; border-radius: 10px;
  padding: .7rem .85rem; margin-bottom: 1rem; font-size: .85rem; line-height: 1.5;
}
.demo-note strong { display: block; margin-bottom: .15rem; }
.demo-note code {
  background: rgba(0,0,0,.06); padding: .05rem .35rem; border-radius: 5px;
  font-size: .85rem;
}

/* ---------- Register category picker ---------- */
.cat-picker { display: grid; gap: 1rem; grid-template-columns: repeat(3,1fr); }
@media (max-width: 720px){ .cat-picker { grid-template-columns: 1fr; } }
.cat-card { display: block; border: 2px solid var(--border); border-radius: var(--radius); padding: 1.1rem; cursor: pointer; background: #fff; }
.cat-card:hover { border-color: var(--primary); text-decoration: none; }
.cat-card h3 { margin: 0 0 .3rem; color: var(--primary); }
.cat-card p { margin: 0; color: var(--muted); font-size: .88rem; }

.reg-success { text-align:center; padding: 1.5rem; }
.reg-success .regno { font-size: 2rem; font-weight: 800; letter-spacing: .04em; color: var(--primary); margin: .4rem 0; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing:.04em; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom:.3rem; margin: 1.4rem 0 .8rem; }
.inline-actions { display:flex; gap:.5rem; flex-wrap: wrap; }
.toolbar { display:flex; gap:.6rem; align-items:center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input[type=text]{ max-width: 320px; }

/* ---------- Returning-attendee lookup ---------- */
.lookup { position: relative; }
.lookup-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; margin-top: 2px;
}
.lookup-item { padding: .5rem .7rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.lookup-item:last-child { border-bottom: 0; }
.lookup-item:hover, .lookup-item.active { background: #eef2f8; }
.lookup-item .li-name { font-weight: 600; }
.lookup-item .li-meta { font-size: .8rem; color: var(--muted); }
.lookup-empty { padding: .6rem .7rem; color: var(--muted); font-size: .88rem; }
.linked-pill { background: var(--success-bg); color: var(--success-fg); padding: .3rem .6rem; border-radius: 8px; display: inline-flex; gap: .5rem; align-items: center; }
.linked-pill button { background: none; border: 0; color: var(--success-fg); cursor: pointer; font-weight: 700; font-size: 1rem; line-height: 1; }

/* ---------- Gender section labels (Brothers / Sisters) ---------- */
.section-label {
  font-weight: 700; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin: .8rem 0 .5rem;
  padding-bottom: .3rem; border-bottom: 2px solid var(--border);
}

/* ---------- Searchable select (combobox) ---------- */
.ss { position: relative; }
.ss-input { width: 100%; padding: .55rem 2rem .55rem .65rem; }
.ss-caret { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: auto; cursor: pointer; font-size: .8rem; transition: transform .2s ease; }
.ss.open .ss-caret { transform: translateY(-50%) rotate(180deg); }
.ss-panel {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16,38,73,.14); max-height: 280px; overflow-y: auto; margin-top: 4px;
  transform-origin: top center; animation: ssDrop .16s ease;
}
.ss-item { padding: .55rem .75rem; cursor: pointer; transition: background .12s ease; }
.ss-item + .ss-item { border-top: 1px solid var(--border); }
.ss-item:hover, .ss-item.active { background: #eef3fa; }
.ss-add { color: var(--primary); font-weight: 600; }
@keyframes ssDrop { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Visual polish & animations
   ===================================================================== */
body {
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(15,76,129,.06), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, rgba(245,166,35,.06), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

/* Top bar with gradient + depth */
.topbar {
  background: linear-gradient(100deg, var(--primary-dark), var(--primary) 60%, #1466a8);
  box-shadow: 0 2px 12px rgba(11,58,99,.25);
  position: sticky; top: 0; z-index: 50;
}
.brand a { transition: opacity .2s ease; }
.brand a:hover { opacity: .85; }
.edition-pill { backdrop-filter: blur(2px); }

/* Active nav item: accent dot below the pill */
.mainnav a { position: relative; }
.mainnav a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%);
}

/* Sync dot pulse when pending */
.sync-status.pending { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Buttons: smooth hover lift + press */
.btn {
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
  box-shadow: 0 1px 2px rgba(15,76,129,.18);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,76,129,.25); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(15,76,129,.18); }
.btn.ghost, .btn.secondary { box-shadow: none; }
.btn.ghost:hover, .btn.secondary:hover { box-shadow: 0 3px 10px rgba(16,38,73,.12); }

/* Inputs: smooth focus */
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], select, textarea {
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(15,76,129,.12); }

/* Cards: entrance + hover lift on interactive ones */
.card { transition: transform .2s ease, box-shadow .2s ease; }
.card.stat:hover, .cat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16,38,73,.12); }
.cat-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }

/* Table rows hover */
tbody tr { transition: background .12s ease; }

/* Stat numbers */
.stat .num { transition: color .2s ease; }

/* ---------- Entrance animations ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.page-head { animation: fadeIn .35s ease both; }
.container > .card,
.container > form,
.container > .toolbar,
.grid > .card,
.cat-picker > .cat-card { animation: fadeInUp .45s cubic-bezier(.2,.7,.3,1) both; }

/* Stagger grid items */
.grid > .card:nth-child(1), .cat-picker > .cat-card:nth-child(1) { animation-delay: .03s; }
.grid > .card:nth-child(2), .cat-picker > .cat-card:nth-child(2) { animation-delay: .09s; }
.grid > .card:nth-child(3), .cat-picker > .cat-card:nth-child(3) { animation-delay: .15s; }
.grid > .card:nth-child(4) { animation-delay: .21s; }

.flash { animation: flashIn .3s ease both; }

/* Auth card pop */
.auth-wrap .card { animation: fadeInUp .5s cubic-bezier(.2,.7,.3,1) both; }

/* ===================== Form builder (admin) ===================== */
.fb-card {
  background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem; margin-bottom: .85rem;
}
.fb-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.fb-head .fb-type { width: auto; min-width: 150px; }
.fb-spacer { flex: 1 1 auto; }
.fb-req { display: inline-flex; align-items: center; gap: .3rem; font-weight: 500; font-size: .85rem; margin: 0; white-space: nowrap; }
.fb-req input { width: auto; }
.fb-label { font-weight: 600; margin-bottom: .5rem; }
.fb-help { font-size: .9rem; margin-bottom: .5rem; }
.fb-opts-wrap { margin-top: .3rem; padding-left: .2rem; }
.fb-opt-row { display: flex; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.fb-opt-row .fb-opt-input { flex: 1 1 auto; }
.fb-opts-wrap .btn { margin-top: .2rem; }

/* ===================== Public form page ===================== */
.form-page {
  min-height: 100vh; padding: 24px 16px 40px;
  display: flex; flex-direction: column; align-items: center;
}
.form-wrap { width: 100%; max-width: 640px; }
.form-brand { text-align: center; margin-bottom: 1rem; }
.form-brand .login-logo { margin: 0 auto; }
.form-card { padding: 1.6rem 1.5rem; animation: fadeInUp .45s cubic-bezier(.2,.7,.3,1) both; }
.form-card h1 { margin-top: 0; font-size: 1.5rem; }
.form-desc { color: var(--muted); margin: -.3rem 0 1.2rem; }
.public-form .field { margin-bottom: 1.3rem; }
.public-form label { font-weight: 600; }
.public-form .choice {
  display: flex; align-items: center; gap: .55rem; font-weight: 400;
  padding: .35rem 0; cursor: pointer;
}
.public-form .choice input { width: auto; margin: 0; }
.public-form .hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 1.2rem; }
.form-done { text-align: center; }
.form-done-mark {
  width: 60px; height: 60px; margin: .2rem auto 1rem; border-radius: 50%;
  background: var(--success-bg); color: var(--success-fg);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700;
}

/* ============= Self check-in — group bulk form ==================== */
.form-wrap-wide { max-width: 720px; }
.section-head {
  font-weight: 700; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .6rem;
}
.attendee-row {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem 1rem; margin-bottom: .6rem;
}
.ar-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .6rem;
}
.ar-opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.ar-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
@media (max-width: 600px) { .ar-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .ar-fields { grid-template-columns: 1fr; } }

/* ===================== Self check-in QR poster ===================== */
.qr-card { text-align: center; }
.qr-poster {
  display: inline-block; padding: 1.4rem 1.6rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff;
}
.qr-poster-title { font-weight: 800; font-size: 1.25rem; color: var(--primary); margin-bottom: .8rem; }
.qr-img { width: 300px; height: 300px; max-width: 80vw; image-rendering: pixelated; }
.qr-poster-cta { font-weight: 700; font-size: 1.15rem; margin-top: .8rem; }
.qr-poster-url { color: var(--muted); font-size: .9rem; margin-top: .3rem; word-break: break-all; }

/* ================= OyubiaCYF yellow + black identity ================= */
body {
  background:
    radial-gradient(900px 420px at 8% -5%, rgba(245,196,0,.16), transparent 58%),
    linear-gradient(180deg, #fbfaf6 0%, var(--bg) 100%);
}
a { color: #8a6900; font-weight: 550; }
.topbar {
  background: #111; color: #fff;
  padding: .72rem 1.25rem;
  border-bottom: 4px solid var(--primary);
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.topbar a { color: #fff; }
.brand a { color: var(--primary); font-weight: 900; letter-spacing: -.02em; }
.edition-pill { background: var(--primary); color: #111; font-weight: 800; }
.mainnav a:hover { background: rgba(245,196,0,.16); color: var(--primary); }
.mainnav a.active { background: var(--primary); color: #111; font-weight: 800; }
.nav-signout { border-color: rgba(245,196,0,.55); }
.nav-signout:hover { background: var(--primary); color: #111; }
.nav-toggle { border-color: rgba(245,196,0,.55); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { background: var(--primary); }
.container { max-width: 1120px; margin-top: 2rem; }
.page-head h1 { font-size: clamp(1.55rem, 2.5vw, 2.05rem); font-weight: 900; letter-spacing: -.035em; }
.card {
  border-color: rgba(17,17,17,.09);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}
.stat { position: relative; overflow: hidden; text-align: left; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--primary); }
.stat .num { color: #111; font-size: 2.3rem; font-weight: 900; letter-spacing: -.05em; }
.stat .lbl { color: #736d5d; font-weight: 750; }
.btn {
  background: var(--primary); color: #111;
  border: 1px solid #d7aa00;
  border-radius: 10px; font-weight: 800;
  box-shadow: 0 4px 0 #b68f00;
}
.btn:hover { background: #ffda32; color: #111; transform: translateY(-1px); box-shadow: 0 5px 0 #b68f00; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b68f00; }
.btn.secondary { background: #111; color: var(--primary); border-color: #111; box-shadow: 0 4px 0 #000; }
.btn.secondary:hover { background: #292929; color: #ffe36b; }
.btn.ghost { background: #fff; color: #302f2b; border-color: #d8d2bf; box-shadow: none; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], select, textarea {
  border: 1.5px solid #d8d2bf; border-radius: 11px;
  padding: .68rem .78rem; background: #fffefb;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245,196,0,.24);
}
th { color: #57534a; background: #f5f1e5; font-weight: 800; }
tr:hover td { background: #fff9db; }
.badge { border: 1px solid rgba(17,17,17,.1); font-weight: 750; }
.badge.group { background: #fff1a6; color: #3d3100; }
.badge.solo { background: #191919; color: #ffe162; }
.badge.visitor { background: #eee9db; color: #302d26; }
.section-title, .section-label { color: #29271f; font-weight: 900; border-color: #e0b900; }
.cat-card { border-color: #ddd5bc; border-radius: 18px; }
.cat-card:hover { border-color: var(--primary); background: #fffbea; box-shadow: 0 14px 34px rgba(17,17,17,.12); }
.login-page, .form-page {
  background:
    radial-gradient(circle at 50% 0%, rgba(245,196,0,.3), transparent 40%),
    #111;
}
.login-card, .form-card { border: 1px solid rgba(245,196,0,.45); box-shadow: 0 28px 70px rgba(0,0,0,.38); }
.login-logo {
  color: #111; background: var(--primary);
  border-radius: 18px; box-shadow: 8px 8px 0 #111, 8px 8px 0 2px var(--primary);
}
.form-foot, .login-page .login-foot { color: #c8c1ad; }
.attendee-row { background: #fffdf7; border-color: #ded5b8; }
.qr-poster { border: 3px solid #111; box-shadow: 10px 10px 0 var(--primary); }
.qr-poster-title { color: #111; font-weight: 900; }
@media (max-width: 720px) {
  .topbar.open .mainnav a.active { background: var(--primary); color: #111; }
  .container { margin-top: 1.25rem; }
}

@media print {
  /* @page margin:0 removes the browser's automatic URL header/footer line. */
  @page { margin: 0; }
  /* Print only the QR poster: hide nav, headings, flashes, and the status card. */
  .topbar, .offline-banner, .page-head, .flash,
  .grid.cols-2 > .card:not(.qr-card),
  .qr-card > h2, [data-print-hide] { display: none !important; }
  body { background: #fff; padding: 1.5cm; }
  .container { max-width: none; margin: 0; padding: 0; }
  .grid { display: block !important; gap: 0; }
  .qr-card { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .qr-poster { border: 0; margin: 0 auto; }
  .qr-poster-title { font-size: 2rem; }
  .qr-img { width: 360px; height: 360px; }
  .qr-poster-cta { font-size: 1.6rem; }
  .qr-poster-url { font-size: 1rem; color: #555; margin-top: .4rem; }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= OYAMS — blue attendance workspace ================= */
:root {
  --primary: #315ec4;
  --primary-dark: #173b86;
  --accent: #75baf2;
  --bg: #edf5fc;
  --card: #ffffff;
  --text: #121b32;
  --muted: #6b7790;
  --border: #dce6f2;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(27, 61, 119, .08);
}

body, body.app-shell {
  background: linear-gradient(135deg, #f8fbff 0%, #edf5fc 60%, #e2f0fc 100%);
  color: var(--text);
}
a { color: var(--primary); font-weight: 600; }

/* The Behance-inspired desktop rail keeps navigation visible and uncluttered. */
.app-shell .topbar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: 238px; height: 100vh; padding: 2rem 1.15rem 1.25rem;
  display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 1.6rem;
  background: linear-gradient(180deg, #dcecff 0%, #cbdff6 100%);
  color: var(--text); border: 0; border-right: 1px solid rgba(49,94,196,.08);
  box-shadow: 10px 0 35px rgba(35,75,145,.05);
}
.app-shell .brand { display: grid; gap: .7rem; padding: 0 .55rem; }
.app-shell .brand a {
  color: #173b86; font-size: 1.65rem; font-weight: 900; letter-spacing: -.055em;
}
.app-shell .brand a::before {
  content: ""; display: inline-block; width: 28px; height: 28px; margin-right: .65rem;
  vertical-align: -6px; border: 6px solid #173b86; border-radius: 9px;
  box-shadow: 9px 9px 0 -5px #75baf2;
}
.app-shell .edition-pill {
  width: fit-content; margin: 0; padding: .28rem .65rem;
  color: #244b91; background: rgba(255,255,255,.62); font-weight: 700;
}
.app-shell .mainnav {
  width: 100%; margin: 0; display: flex; flex-direction: column; align-items: stretch; gap: .35rem;
  overflow-y: auto; scrollbar-width: thin;
}
.app-shell .mainnav a {
  color: #56657f; padding: .72rem .85rem; border-radius: 10px;
  font-size: .88rem; font-weight: 650; opacity: 1;
}
.app-shell .mainnav a:hover { color: #173b86; background: rgba(255,255,255,.65); }
.app-shell .mainnav a.active {
  color: #fff; background: linear-gradient(135deg, #315ec4, #21499e);
  box-shadow: 0 8px 20px rgba(49,94,196,.25);
}
.app-shell .mainnav a.active::after { display: none; }
.app-shell .userbox {
  width: 100%; margin-top: auto; padding: .9rem .55rem 0; border: 0;
  border-top: 1px solid rgba(23,59,134,.12); color: #334563; flex-wrap: wrap;
}
.app-shell .nav-signout { color: #173b86; border-color: rgba(23,59,134,.2); background: rgba(255,255,255,.48); }
.app-shell .nav-signout:hover { color: #fff; background: #173b86; }
.app-shell .container { max-width: 1280px; margin: 0 0 0 238px; padding: 2.1rem 2.2rem 4rem; }

.page-head { margin-bottom: 1.35rem; }
.page-head h1 { color: #10182b; font-size: clamp(1.65rem, 2.6vw, 2.25rem); font-weight: 800; }
.card {
  border: 1px solid rgba(38,78,145,.12); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.35rem; background: rgba(255,255,255,.96);
}
.stat { text-align: left; min-height: 125px; }
.stat::before { inset: auto 1.25rem 1.1rem auto; width: 38px; height: 6px; border-radius: 999px; background: #b9d9f6; }
.stat:nth-child(2n)::before { background: #315ec4; }
.stat .num { color: #315ec4; font-size: 2.4rem; font-weight: 800; }
.stat .lbl { color: #778198; font-weight: 650; text-transform: none; }

.btn {
  color: #fff; background: linear-gradient(135deg, #3f6fd2, #244eab);
  border: 0; border-radius: 9px; box-shadow: 0 7px 16px rgba(49,94,196,.2); font-weight: 700;
}
.btn:hover { color: #fff; background: linear-gradient(135deg, #315ec4, #173b86); box-shadow: 0 9px 20px rgba(49,94,196,.26); }
.btn.secondary { color: #315ec4; background: #eef4ff; border: 1px solid #bfcff1; box-shadow: none; }
.btn.secondary:hover { color: #fff; background: #315ec4; }
.btn.ghost { color: #53627d; background: #fff; border: 1px solid #d6e0ed; box-shadow: none; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], select, textarea {
  border: 1px solid #cfdaea; border-radius: 10px; padding: .68rem .78rem; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #5480d9; box-shadow: 0 0 0 4px rgba(49,94,196,.12); }
th { color: #66728a; background: #f2f7fc; }
tr:hover td { background: #edf6ff; }
.badge.group { background: #e7efff; color: #2853af; }
.badge.solo { background: #e5f7ee; color: #17804c; }
.badge.visitor { background: #fff1dd; color: #aa650e; }
.cat-card { border-color: #dbe5f1; border-radius: 16px; }
.cat-card h3 { color: #234da7; }
.cat-card:hover { border-color: #6d95e2; background: #f4f8ff; box-shadow: var(--shadow); }
.section-title, .section-label { color: #263b65; border-color: #b8cbea; }
.attendee-row { background: #f8fbff; border-color: #d8e4f1; }
.qr-poster { border: 1px solid #d3dfec; box-shadow: 0 14px 35px rgba(27,61,119,.12); }
.qr-poster-title { color: #173b86; }

/* Split sign-in screen, adapted from the reference without copying its artwork. */
.login-page {
  min-height: 100vh; padding: 0; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(390px, .85fr);
  background: #f7fbff;
}
.login-showcase {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(3rem, 7vw, 7rem); color: #fff;
  background: linear-gradient(145deg, #b9dcfa 0%, #72b6ee 30%, #168bc8 68%, #15529c 100%);
}
.login-showcase::after {
  content: ""; position: absolute; width: 520px; height: 520px; left: -160px; bottom: -260px;
  border-radius: 42% 58% 55% 45%; background: rgba(8,53,131,.66); transform: rotate(18deg);
}
.showcase-mark { display: flex; margin-bottom: 2rem; }
.showcase-mark span { width: 42px; height: 42px; border: 7px solid #173b86; border-radius: 12px; }
.showcase-mark span + span { margin-left: -15px; margin-top: 15px; border-color: rgba(255,255,255,.85); }
.showcase-kicker { margin: 0 0 .9rem; color: #173b86; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.login-showcase h1 { position: relative; z-index: 2; margin: 0; max-width: 620px; color: #0e2d76; font-size: clamp(3rem, 6vw, 6rem); line-height: .96; letter-spacing: -.065em; }
.showcase-copy { position: relative; z-index: 2; max-width: 500px; margin-top: 1.5rem; font-size: 1.05rem; color: #eaf6ff; }
.showcase-orbit { position: absolute; border: 4px solid rgba(23,59,134,.42); border-radius: 18px; transform: rotate(8deg); }
.orbit-one { width: 80px; height: 80px; right: 12%; top: 14%; }
.orbit-two { width: 46px; height: 46px; right: 24%; bottom: 20%; }
.login-card {
  align-self: center; justify-self: center; width: min(430px, calc(100% - 3rem)); max-width: none;
  padding: 2.5rem; border: 0; box-shadow: none; background: transparent;
}
.login-brand { text-align: left; }
.login-logo {
  width: 62px; height: 62px; margin: 0 0 1.15rem; color: #fff; background: #173b86;
  border-radius: 17px; box-shadow: 10px 10px 0 -5px #75baf2;
}
.login-card h1 { color: #173b86; font-size: 2rem; }
.login-foot { color: #7b879d !important; border-color: #dce5ef; }
.demo-note { background: #eaf4ff; color: #31527e; border-color: #c9def2; }

@media (max-width: 900px) {
  .app-shell .topbar { width: 205px; }
  .app-shell .container { margin-left: 205px; padding: 1.6rem; }
  .login-page { grid-template-columns: .9fr 1.1fr; }
  .login-showcase { padding: 3rem; }
  .login-showcase h1 { font-size: clamp(2.7rem, 6vw, 4.6rem); }
}
@media (max-width: 720px) {
  .app-shell .topbar {
    position: sticky; inset: auto; width: 100%; height: auto; padding: .8rem 1rem;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: .65rem;
    background: #173b86; border: 0;
  }
  .app-shell .brand { display: flex; align-items: center; padding: 0; }
  .app-shell .brand a, .app-shell .edition-pill { color: #fff; }
  .app-shell .brand a::before { border-color: #fff; box-shadow: 8px 8px 0 -5px #75baf2; }
  .app-shell .nav-toggle { display: inline-flex; border-color: rgba(255,255,255,.35); }
  .app-shell .nav-toggle-bars, .app-shell .nav-toggle-bars::before, .app-shell .nav-toggle-bars::after { background: #fff; }
  .app-shell .mainnav, .app-shell .userbox { display: none; flex-basis: 100%; }
  .app-shell .topbar.open .mainnav, .app-shell .topbar.open .userbox { display: flex; }
  .app-shell .mainnav a { color: #dbe8ff; }
  .app-shell .mainnav a:hover { color: #fff; background: rgba(255,255,255,.1); }
  .app-shell .userbox { color: #fff; border-top-color: rgba(255,255,255,.15); }
  .app-shell .nav-signout { color: #fff; border-color: rgba(255,255,255,.25); background: transparent; }
  .app-shell .container { margin: 0; padding: 1.25rem 1rem 3rem; }
  .login-page { display: flex; padding: 1.2rem; background: linear-gradient(145deg, #d8ecff, #f8fbff); }
  .login-showcase { display: none; }
  .login-card { padding: 1.8rem 1.35rem; background: #fff; border-radius: 22px; box-shadow: var(--shadow); }
}

/* Public forms and QR self check-in use the same OYAMS visual system. */
.form-page {
  position: relative; min-height: 100vh; overflow-x: hidden;
  padding: clamp(1.5rem, 4vw, 3.5rem) 1rem 4rem;
  background:
    radial-gradient(circle at 12% 8%, rgba(117,186,242,.5), transparent 24rem),
    radial-gradient(circle at 92% 90%, rgba(49,94,196,.18), transparent 28rem),
    linear-gradient(145deg, #dceeff 0%, #f7fbff 48%, #edf5fc 100%);
}
.form-page::before, .form-page::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  width: 86px; height: 86px; border: 5px solid rgba(23,59,134,.18); border-radius: 22px;
}
.form-page::before { left: 5vw; top: 9vh; transform: rotate(12deg); }
.form-page::after { right: 6vw; bottom: 9vh; transform: rotate(-9deg); }
.form-page .form-wrap { position: relative; z-index: 1; }
.form-page .form-brand { margin-bottom: 1.25rem; }
.form-page .login-logo {
  width: 64px; height: 64px; color: #fff; background: #173b86;
  border-radius: 17px; box-shadow: 10px 10px 0 -5px #75baf2;
}
.form-page .form-brand h1 { color: #173b86; font-weight: 800; }
.form-page .form-card {
  border: 1px solid rgba(49,94,196,.13); border-radius: 22px;
  box-shadow: 0 22px 60px rgba(27,61,119,.13); background: rgba(255,255,255,.97);
}
.form-page .form-card > h1 { color: #142b5c; letter-spacing: -.025em; }
.form-page .form-foot { color: #5f6f8b; font-weight: 600; }
.form-page .regno { color: #315ec4; }
.form-done-mark { color: #fff; background: linear-gradient(135deg, #35a86f, #167a4b); }
.lookup-item:hover, .lookup-item.active, .ss-item:hover, .ss-item.active { background: #edf5ff; }

@media (max-width: 600px) {
  .form-page { padding: 1.25rem .8rem 3rem; }
  .form-page::before, .form-page::after { opacity: .45; }
  .form-page .form-card { padding: 1.25rem 1rem; border-radius: 18px; }
}
