/* Channel Partner Meet — one stylesheet, three shells.
   Palette is drawn from the event's own materials: pine green signage,
   brass lettering, stone paper. Nothing decorative that isn't load-bearing. */

:root {
  --pine: #1b2b26;
  --pine-soft: #2c443b;
  --brass: #a8762b;
  --brass-tint: #f2e7d2;
  --paper: #ffffff;
  --stone: #f0efea;
  --line: #d7d8d1;
  --text: #1d2320;
  --muted: #61695f;
  --ok: #1f6b4a;
  --ok-tint: #e4f0e9;
  --warn: #96590f;
  --warn-tint: #f8ecd9;
  --bad: #96271f;
  --bad-tint: #f8e3e1;
  --radius: 4px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--stone);
}

a { color: var(--pine); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------ partner shell
   The invite artwork sets the palette: blush paper, terracotta ink, a soft
   display serif. Scoped to .page-partner by overriding the shared variables,
   so the admin CRM and the event-day scanner keep their own look. */

.page-partner {
  --pine: #33271f;
  --pine-soft: #46362b;
  --brass: #c2762f;
  --brass-tint: #f3dcc4;
  --paper: #fffaf6;
  --stone: #f7e1d3;
  --line: #e7d0bf;
  --text: #2a211c;
  --muted: #7c6a5d;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;

  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--stone);
}

.masthead {
  background: transparent;
  color: var(--text);
  padding: 22px 20px 8px;
  border-bottom: 0;
}
.masthead__inner { max-width: 640px; margin: 0 auto; }

.masthead__logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.masthead__mark { width: auto; height: 46px; }
.masthead__connect { width: auto; height: 34px; opacity: .9; }

.masthead__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 12vw, 62px);
  line-height: .98;
  letter-spacing: -0.01em;
  color: var(--brass);
  margin: 0;
}
.masthead__title--sm { font-size: clamp(30px, 8vw, 40px); }

.masthead__tagline {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(18px, 4.6vw, 22px);
  line-height: 1.3;
  color: var(--text);
  max-width: 30ch;
}

.masthead__meta {
  list-style: none;
  margin: 22px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 11px;
}
.masthead__meta li { display: flex; align-items: center; gap: 11px; font-size: 16px; }
.masthead__meta svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--brass); }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 22px 20px 48px; flex: 1; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 20px;
}
.panel + .panel { margin-top: 18px; }
.panel__lead { margin: 0 0 20px; color: var(--muted); }
.panel__title { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0 0 6px; }

.rsvp {
  margin: 22px auto 0;
  max-width: 640px;
  padding: 0 20px;
  color: var(--muted);
  font-size: 14.5px;
}
.rsvp strong { color: var(--text); font-weight: 600; }
.rsvp a { color: var(--brass); }

/* ------------------------------------------------------------------ forms */

.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

.field input,
.field select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  padding: 13px 12px;
  border: 1px solid #c9ccc4;
  border-radius: 8px;
  min-height: 48px;
}
.page-partner .field input { border-color: #dcc3b0; }
.field input:focus { border-color: var(--pine); }
.field input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-tint); }

.field .err { display: block; color: var(--bad); font-size: 13.5px; margin-top: 6px; }
.field .err:empty { display: none; }

.prefix { display: flex; align-items: stretch; }
.prefix__tag {
  display: flex; align-items: center;
  padding: 0 12px;
  border: 1px solid #b9bcb4; border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--stone); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.prefix input { border-radius: 0 var(--radius) var(--radius) 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600;
  min-height: 50px; padding: 0 22px;
  border: 1px solid var(--pine);
  border-radius: var(--radius);
  background: var(--pine); color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.page-partner .btn { border-radius: 8px; }
.page-partner .prefix__tag { border-radius: 8px 0 0 8px; border-color: #dcc3b0; }
.page-partner .prefix input { border-radius: 0 8px 8px 0; }
.btn:hover { background: var(--pine-soft); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--pine); }
.btn--ghost:hover { background: var(--stone); }
.btn--brass { background: var(--brass); border-color: var(--brass); color: #22190a; }
.btn--brass:hover { background: #94671f; color: #fff; }

.notice { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px; font-size: 15px; }
.notice--bad { background: var(--bad-tint); border: 1px solid #e0b3ae; color: #6e1c16; }
.notice--ok { background: var(--ok-tint); border: 1px solid #a9cebb; color: #14523a; }
.notice--warn { background: var(--warn-tint); border: 1px solid #dcc08d; color: #6d400a; }

/* ------------------------------------------------- the pass (signature) */

.pass {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.pass__head {
  background: var(--pine);
  color: #f2f4ef;
  padding: 20px;
}
.pass__stamp {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  margin: 0;
}
.pass__event { margin: 4px 0 0; color: #b9c6bb; font-size: 14px; }

.pass__body { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.pass__body dt { font-size: 12.5px; color: var(--muted); margin: 0 0 2px; }
.pass__body dd { margin: 0; font-size: 17px; font-weight: 600; }
.pass__body .span-2 { grid-column: 1 / -1; }

.pass__id {
  font-size: 26px;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--pine);
}

/* the perforation is the one flourish — it reads as a ticket, not a card */
.pass__tear {
  position: relative;
  height: 22px;
  border-top: 2px dashed var(--line);
  background: var(--paper);
}
.pass__tear::before,
.pass__tear::after {
  content: "";
  position: absolute; top: -13px;
  width: 24px; height: 24px;
  background: var(--stone);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.pass__tear::before { left: -13px; }
.pass__tear::after { right: -13px; }

.pass__qr { padding: 4px 20px 26px; text-align: center; }
.pass__qr img {
  width: min(280px, 74vw); height: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff;
}
.pass__qr p { color: var(--muted); font-size: 14px; margin: 12px 0 0; }

.pass-actions { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 520px) { .pass-actions { grid-template-columns: 1fr 1fr; } }

.site-foot { padding: 0 20px 28px; text-align: center; color: var(--muted); font-size: 13px; }

@media print {
  .masthead, .site-foot, .pass-actions, .noprint { display: none !important; }
  body { background: #fff; }
  .pass { border: 1px solid #000; }
  .pass__head { background: #fff; color: #000; border-bottom: 2px solid #000; }
}

/* ------------------------------------------------------------ scanner */

.page-scan {
  background: #0d1512;
  color: #e9ede8;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
.scan-head {
  padding: 14px 16px;
  border-bottom: 1px solid #24332c;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.scan-head h1 { font-size: 17px; margin: 0; font-weight: 600; }
.scan-head span { display: block; font-size: 12.5px; color: #8fa294; font-weight: 400; }
.scan-head a { color: #9fd0b6; font-size: 14px; }

.scan-main { flex: 1; padding: 14px 16px 28px; max-width: 560px; width: 100%; margin: 0 auto; }

.viewport {
  position: relative;
  background: #060b09;
  border: 1px solid #26362e;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.viewport video, .viewport canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewport__frame {
  position: absolute; inset: 14%;
  border: 2px solid rgba(168, 118, 43, .9);
  border-radius: 8px;
  pointer-events: none;
}
.viewport__msg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px; color: #9fb0a4; font-size: 15px;
}

.scan-actions { display: grid; gap: 10px; margin-top: 14px; }
.btn-lg {
  font: inherit; font-size: 18px; font-weight: 600;
  min-height: 62px; width: 100%;
  border-radius: 6px; border: 0; cursor: pointer;
  background: var(--brass); color: #1a1305;
}
.btn-lg--go { background: #2aa06a; color: #04150d; }
.btn-lg--quiet { background: transparent; color: #c9d6cd; border: 1px solid #33473c; }

.result { margin-top: 16px; border-radius: 6px; padding: 18px; background: #12201a; border: 1px solid #26362e; }
.result--ok { background: #10281c; border-color: #2aa06a; }
.result--warn { background: #2a2312; border-color: #b98a2e; }
.result--bad { background: #2a1512; border-color: #b2483c; }
.result__title { font-size: 25px; margin: 0 0 4px; font-weight: 700; }
.result__sub { margin: 0 0 14px; color: #b3c3b8; }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 15px; }
.result dt { color: #8fa294; }
.result dd { margin: 0; font-weight: 600; }
.result__wa { font-size: 14px; padding: 9px 12px; border-radius: 4px; background: #0c1712; color: #a9bdb0; }

.count {
  display: flex; align-items: center; gap: 10px; margin: 14px 0;
}
.count button {
  width: 58px; height: 58px; font-size: 26px; font-weight: 700;
  border-radius: 6px; border: 1px solid #33473c; background: #16261e; color: #e9ede8; cursor: pointer;
}
.count input {
  flex: 1; min-width: 0; height: 58px; text-align: center;
  font: inherit; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 6px; border: 1px solid #33473c; background: #0a1310; color: #fff;
}

.manual { margin-top: 22px; }
.manual input {
  width: 100%; font: inherit; min-height: 50px; padding: 0 12px;
  border-radius: 6px; border: 1px solid #33473c; background: #0a1310; color: #fff;
}
.manual__list { list-style: none; margin: 12px 0 0; padding: 0; }
.manual__list li { border-bottom: 1px solid #24332c; }
.manual__list button {
  width: 100%; text-align: left; background: none; border: 0; color: inherit;
  padding: 12px 2px; font: inherit; cursor: pointer;
}
.manual__list small { display: block; color: #8fa294; }

/* -------------------------------------------------------------- admin */

.page-admin { background: var(--stone); }

.admin-bar {
  background: var(--pine); color: #eef1ec;
  padding: 12px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.admin-bar__brand { color: inherit; text-decoration: none; line-height: 1.2; }
.admin-bar__event { display: block; font-family: var(--serif); font-size: 22px; }
.admin-bar__brandline { display: block; font-size: 12px; color: #a9bbae; }
.admin-bar__nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: 15px; }
.admin-bar__nav a { color: #d5e0d7; text-decoration: none; }
.admin-bar__nav a:hover { color: #fff; text-decoration: underline; }
.admin-bar__out { color: #e7c489 !important; }

.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-wrap h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0 0 4px; }
.admin-wrap h2 { font-size: 18px; margin: 30px 0 12px; }
.admin-sub { color: var(--muted); margin: 0 0 22px; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat__n { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat__l { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.stat--ok .stat__n { color: var(--ok); }
.stat--bad .stat__n { color: var(--bad); }
.stat--warn .stat__n { color: var(--warn); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0; }
.toolbar input[type="search"], .toolbar select {
  font: inherit; min-height: 44px; padding: 0 12px;
  border: 1px solid #b9bcb4; border-radius: var(--radius); background: #fff;
}
.toolbar input[type="search"] { flex: 1; min-width: 220px; }

.table-scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 860px; }
table.grid th, table.grid td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { background: #f6f6f2; font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.grid tbody tr:hover { background: #fafaf7; }
table.grid td.num { font-variant-numeric: tabular-nums; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chip--ok { background: var(--ok-tint); color: #14523a; }
.chip--warn { background: var(--warn-tint); color: #6d400a; }
.chip--bad { background: var(--bad-tint); color: #6e1c16; }
.chip--idle { background: #eceae4; color: #5c6259; }

.detail-cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin: 0 0 14px; font-size: 16px; }
.card dl { margin: 0; display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; font-size: 15px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; word-break: break-word; }

.pager { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.pager a { padding: 8px 14px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); text-decoration: none; }

.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--pine); }
.login-card { width: 100%; max-width: 380px; background: var(--paper); border-radius: var(--radius); padding: 28px 24px; }
.login-card h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0 0 4px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 15px; }

.config-warning {
  background: var(--warn-tint); border: 1px solid #dcc08d; color: #5f3907;
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14.5px;
}
.config-warning code { background: #fff; padding: 1px 5px; border-radius: 3px; }
.config-warning ul { margin: 8px 0 0; padding-left: 20px; }
