/* ==========================================================================
   An Evening to Reconnect - unified stylesheet
   Brand: deep red / bright red / white / black / light gray + hexagon motifs
   ========================================================================== */

:root {
  --red: #D71920;
  --red-dark: #8B0015;
  --black: #111111;
  --gray-dark: #292929;
  --gray-light: #F5F5F5;
  --white: #FFFFFF;
  --green: #20A464;
  --amber: #F3A712;
  --ink: #1a1a1f;
  --muted: #6b6b78;
  --line: #e6e6ea;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 26px rgba(17, 17, 17, .08);
  --shadow-lg: 0 18px 48px rgba(17, 17, 17, .14);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--gray-light);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--red); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }

/* hexagon background motif -------------------------------------------------*/
.hexpattern {
  background-color: var(--black);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='1.2'%3E%3Cpath d='M28 1 L54 16 L54 46 L28 61 L2 46 L2 16 Z'/%3E%3Cpath d='M28 17 L41 24 L41 39 L28 46 L15 39 L15 24 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 64px;
}
.hexpattern-light {
  background-color: var(--white);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cg fill='none' stroke='%23D71920' stroke-opacity='0.07' stroke-width='1.2'%3E%3Cpath d='M28 1 L54 16 L54 46 L28 61 L2 46 L2 16 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 64px;
}

.hex-badge {
  width: 54px; height: 62px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--red), var(--red-dark));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .5px;
}
.hex-badge.sm { width: 40px; height: 46px; font-size: .62rem; }

/* ---------------------------------------------------------------- structure */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.page { max-width: 480px; margin: 0 auto; padding: 0 16px 96px; }

.app-header { position: relative; color: #fff; padding: 26px 0 30px; overflow: hidden; }
.app-header .wrap { position: relative; z-index: 2; }
.app-header::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(139,0,21,.85), rgba(17,17,17,.72));
  z-index: 1;
}
.app-header .brand-row { display: flex; align-items: center; gap: 14px; }
.app-header h1 { font-size: 1.5rem; margin: 0; letter-spacing: .2px; }
.app-header .tagline { color: #ffc9c9; font-size: .86rem; margin-top: 4px; letter-spacing: .3px; }
.app-header .small-top { font-size: .72rem; letter-spacing: 2px; text-transform: uppercase; color: #ff9d9d; margin-bottom: 6px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card, .stack > * + * { margin-top: 18px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 1.06rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 12px;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .06s ease, box-shadow .16s ease, background .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; box-shadow: 0 8px 20px rgba(215,25,32,.28); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(215,25,32,.36); }
.btn-dark { background: var(--black); color: #fff; }
.btn-outline { background: #fff; color: var(--red); border-color: var(--red); }
.btn-ghost { background: #fff; color: var(--gray-dark); border-color: var(--line); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.08rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .84rem; border-radius: 9px; }
.btn-xs { min-height: 30px; padding: 4px 10px; font-size: .76rem; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------------- forms */
.field { margin-bottom: 18px; }
.field > label, .field-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--gray-dark); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time],
input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font-size: 1rem; font-family: inherit;
  color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,25,32,.12); }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--red); background: #fff7f7; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236b6b78' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix .prefix {
  display: flex; align-items: center; padding: 0 14px; font-weight: 700; color: var(--gray-dark);
  background: var(--gray-light); border: 1.5px solid var(--line); border-right: none;
  border-radius: 12px 0 0 12px;
}
.input-prefix input { border-radius: 0 12px 12px 0; }
.err { color: var(--red); font-size: .8rem; margin-top: 5px; display: none; }
.err.show { display: block; }

.radio-cards { display: grid; gap: 12px; }
.radio-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.radio-card:hover { border-color: #d9d9e0; }
.radio-card input { width: 22px; height: 22px; accent-color: var(--red); flex: none; margin: 0; }
.radio-card .rc-title { font-weight: 600; }
.radio-card .rc-sub { font-size: .78rem; color: var(--muted); }
.radio-card.selected, .radio-card:has(input:checked) { border-color: var(--red); background: #fff6f6; box-shadow: 0 4px 14px rgba(215,25,32,.10); }

.chev { width: 3.6em; height: 1em; background: var(--red); clip-path: polygon(0 0,3.2em 0,3.6em 50%,3.2em 100%,0 100%,0.4em 50%); }

.consent {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line);
  border-radius: 14px; background: #fff; margin-bottom: 12px;
}
.consent input { width: 22px; height: 22px; accent-color: var(--red); margin: 2px 0 0; flex: none; }
.consent .c-label { font-size: .9rem; line-height: 1.5; }
.consent.required .c-label::after { content: ' *'; color: var(--red); font-weight: 700; }
.consent.locked { opacity: .5; }

.switch-wrap { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
}
.pill-green { background: #e7f7ef; color: #0f7a48; }
.pill-amber { background: #fdf3e0; color: #9a6a05; }
.pill-red { background: #fde9ea; color: #a5121a; }
.pill-gray { background: #f0f0f3; color: #5d5d69; }
.pill-purple { background: #f2e9fd; color: #6b21a8; }
.pill-dark { background: #232326; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); } .dot-amber { background: var(--amber); }
.dot-red { background: var(--red); } .dot-gray { background: #b9b9c2; }
.dot-purple { background: #8b5cf6; }

/* ------------------------------------------------------------------ hero ui */
.event-cards { display: grid; gap: 12px; }
.event-card { display: flex; gap: 14px; align-items: flex-start; }
.event-card .ico {
  width: 42px; height: 42px; border-radius: 12px; background: #fff2f2; color: var(--red);
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex: none;
}
.event-card .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.event-card .val { font-weight: 600; font-size: 1rem; }
.event-card .sub { font-size: .82rem; color: var(--muted); }

/* carousel */
.carousel { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 14px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: #ddd; border-radius: 99px; }
.confirm-card {
  flex: 0 0 232px; scroll-snap-align: start; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow);
}
.confirm-card .name { font-weight: 700; }
.confirm-card .dept { font-size: .82rem; color: var(--muted); }
.confirm-card .when { font-size: .74rem; color: var(--green); font-weight: 600; margin-top: 6px; }
.carousel-empty { padding: 18px; text-align: center; color: var(--muted); font-size: .88rem; flex: 1 0 100%; }
/* inline text button (e.g. the carousel pause control) */
.link-btn {
  background: none; border: 0; padding: 0 2px; margin: 0;
  font: inherit; color: var(--red); font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--red-dark); }

/* the strip scrolls itself; give it a little breathing room as it moves */
.carousel { scroll-padding-left: 0; }
@media (prefers-reduced-motion: reduce) {
  .carousel { scroll-behavior: auto; }
}

/* ------------------------------------------------------- memory photo grid */
.mem-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px; margin-top: 10px;
}
.mem-thumb {
  position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #f4f4f7;
}
.mem-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mem-remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(17, 17, 17, .72); color: #fff; font-size: 1.05rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.mem-remove:hover { background: var(--red); }
.mem-bar { height: 8px; background: #ececf1; border-radius: 99px; overflow: hidden; }
.mem-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--red-dark)); transition: width .25s ease; }

/* ------------------------------------------------------------------- terms */
.terms-body { background: var(--black); color: #e9e9ee; min-height: 100vh; }
.terms-head {
  position: sticky; top: 0; z-index: 5; background: rgba(17,17,17,.97); backdrop-filter: blur(6px);
  border-bottom: 1px solid #2a2a2a; padding: 14px 16px;
}
.terms-head h1 { color: #fff; font-size: 1.08rem; margin: 0; }
.terms-head .small { color: #9c9caa; }
.terms-scroll { max-width: 720px; margin: 0 auto; padding: 20px 18px 190px; }
.terms-scroll h2 { color: #fff; font-size: 1.05rem; margin-top: 26px; border-left: 3px solid var(--red); padding-left: 10px; }
.terms-scroll h3 { color: #fff; font-size: .96rem; margin-top: 18px; }
.terms-scroll p, .terms-scroll li { color: #c9c9d3; font-size: .92rem; line-height: 1.7; }
.terms-scroll ul { padding-left: 20px; }
.terms-scroll strong { color: #fff; }
.terms-scroll .hl { color: #ff6b6b; font-weight: 600; }
.terms-scroll a { color: #ff8080; }
.terms-scroll table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.terms-scroll th, .terms-scroll td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #2c2c2c; font-size: .88rem; color: #c9c9d3; }
.terms-scroll th { color: #fff; }
.terms-foot {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(17,17,17,.99) 60%, rgba(17,17,17,.85)); border-top: 1px solid #2a2a2a;
}
.terms-foot .inner { max-width: 720px; margin: 0 auto; }
.terms-foot .progress { height: 5px; background: #2c2c2c; border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.terms-foot .progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), #ff6b6b); transition: width .12s linear; }
.terms-foot .state { color: #9c9caa; font-size: .78rem; text-align: center; margin-top: 8px; }
.read-check {
  display: flex; gap: 10px; align-items: center; justify-content: center; color: #e9e9ee; font-size: .86rem;
  margin-top: 10px;
}
.read-check input { width: 22px; height: 22px; accent-color: var(--red); }

/* ------------------------------------------------------------------ payment */
.acct-box { background: var(--black); color: #fff; border-radius: var(--radius); padding: 18px; }
.acct-box .lbl { font-size: .72rem; letter-spacing: 1.4px; text-transform: uppercase; color: #9c9caa; }
.acct-box .val { font-size: 1.3rem; font-weight: 700; letter-spacing: .6px; }
.acct-box .acct-no { font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; font-family: ui-monospace, monospace; }
.acct-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #333; }
.acct-row:last-child { border-bottom: none; }

.amount-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip {
  min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.chip.active { border-color: var(--red); background: #fff6f6; color: var(--red); }

.upload-zone {
  border: 2px dashed #d8d8de; border-radius: 14px; padding: 22px 16px; text-align: center;
  background: #fcfcfd; cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--red); background: #fff8f8; }
.upload-zone .big { font-size: 1.6rem; }
.proof-preview { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fafafa; }
.proof-preview img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #fff; }

.success-ring {
  width: 84px; height: 84px; border-radius: 50%; background: #e7f7ef; color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem; margin: 0 auto 14px;
}
.success-ring.warn { background: #fdf3e0; color: var(--amber); }
.success-ring.red { background: #fde9ea; color: var(--red); }

.steps { display: flex; gap: 8px; margin: 18px 0; }
.steps .s { flex: 1; height: 5px; border-radius: 99px; background: #e4e4ea; }
.steps .s.on { background: var(--red); }

/* -------------------------------------------------------------------- toast */
#toast-host { position: fixed; left: 0; right: 0; bottom: 22px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: #1c1c20; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .9rem;
  box-shadow: var(--shadow-lg); animation: toastin .18s ease; max-width: 90vw;
}
.toast.good { background: #0f7a48; } .toast.bad { background: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ footer */
.app-footer { color: var(--muted); font-size: .78rem; text-align: center; padding: 26px 16px 40px; }
.app-footer a { color: var(--muted); }
/* discreet text link to the back office at the very bottom of attendee pages */
.app-footer .footer-admin {
  color: #8e8e9c; text-decoration: underline; text-underline-offset: 3px;
  display: inline-block; padding: 8px 12px;   /* comfortable tap target without looking like a button */
}
.app-footer .footer-admin:hover { color: var(--red); }

/* ============================ ADMIN PORTAL ================================ */
.admin-body { background: #f4f4f7; }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: none; background: var(--black); color: #cfcfd8; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { display: flex; gap: 12px; align-items: center; padding: 6px 8px 18px; border-bottom: 1px solid #262629; }
.sidebar .brand .t { color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.2; }
.sidebar .brand .s { color: #8e8e9c; font-size: .7rem; letter-spacing: .6px; }
.sidebar nav { margin-top: 14px; display: flex; flex-direction: column; gap: 3px; }
.sidebar nav .grp { font-size: .66rem; letter-spacing: 1.4px; text-transform: uppercase; color: #6e6e7c; padding: 14px 10px 5px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #c6c6d1; text-decoration: none; font-size: .9rem; font-weight: 500;
}
.sidebar nav a .ic { width: 18px; text-align: center; opacity: .9; }
.sidebar nav a:hover { background: #1c1c20; color: #fff; }
.sidebar nav a.active { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; box-shadow: 0 6px 16px rgba(215,25,32,.3); }
.sidebar .who { margin-top: 18px; border-top: 1px solid #262629; padding: 14px 10px; font-size: .78rem; color: #8e8e9c; }
.sidebar .who b { color: #fff; display: block; font-size: .86rem; }

.admin-main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-top h1 { margin: 0; font-size: 1.4rem; }
.admin-top .sub { color: var(--muted); font-size: .86rem; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); gap: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat .k { font-size: .74rem; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }
.stat .s { font-size: .8rem; color: var(--muted); }
.stat.accent { background: linear-gradient(135deg, var(--red), var(--red-dark)); border-color: transparent; color: #fff; }
.stat.accent .k, .stat.accent .s { color: #ffd6d6; }
.stat.dark { background: var(--gray-dark); border-color: transparent; color: #fff; }
.stat.dark .k, .stat.dark .s { color: #b5b5c0; }
.stat::after {
  content: ''; position: absolute; right: -18px; top: -18px; width: 78px; height: 88px;
  background: currentColor; opacity: .05; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.02rem; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }
.lay2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1080px) { .lay2 { grid-template-columns: 1fr; } }

/* tables */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th {
  text-align: left; padding: 11px 12px; background: #fafafc; color: #5d5d69; font-size: .72rem;
  letter-spacing: .8px; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #f1f1f4; vertical-align: middle; }
table.data tbody tr:hover { background: #fcfcfe; }
table.data tr.row-alert { background: #fff8f8; }
.t-name { font-weight: 600; }
.t-sub { font-size: .74rem; color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.filters .field { margin-bottom: 0; }
.filters select, .filters input { min-height: 44px; font-size: .9rem; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

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

/* proof viewer */
.proof-view { background: #121215; border-radius: 12px; padding: 12px; text-align: center; }
.proof-view img { max-height: 520px; width: auto; margin: 0 auto; border-radius: 8px; background: #fff; }
.proof-meta { display: flex; justify-content: space-between; gap: 10px; color: #b9b9c4; font-size: .76rem; padding: 6px 2px 0; }

.dl { display: grid; grid-template-columns: 168px 1fr; gap: 8px 16px; font-size: .9rem; }
.dl dt { color: var(--muted); font-size: .8rem; }
.dl dd { margin: 0; font-weight: 600; }
@media (max-width: 620px) { .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 10px; } }

.alert { border-radius: 12px; padding: 13px 15px; font-size: .88rem; margin-bottom: 16px; border: 1px solid; }
.alert-info { background: #f2f7ff; border-color: #cfe0ff; color: #1b4b9c; }
.alert-warn { background: #fff8e8; border-color: #f3dfa8; color: #8a6d1f; }
.alert-good { background: #eaf8f0; border-color: #bfe8d3; color: #0f7a48; }
.alert-bad { background: #fdecec; border-color: #f6c9c9; color: #a5121a; }
.alert-dark { background: #1b1b1f; border-color: #1b1b1f; color: #e6e6ee; }

/* charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 22px; }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.chart-card h3 { font-size: .95rem; margin: 0 0 4px; }
.chart-card .cap { color: var(--muted); font-size: .78rem; margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .8rem; color: #4a4a58; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { flex: none; }
.donut .center-num { font-size: 1.5rem; font-weight: 800; }
.donut .center-lbl { font-size: .68rem; fill: #6b6b78; }

.hm-scroll { overflow-x: auto; max-width: 100%; }
.hm { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: .78rem; }
.hm th { text-align: left; color: var(--muted); font-weight: 600; font-size: .72rem; padding: 2px 6px; }
.hm td { text-align: center; border-radius: 8px; padding: 9px 6px; color: #4a4a58; font-variant-numeric: tabular-nums; }
.hm .l0 { background: #f4f4f7; color: #a8a8b4; }
.hm .l1 { background: #ffd9db; color: #7a0a11; }
.hm .l2 { background: #f07176; color: #fff; }
.hm .l3 { background: var(--red-dark); color: #fff; font-weight: 700; }

.hbar { display: grid; gap: 9px; }
.hbar .row { display: grid; grid-template-columns: 132px 1fr 46px; gap: 10px; align-items: center; font-size: .82rem; }
.hbar .bar { height: 18px; border-radius: 6px; background: #f0f0f3; overflow: hidden; }
.hbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--red-dark)); border-radius: 6px; }
.hbar .num { text-align: right; font-variant-numeric: tabular-nums; color: #5d5d69; font-weight: 600; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-card .top { padding: 24px; color: #fff; }
.login-card .body { padding: 22px; }

/* ============================ SCANNER ==================================== */
.scan-body { background: var(--black); color: #fff; }
.scan-top { padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scan-top .t { font-weight: 700; }
.scan-top .s { font-size: .74rem; color: #9c9caa; }
.scan-wrap { max-width: 480px; margin: 0 auto; padding: 0 16px 40px; }
.cam-box { position: relative; width: 100%; aspect-ratio: 1/1; background: #000; border-radius: var(--radius); overflow: hidden; }
.cam-box video { width: 100%; height: 100%; object-fit: cover; }
.cam-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cam-frame { width: 68%; aspect-ratio: 1/1; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.42); border: 3px solid var(--red); }
.cam-status { position: absolute; left: 12px; bottom: 12px; right: 12px; background: rgba(0,0,0,.62); border-radius: 10px; padding: 8px 12px; font-size: .8rem; }
.scan-result { margin-top: 18px; border-radius: var(--radius); padding: 20px; background: #fff; color: var(--ink); }
.scan-result.ok { background: linear-gradient(135deg, #eaf8f0, #fff); border: 1px solid #bfe8d3; }
.scan-result.warn { background: linear-gradient(135deg, #fff8e8, #fff); border: 1px solid #f3dfa8; }
.scan-result.err { background: linear-gradient(135deg, #fdecec, #fff); border: 1px solid #f6c9c9; }
.scan-ticket { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 20px; margin-top: 18px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { min-height: 52px; font-size: 1.15rem; font-weight: 600; }
.manual input { letter-spacing: 2px; text-align: center; font-weight: 700; }

/* ============================ LIVE VIEW ===================================
   Event-day projector screen. Attendance only, on ONE screen with no scrolling:
   KPI strip, check-in progress, and - the point of the screen - WHO HAS COME
   (name + department, big enough to read across the room). No barcode/attendee
   IDs, no interval chart, no heatmap, no contribution figures. */
.live-body { background: #0b0b0d; color: #fff; height: 100vh; overflow: hidden; }
.live-wrap {
  height: 100%;
  padding: 14px 18px 16px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.live-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 0; }
.live-eyebrow { font-size: .7rem; letter-spacing: 4px; color: #8e8e9c; text-transform: uppercase; }
.live-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; }
.live-sub { color: #8e8e9c; font-size: .8rem; }
.live-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; text-align: right; }
.live-live { display: flex; align-items: center; gap: 8px; color: #8e8e9c; font-size: .7rem; letter-spacing: 2px; }
.live-clock { font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.live-exit { margin-top: 4px; }

.live-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }

.live-card {
  background: #15151a; border: 1px solid #232329; border-radius: 16px;
  padding: 13px 17px 15px; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.live-card .k { font-size: .66rem; letter-spacing: 2px; text-transform: uppercase; color: #8e8e9c; }
.live-card .v { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; line-height: 1.05; margin-top: 2px; }
.live-card.hot { background: linear-gradient(135deg, var(--red), var(--red-dark)); border-color: transparent; }
.live-card.hot .k { color: #ffd6d6; }
.live-card .legend { color: #b9b9c4; }
.live-card .legend i.dot { box-shadow: 0 0 0 1px rgba(255,255,255,.18); }

.live-main { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; min-height: 0; }

.live-donut { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; overflow: hidden; color: #fff; }
.live-donut .donut text { fill: #fff; }

/* ---- who has come ---- */
.live-card-people { padding-bottom: 10px; }
.live-come-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px solid #232329; color: #fff;
  font-size: .78rem; letter-spacing: 2.4px;
}
.live-come-count { color: #8e8e9c; font-size: .68rem; letter-spacing: 1px; }
.live-come {
  flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px;
  display: grid; /* two columns so far more names are visible at once */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 22px; align-content: start;
}
.come-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(0, .85fr);
  gap: 12px; align-items: baseline;
  padding: 8px 12px; background: #1c1c22; border-radius: 10px; min-width: 0;
}
.come-time { color: #8e8e9c; font-size: .86rem; font-variant-numeric: tabular-nums; }
.come-name { font-size: 1.4rem; font-weight: 700; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.come-dept { color: #b9b9c4; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.come-empty { grid-column: 1 / -1; color: #8e8e9c; font-size: 1.05rem; padding: 18px 4px; }
.come-row.new { animation: flashin 2.4s ease; }
@keyframes flashin { from { background: #3a1013; } to { background: #1c1c22; } }

/* fall back to a scrollable stack on small screens */
@media (max-width: 1100px), (max-height: 640px) {
  .live-body { height: auto; overflow: visible; }
  .live-wrap { height: auto; grid-template-rows: none; grid-auto-rows: auto; }
  .live-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .live-main { grid-template-columns: 1fr; }
  .live-come { overflow: visible; grid-template-columns: 1fr; }
  .live-donut { overflow: visible; }
  .live-card { min-height: 0; }
}
@media (min-width: 1700px) {
  .live-come { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* misc */
.qr-box { background: #fff; border-radius: 14px; padding: 16px; text-align: center; border: 1px solid var(--line); }
.qr-box img, .qr-box svg { width: 190px; height: 190px; display: block; margin: 0 auto 8px; }
.qr-code-text { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: 3px; font-size: 1.05rem; }
.badge-role { font-size: .68rem; letter-spacing: .8px; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: #f0f0f3; color: #5d5d69; font-weight: 700; }
.print-only { display: none; }

/* ==================== BACK OFFICE ON A PHONE / TABLET =====================
   The back office is designed for a laptop, but the committee does real work
   from a phone (verifying payments, sending WhatsApp confirmations). Below
   900px the sidebar folds into a scrollable top bar and every control becomes
   thumb-sized, so no screen is usable-only-on-desktop. */
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 12px 12px 10px; }
  .sidebar .brand { padding: 2px 6px 12px; }
  .sidebar nav {
    flex-direction: row; overflow-x: auto; gap: 6px; margin-top: 10px;
    padding-bottom: 6px; -webkit-overflow-scrolling: touch;
  }
  .sidebar nav .grp { display: none; }
  .sidebar nav a { white-space: nowrap; padding: 10px 13px; }
  .sidebar .who {
    margin-top: 10px; border-top: 0; padding: 4px 6px 0;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  }
  .sidebar .who form { margin: 0 !important; }
  .admin-main { padding: 16px 14px 48px; }
  .admin-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .admin-top h1 { font-size: 1.25rem; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .lay2, .chart-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
  .stat .v { font-size: 1.55rem; }
  .panel-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .panel-body { padding: 14px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .pager { flex-direction: column; align-items: flex-start; }
  /* thumb-sized controls */
  .btn-sm { min-height: 44px; padding: 10px 15px; font-size: .92rem; }
  .btn-xs { min-height: 44px; padding: 9px 14px; font-size: .86rem; }
  .qr-box img { width: 210px; height: 210px; }
  .live-ticker .trow { grid-template-columns: 70px 1fr; }
  .live-ticker .trow > div:nth-child(3), .live-ticker .trow > div:nth-child(4) { display: none; }
  .live-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .live-card { padding: 18px; }
  .live-card .v { font-size: 2.3rem; }
  /* wide charts and the heatmap scroll inside their own card instead of
     pushing the page sideways */
  #chart-heatmap, #live-heatmap, #chart-intervals, #live-bars, #chart-departments,
  #live-departments, #live-status, #chart-status, .hbars-wrap { overflow-x: auto; }
  .hm { min-width: 430px; }
  .hm-scroll { overflow-x: auto; }
}
@media (max-width: 560px) {
  .filters, .grid-2 { grid-template-columns: 1fr; }
  .live-grid { grid-template-columns: 1fr; }
}
/* Grid/flex children default to min-width:auto, so a wide chart or table inside
   a card refuses to shrink and pushes the whole page sideways on a phone.
   Letting them shrink (and scroll inside their own card) fixes every case. */
.chart-grid > *, .lay2 > *, .live-charts > *, .live-grid > * { min-width: 0; }
.chart-card, .live-card, .panel, .card { max-width: 100%; }
.alert { overflow-wrap: anywhere; }
.mono { overflow-wrap: anywhere; }
/* long URLs must wrap instead of widening the page on a phone */
.link-long { overflow-wrap: anywhere; word-break: break-word; }

@media print {
  .sidebar, .no-print { display: none !important; }
  .print-only { display: block; }
  .admin-main { padding: 0; }
}
