/* Fórsa picket attendance — the member pass and the leader scanner.
   Tokens shared with pickets.css (which is not imported: it pins the map layout). */
:root {
  --navy: #1f3a56; --teal: #3a8b94; --teal-dark: #1f5d66;
  --coral: #d74e5c; --coral-dark: #b83c49; --coral-tint: #fbeaec; --amber: #b45309;
  --green: #1e7f4f; --green-tint: #e6f4ec; --amber-tint: #fdf1e0; --red-tint: #fbeaec;
  --ink: #1c2733; --ink-2: #52626f; --ink-3: #8195a1;
  --line: #e3e9ee; --surface: #ffffff; --surface-2: #f6f8fa;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 10px 34px rgba(31, 58, 86, 0.18); --shadow-sm: 0 2px 10px rgba(31, 58, 86, 0.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--surface-2); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- buttons (as pickets.css) ----------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border: 0; border-radius: 999px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--coral-dark); }
.btn-ghost { background: var(--surface); color: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { background: none; color: var(--teal-dark); padding: 0 4px; min-height: 36px; font-weight: 600; }

/* --- member pass: must read as a still image, nothing critical below the fold --- */
.pass { max-width: 420px; margin: 0 auto; padding: 24px 16px 40px; text-align: center; }
.pass-logo { height: 48px; width: auto; }
.pass-kicker { margin: 18px 0 0; color: var(--ink-2); font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.pass-name { margin: 2px 0 16px; font-size: 30px; line-height: 1.15; color: var(--navy); }
.pass-qr { display: block; width: min(100%, 328px); height: auto; margin: 0 auto; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-sm); image-rendering: pixelated; }
.pass-instruction { margin: 20px 0 0; font-size: 18px; font-weight: 600; }
.pass-print { margin-top: 20px; }
.pass-foot { margin: 32px 0 0; color: var(--ink-3); font-size: 13px; }
@media print {
  body { background: #fff; }
  .pass { max-width: none; padding: 0; break-inside: avoid; }
  .pass-print { display: none !important; }
  .pass-qr { width: 80mm; border-radius: 0; box-shadow: none; }
}

/* --- leader: shared ------------------------------------------------------- */
.leader, .scanner { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }
.leader-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.leader-logo { height: 40px; width: auto; }
.leader-who { margin: 0; color: var(--ink-2); font-weight: 600; }
.leader-title { margin: 12px 0 4px; font-size: 24px; color: var(--navy); }
.leader-sub { margin: 0 0 14px; color: var(--ink-2); }
.practice { margin: 0 0 14px; padding: 12px 14px; background: var(--amber-tint); border: 1px solid var(--amber);
  border-radius: var(--radius-sm); color: var(--amber); font-weight: 600; }
.leader-foot { margin-top: 28px; color: var(--ink-3); font-size: 13px; text-align: center; }
.empty { color: var(--ink-2); text-align: center; padding: 24px 0; }
.inline-form { display: inline; }

/* --- leader: picker -------------------------------------------------------- */
.picker-search { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 16px;
  padding: 0 18px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.picker-search:focus { outline: 2px solid var(--teal); outline-offset: 2px; border-color: transparent; }
.picker-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.picker-btn { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  min-height: 64px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  box-shadow: var(--shadow-sm); font: inherit; color: var(--ink); cursor: pointer; }
.picker-btn:hover { background: var(--surface-2); }
.picker-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.picker-name { font-weight: 650; color: var(--navy); }
.picker-meta { color: var(--ink-2); font-size: 14px; }

/* --- leader: scanner ------------------------------------------------------- */
.scanner-body { background: var(--surface-2); }
.banner { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.banner-label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.banner-line { margin: 2px 0 4px; font-size: 20px; font-weight: 700; line-height: 1.2; }
.banner-date { margin: 0; font-size: 15px; opacity: .92; }
.banner-practice { margin: 10px 0 0; padding: 8px 12px; background: var(--amber-tint); color: var(--amber);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; }
.camera { position: relative; margin-top: 14px; border-radius: var(--radius); overflow: hidden; background: #0e1720; min-height: 46vh;
  display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.camera video { width: 100%; height: 46vh; object-fit: cover; display: block; }
.camera-idle { padding: 24px; text-align: center; color: #fff; }
.camera-lead { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.camera-note { margin: 14px 0 0; font-size: 14px; opacity: .8; }
.camera-fail { position: absolute; inset: auto 12px 12px; margin: 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.95); color: var(--coral-dark); font-weight: 600; }
.result { margin-top: 14px; padding: 16px 18px; border-radius: var(--radius); border: 2px solid transparent; }
.result.ok { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.result.dup { background: var(--amber-tint); border-color: var(--amber); color: var(--amber); }
.result.err { background: var(--red-tint); border-color: var(--coral-dark); color: var(--coral-dark); }
.result.pending { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.result-title { margin: 0; font-size: 22px; font-weight: 750; line-height: 1.2; }
.result-detail { margin: 6px 0 0; font-size: 17px; color: var(--ink); }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.actions .btn { width: 100%; }
.self-status { margin: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 12px;
  text-align: center; font-weight: 650; color: var(--green); }
.self-status.pending { color: var(--ink-2); font-weight: 600; }
.queue { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.queue-pending { margin: 0; color: var(--ink-2); font-weight: 600; }
.queue-failed { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.queue-failed li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--coral-dark); }
.manual { border: 0; border-radius: var(--radius); padding: 20px; width: min(92vw, 440px); box-shadow: var(--shadow); }
.manual::backdrop { background: rgba(31, 58, 86, .45); }
.manual h2 { margin: 0 0 6px; color: var(--navy); }
.manual-note { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.manual label { display: block; margin-bottom: 10px; font-weight: 600; }
.manual input { display: block; width: 100%; height: 46px; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 12px; font: inherit; font-size: 16px; }
.manual input[aria-invalid="true"] { border-color: var(--coral); }
.manual-actions { display: flex; gap: 10px; justify-content: flex-end; margin: 6px 0 0; }
.form-msg { min-height: 1.4em; margin: 0; color: var(--coral-dark); font-weight: 600; }

/* --- the day-after question (/p/<token>/day/<date>) ------------------------- */
.day { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }
.day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.day-title { margin: 12px 0 6px; font-size: 24px; line-height: 1.2; color: var(--navy); }
.day-sub { margin: 0 0 16px; color: var(--ink-2); }
.saved { margin: 0 0 16px; padding: 12px 14px; background: var(--green-tint); border: 1px solid var(--green);
  border-radius: var(--radius-sm); color: var(--green); font-weight: 600; }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; font-weight: 600; }
.choice input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--coral); }
.choice:has(input:checked) { border-color: var(--teal); outline: 2px solid var(--teal); }
.picket-section { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.day-form:not(:has(input[name="answer"][value="picket"]:checked)) .picket-section { display: none; }
.section-title { margin: 0 0 10px; padding: 0; font-size: 17px; font-weight: 700; color: var(--navy); }
.chosen { margin: 0 0 12px; padding: 10px 12px; background: var(--green-tint); border-radius: var(--radius-sm); color: var(--ink); }
.field { display: block; margin: 12px 0 0; font-weight: 600; }
.field input, .field textarea { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 16px; background: var(--surface); }
.field textarea { min-height: 72px; resize: vertical; }
.sub-choices { margin-top: 14px; }
.sub-choices .choice { font-weight: 500; padding: 10px 12px; box-shadow: none; }
.day-actions { margin-top: 16px; }
.day-actions .btn { width: 100%; }
.day-foot { margin-top: 28px; color: var(--ink-3); font-size: 13px; text-align: center; }

/* the same question on the picket code page, on the days after a strike day */
.pass-question { text-align: left; margin: 8px 0 28px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.pass-question .day-title { margin-top: 0; }
.pass-recorded { margin: 0 0 20px; }
.pass-question + .pass-kicker { margin-top: 0; }
@media print {
  .pass-question, .pass-recorded { display: none; }
}

/* the rally question before a strike day, and the code not yet active (PASS_PAGE=rally) */
/* the switch between the two sides: "Rally choice" and the code (or, for a leader, the scanner) */
.side-toggle { display: flex; gap: 4px; max-width: 420px; margin: 14px auto 12px; padding: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); }
.side-toggle a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 10px;
  border-radius: 999px; color: var(--ink-2); font-weight: 650; line-height: 1.15; text-align: center; text-decoration: none; }
.side-toggle a.is-on { background: var(--navy); color: #fff; }
.side-toggle a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.scanner .side-toggle { margin-top: 0; }
@media print {
  .side-toggle { display: none !important; }
}
.rally-question { text-align: left; margin: 8px 0 0; padding: 0; }
.rally-question .day-title, .rally-hi + .leader-title { margin: 0 0 14px; }
.rally-note { margin: 16px 0 0; color: var(--ink-2); }
.rally-hi { margin: 12px 0 0; color: var(--ink-2); font-weight: 650; }
.pass-note { margin: 18px 0 0; padding: 10px 14px; background: var(--amber-tint); border: 1px solid var(--amber);
  border-radius: var(--radius-sm); color: var(--amber); font-weight: 650; }
.pass-choice { margin: 18px 0 0; color: var(--navy); font-weight: 600; }
.pass-change { margin-top: 10px; }
.pass-leave { margin: 0 0 16px; }
/* on the strike day, under the code: the member's own screen says once they have been recorded */
.pass-done { margin: 18px 0 0; font-size: 18px; }
.leader-choice { margin: 0 0 14px; color: var(--navy); font-weight: 600; }
.rally-list { margin-bottom: 10px; }
.rally-list .picker-btn, .picker-toggle { justify-content: center; min-height: 56px; }
.picker-toggle { margin-bottom: 14px; border-style: dashed; border-color: var(--teal); }
.picker-toggle .picker-name { color: var(--teal-dark); }
@media print {
  .pass-choice, .pass-change { display: none !important; }
}

/* --- the staff entry page (/a/<token>) ---------------------------------------- */
.entry .field select { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; font-size: 16px; background: var(--surface); }
.entry .field input[type="time"] { width: auto; min-width: 140px; }
.entry-heading { margin-top: 20px; }
.entry .is-filled { background: var(--surface-2); color: var(--ink-2); }
.entry-found { margin: 10px 0 0; padding: 10px 12px; background: var(--green-tint); border: 1px solid var(--green);
  border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; }
.entry .picket-section { margin-top: 20px; }
.entry-recent { margin-top: 32px; }
.entry-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.entry-table th, .entry-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry-table th { color: var(--ink-2); font-weight: 600; }

/* --- the salary calculator (PASS_PAGE=calculator) --------------------------- */
.calc { text-align: left; padding: 8px 0 0; }
.calc-disclaimer { margin: 14px 0 18px; padding: 14px 16px; border: 2px solid var(--coral); border-radius: 8px; color: var(--navy); font-size: 18px; font-weight: 700; line-height: 1.35; }
.calc-error { margin: 8px 0 0; color: var(--coral); font-weight: 600; }
.calc-result { margin-top: 24px; }
.calc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.calc-table th, .calc-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.calc-table th:last-child, .calc-table td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.calc-back { margin: 16px 0 0; color: var(--navy); }
.calc-back p { margin: 6px 0 0; font-weight: 600; }
.calc-back .calc-back-total { font-size: 18px; font-weight: 700; }
.calc-period { border: 0; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.calc-period legend { width: 100%; }
.calc-period label { display: flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; cursor: pointer; }
.calc-period input { width: 20px; height: 20px; margin: 0; accent-color: var(--coral); }
.calc-note { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; }
