/* Styles for the app pages: /checkin, /spot, /kiosk, /staff. Loaded after styles.css and uses its tokens. */

[hidden] { display: none !important; }
body.app { padding-bottom: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.app-main { flex: 1; padding: 1.5rem 0 3rem; }
.app-narrow { max-width: 34rem; }
.app-header .header-inner { min-height: 60px; }
.app-header .brand-name { font-size: 1.8rem; }
.app-title { font-size: clamp(1.8rem, 6vw, 2.4rem); margin-bottom: 0.25rem; }
.app-sub { color: var(--muted); margin-bottom: 1.5rem; }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: 0 2px 0 var(--bone-deep);
}
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 1.3rem; margin-bottom: 0.75rem; }

/* Forms */
.field { display: grid; gap: 0.35rem; margin-bottom: 1.1rem; }
.field > span, .field legend { font-weight: 700; color: var(--black); }
.field small { color: var(--muted); font-size: 0.88rem; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.input {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 0.75rem 0.9rem; min-height: 52px;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.4); }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.5rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; flex-direction: column; justify-content: center; min-height: 58px; padding: 0.55rem 0.8rem;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; line-height: 1.25; cursor: pointer;
}
.choice strong { color: var(--black); }
.choice em { font-style: normal; color: var(--muted); font-size: 0.85rem; }
.choice input:checked + span { border-color: var(--black); background: var(--black); color: var(--white); }
.choice input:checked + span strong, .choice input:checked + span em { color: var(--white); }
.choice input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice input:disabled + span { opacity: 0.45; cursor: not-allowed; background: var(--bone); }
.choices--row { grid-template-columns: repeat(4, 1fr); }
.choices--row .choice span { align-items: center; font-weight: 700; font-size: 1.2rem; color: var(--black); }
.choices--row .choice input:checked + span { color: var(--white); }

.btn-block { width: 100%; }
.btn-red { background: var(--scarlet); color: #fff; }
.btn-red:hover { background: var(--scarlet-deep); color: #fff; }
.btn-quiet { background: transparent; color: var(--black); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--black); color: var(--black); }
.btn-green { background: var(--open); color: #fff; }
.btn-green:hover { background: #256f3d; color: #fff; }
.btn-small { min-height: 40px; padding: 0.4rem 0.9rem; font-size: 0.95rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.error { color: var(--scarlet-deep); background: #fbe9e9; border-radius: 8px; padding: 0.7rem 0.9rem; font-weight: 600; margin: 0 0 1rem; }
.error:empty { display: none; }
.muted { color: var(--muted); }
.fine { font-size: 0.9rem; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; background: var(--bone-deep); color: var(--black); white-space: nowrap;
}
.pill--red { background: #fbe9e9; color: var(--scarlet-deep); }
.pill--green { background: #e3f4e8; color: #1f6636; }
.pill--gold { background: #f6ecd6; color: #7a5b17; }
.pill--navy { background: var(--black); color: var(--white); }

/* Big number (spot page, kiosk confirmation) */
.big-stat { text-align: center; padding: 1.5rem 1rem; }
.big-stat .label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--scarlet); margin: 0; }
.big-stat .value { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 16vw, 5rem); color: var(--black); line-height: 1; margin: 0.3rem 0; }
.big-stat .detail { font-size: 1.15rem; color: var(--ink); margin: 0; }

.steps { padding-left: 1.2rem; margin: 0; display: grid; gap: 0.5rem; }

/* ---------- Kiosk ---------- */
body.kiosk { font-size: 1.2rem; }
.kiosk-grid { display: grid; gap: 1.5rem; }
.kiosk .input { font-size: 1.4rem; min-height: 64px; }
.kiosk .choice span { min-height: 72px; font-size: 1.1rem; }
.kiosk .btn { min-height: 68px; font-size: 1.3rem; }
.kiosk-board h2 { display: flex; justify-content: space-between; align-items: baseline; }
.line-list { list-style: none; margin: 0; padding: 0; counter-reset: line; }
.line-list li {
  counter-increment: line; display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 0.25rem 0.75rem; align-items: center;
  padding: 0.7rem 0; border-bottom: 1px dotted var(--line);
}
.line-list li::before { content: counter(line); font-family: var(--font-display); font-weight: 800; color: var(--scarlet); font-size: 1.3rem; }
.line-list li:last-child { border-bottom: 0; }
.line-list .who { font-weight: 700; color: var(--black); }
.line-list .meta { grid-column: 2 / -1; font-size: 0.9rem; color: var(--muted); }
.chairs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.chairs li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem; border-radius: 8px; background: var(--bone); }

@media (min-width: 900px) {
  .kiosk-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}

/* ---------- Staff app ---------- */
body.staff { background: var(--bone); }
.staff-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.staff-top h1 { font-size: 1.6rem; margin: 0; }
.tabs { display: flex; gap: 0.25rem; background: var(--bone-deep); padding: 0.25rem; border-radius: 999px; margin-bottom: 1rem; }
.tabs button {
  flex: 1; font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--black);
  padding: 0.6rem 0.5rem; border-radius: 999px; cursor: pointer; min-height: 44px;
}
.tabs button[aria-selected="true"] { background: var(--black); color: var(--white); }
.tabs button { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; }
.tab-count {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--scarlet); color: #fff; font-size: 0.75rem; line-height: 1;
}

.now-card { background: var(--black); color: var(--white); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; position: relative; overflow: hidden; }
.now-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--stripe); background-size: 100% 68px; }
.now-card h2 { color: var(--white); font-size: 1.5rem; margin: 0.2rem 0; }
.now-card .label { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 0; }
.now-card .timer { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; margin: 0.5rem 0 1rem; font-variant-numeric: tabular-nums; }
.now-card .muted { color: rgba(246, 240, 228, 0.7); }
.now-card .btn { min-height: 64px; font-size: 1.25rem; }
.now-card .btn-quiet { color: var(--white); border-color: rgba(246, 240, 228, 0.35); }
.now-card .btn-quiet:hover { color: var(--white); border-color: var(--white); }
.now-card .btn + .btn-row, .now-card .btn-row + .btn-row { margin-top: 0.6rem; }

.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-item { padding: 0.85rem 0; border-bottom: 1px solid var(--bone-deep); display: grid; gap: 0.35rem; }
.queue-item:last-child { border-bottom: 0; }
.queue-item .row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.queue-item .who { font-weight: 700; color: var(--black); font-size: 1.1rem; }
.queue-item .pills { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.queue-item.not-mine { opacity: 0.6; }

.team { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.team li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--bone-deep); }
.team li:last-child { border-bottom: 0; }
.team--manage li { flex-direction: column; align-items: flex-start; }

.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; max-width: 20rem; margin: 1rem auto 0; }
.pin-pad button {
  font: inherit; font-size: 1.6rem; font-weight: 700; min-height: 64px; border-radius: 12px; border: 2px solid var(--line);
  background: #fff; color: var(--black); cursor: pointer;
}
.pin-pad button:active { background: var(--bone-deep); }
.pin-dots { display: flex; justify-content: center; gap: 0.75rem; margin: 1rem 0 0; min-height: 1.2rem; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--black); }
.pin-dots span.filled { background: var(--black); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; text-align: center; }
.stat-grid div { background: var(--bone); border-radius: 8px; padding: 0.75rem 0.25rem; }
.stat-grid strong { display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--black); line-height: 1.1; }
.stat-grid span { font-size: 0.8rem; color: var(--muted); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--bone-deep); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: 2.2rem repeat(7, 1fr); gap: 2px; font-size: 0.7rem; }
.heat div { text-align: center; padding: 0.3rem 0; border-radius: 3px; }
.heat .h { color: var(--muted); text-align: right; padding-right: 0.3rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--black); color: var(--white); padding: 0.75rem 1.1rem; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow); z-index: 100; max-width: calc(100% - 2rem);
}
.toast[hidden] { display: none; }

/* Schedule */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.sched-days { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.sched-days > li { padding: 0.75rem; border-radius: 8px; background: var(--bone); display: grid; gap: 0.35rem; }
.sched-days > li.is-today { outline: 2px solid var(--black); }
.sched-days .pill { justify-self: start; margin: 0; }
.sched-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.sched-people li { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.95rem; }
.sched-people li span:first-child { font-weight: 700; color: var(--black); }
.shift-row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.shift-day { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--black); }
.shift-day input { width: 1.15rem; height: 1.15rem; }
.input-time { min-height: 44px; padding: 0.4rem 0.5rem; font-size: 1rem; min-width: 0; width: 100%; }
.btn-row .input-time { width: auto; flex: 1; }
.shift-row:has([name=works]:not(:checked)) .input-time { opacity: 0.4; }
.date-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
.date-pair .input { min-width: 0; }
select.input { appearance: auto; }
.card--attention { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 164, 92, 0.35); }
.request-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.request-list > li { display: grid; gap: 0.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--bone-deep); }
.request-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.request-list .pill { justify-self: start; white-space: normal; margin: 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--black); }
