/* Components shared by the customer site, business dashboard and back office. */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 18px; border-radius: var(--r-lg);
  border: 1.5px solid transparent; background: var(--bg-sunken); color: var(--ink);
  font-family: inherit; font-size: var(--fs-base); font-weight: 700; line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); }
.btn--secondary { background: var(--bg); border-color: var(--line-strong); color: var(--ink); }
.btn--secondary:hover { border-color: #C5C9D1; background: #FBFBFC; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--outline { background: var(--bg); border: 2px solid var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--bg-sunken); }
.btn--ghost { background: transparent; color: var(--ink); padding: 0 10px; }
.btn--ghost:hover { background: var(--bg-sunken); }
.btn--link { background: transparent; border: 0; padding: 0; min-height: 0; color: var(--link); font-weight: 700; }
.btn--link:hover { text-decoration: underline; }
.btn--danger { background: var(--bg); border-color: #F1C4BE; color: var(--bad); }
.btn--danger:hover { background: var(--bad-bg); }
.btn--danger-solid { background: var(--bad); color: #fff; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-md); border-radius: var(--r-md); }
.btn--lg { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: var(--r-xl); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: var(--touch); padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) rgba(255,255,255,.9) transparent;
  animation: bt-spin .7s linear infinite;
}
.btn--secondary[aria-busy="true"]::after, .btn--ghost[aria-busy="true"]::after, .btn--danger[aria-busy="true"]::after { border-color: var(--muted) var(--muted) var(--muted) transparent; }
@keyframes bt-spin { to { transform: rotate(360deg); } }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.field__hint { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.field__error { font-size: var(--fs-sm); font-weight: 700; color: var(--bad); line-height: 1.4; }
.field--invalid .input, .field--invalid .select, .field--invalid .textarea { border-color: var(--bad); }
.input, .select, .textarea {
  width: 100%; min-height: var(--touch); padding: 0 14px; border-radius: var(--r-lg);
  border: 1.5px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font-size: 16px; font-weight: 500; line-height: 1.3; transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: #9AA0AD; }
.input:hover, .select:hover, .textarea:hover { border-color: #C5C9D1; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--accent); box-shadow: var(--focus); border-radius: var(--r-lg); }
.input--lg, .select.input--lg { min-height: 50px; }
.input--sm { min-height: 36px; font-size: var(--fs-md); border-radius: var(--r-md); padding: 0 10px; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bg-sunken); color: var(--muted); }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6170' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.textarea { min-height: 96px; padding: 12px 14px; resize: vertical; }
.input-group { display: flex; align-items: stretch; width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r-lg); background: var(--bg); overflow: hidden; }
.input-group:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.input-group__addon { display: flex; align-items: center; padding: 0 12px; background: var(--bg-head); color: var(--muted); font-weight: 700; font-size: var(--fs-md); border-right: 1px solid var(--line); white-space: nowrap; }
.input-group__addon--end { border-right: 0; border-left: 1px solid var(--line); }
.input-group .input { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; }
.code-inputs { display: flex; gap: 10px; }
.code-inputs .input { width: 56px; height: 64px; text-align: center; font-size: 26px; font-weight: 800; padding: 0; }

/* Checkbox and radio */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-base); font-weight: 500; color: var(--ink); cursor: pointer; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.check--sm { font-size: var(--fs-md); }

/* Radio cards */
.radio-cards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.radio-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-xl); border: 1.5px solid var(--line-strong); background: var(--bg); cursor: pointer; }
.radio-card input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.radio-card__title { display: block; font-weight: 800; color: var(--ink); }
.radio-card__text { display: block; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; margin-top: 2px; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.radio-card:has(input:focus-visible) { box-shadow: var(--focus); }
.radio-card:has(input:disabled) { opacity: .55; cursor: not-allowed; background: var(--bg-head); }

/* Switch: <button class="switch" role="switch" aria-checked="true|false" aria-label="..."> */
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; border: 0; padding: 3px; border-radius: var(--r-pill); background: var(--switch-off); display: inline-flex; align-items: center; cursor: pointer; transition: background-color .15s ease; }
.switch::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch--locked:disabled { opacity: 1; }
.switch--locked[aria-checked="true"] { background: #E8A79F; }
.theme-business .switch--locked[aria-checked="true"], .theme-admin .switch--locked[aria-checked="true"] { background: #A9BEDB; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.switch-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row__title { font-weight: 800; }
.switch-row__hint { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: var(--bg); color: var(--ink); font-size: var(--fs-md); font-weight: 700; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: #C5C9D1; text-decoration: none; }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip__count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: rgba(18,24,38,.08); font-size: var(--fs-xs); }
.chip[aria-pressed="true"] .chip__count { background: rgba(255,255,255,.22); }
.chip--sm { min-height: 32px; padding: 0 10px; font-size: var(--fs-sm); }

/* Status chips */
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); line-height: 14px; font-weight: 800; white-space: nowrap; background: var(--grey-bg); color: var(--grey); }
.status .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.status--confirmed, .status--ok, .status--live, .status--valid, .status--paid { background: var(--ok-bg); color: var(--ok); }
.status--pending, .status--requested, .status--warning, .status--scheduled { background: var(--warn-bg); color: var(--warn); }
.status--checked-in, .status--info, .status--on-the-way { background: var(--info-bg); color: var(--info); }
.status--cancelled, .status--declined, .status--expired, .status--muted, .status--refunded { background: var(--grey-bg); color: var(--grey); }
.status--no-show, .status--bad, .status--used, .status--failed { background: var(--bad-bg); color: var(--bad); }
.status--hot { background: var(--bg); color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.theme-customer .status--hot { color: var(--red-strong); box-shadow: inset 0 0 0 1.5px var(--red); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--red); color: #fff; font-size: var(--fs-xs); font-weight: 800; }

/* ---------- Cards ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: none; min-width: 0; }
.card--pad, .card__body { padding: var(--s-5) var(--s-6); }
.card__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-6) 0; }
.card__title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.35; }
.card__subtitle { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.card__footer { padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line-soft); }
.card--flush { overflow: hidden; }
.card--soft { background: var(--bg-head); }
.card--link { display: block; color: inherit; font-weight: inherit; transition: box-shadow .15s ease, border-color .15s ease; }
.card--link:hover { text-decoration: none; border-color: #CDD1D8; box-shadow: var(--shadow-md); }
.stat-card { display: flex; flex-direction: column; gap: 6px; padding: var(--s-5); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-xl); min-width: 0; }
.stat-card__label { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.stat-card__value { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card__meta { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.progress { height: 8px; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; }
.progress__bar { height: 100%; border-radius: inherit; background: var(--accent); }

/* Media cards (customer listings) */
.media-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-2xl); background: var(--bg); color: var(--ink); font-weight: 400; }
.media-card:hover { text-decoration: none; box-shadow: var(--shadow-md); }
.media-card__img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: var(--bg-sunken); }
.media-card__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.media-card__title { font-size: var(--fs-lg); font-weight: 800; }
.media-card__meta { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: var(--fs-sm); color: var(--ink); }
.rating .icon { width: 15px; height: 15px; fill: var(--gold); stroke: var(--gold); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th { text-align: left; padding: 12px 16px; font-size: var(--fs-xs); font-weight: 800; color: var(--muted); background: var(--bg-head); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFCFD; }
.table tr.is-selected td { background: var(--accent-soft); }
.table__primary { font-weight: 800; color: var(--ink); }
.table__secondary { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.table--compact td, .table--compact th { padding: 9px 12px; }
.table--min { min-width: 720px; }

/* Definition list rows */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 16px; font-size: var(--fs-md); }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Tabs and segmented controls ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--bg-sunken); }
.segmented button, .segmented a { min-height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font-size: var(--fs-md); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.segmented [aria-pressed="true"], .segmented [aria-selected="true"], .segmented [aria-current="page"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: var(--s-6); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"], .tabs a { position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 0 2px; border: 0; background: transparent; color: var(--muted); font-size: var(--fs-base); font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--ink); }
.tabs [aria-selected="true"]::after, .tabs [aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); font-size: var(--fs-md); line-height: 1.45; font-weight: 600; background: var(--info-bg); color: var(--info); }
.notice .icon { width: 18px; height: 18px; margin-top: 1px; }
.notice--warning { background: var(--warn-bg); color: var(--warn); }
.notice--success { background: var(--ok-bg); color: var(--ok); }
.notice--danger { background: var(--bad-bg); color: var(--bad); }
.notice--neutral { background: var(--bg-sunken); color: var(--ink-2); }
.notice a { color: inherit; text-decoration: underline; }

/* In-short / callout box */
.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-lg) var(--r-lg) 0; padding: 14px 18px; }

/* ---------- Test-mode banner ---------- */
.test-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 16px; min-height: 32px; background: #FFF4E0; color: #6B4100; font-size: var(--fs-sm); font-weight: 700; border-bottom: 1px solid #F3DDB3; text-align: center; }
.test-banner .icon { width: 16px; height: 16px; }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; z-index: 2000; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; width: min(480px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--r-xl); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: var(--fs-md); font-weight: 600; line-height: 1.4; animation: bt-toast-in .18s ease-out; }
.toast .icon { width: 18px; height: 18px; margin-top: 1px; }
.toast--success .icon { color: #7CE0A6; }
.toast--error { background: #7A1A0F; }
.toast--info .icon { color: #9DBBEA; }
.toast__close { margin-left: auto; background: transparent; border: 0; color: inherit; opacity: .75; padding: 0 0 0 8px; min-height: 0; font-size: 18px; line-height: 1; }
@keyframes bt-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal and drawer (native <dialog>) ---------- */
dialog.modal, dialog.drawer { border: 0; padding: 0; color: var(--ink); background: var(--bg); box-shadow: var(--shadow-lg); max-height: calc(100dvh - 32px); }
dialog.modal { width: min(520px, calc(100vw - 32px)); border-radius: var(--r-2xl); }
dialog.modal::backdrop, dialog.drawer::backdrop { background: rgba(18, 24, 38, 0.45); }
/* max-width: browsers give an open <dialog> max-width: calc(100% - 6px - 2em), which left a gap on phones. */
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); max-width: 100vw; border-radius: 0; animation: bt-drawer-in .2s ease-out; }
@keyframes bt-drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.dialog__inner { display: flex; flex-direction: column; max-height: inherit; height: 100%; }
.dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); padding: 20px 24px 12px; }
.dialog__title { font-size: var(--fs-xl); font-weight: 800; line-height: 1.3; }
.dialog__body { padding: 4px 24px 20px; overflow-y: auto; flex: 1 1 auto; }
.dialog__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line-soft); }
.dialog__close { width: 40px; height: 40px; border-radius: var(--r-md); border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.dialog__close:hover { background: var(--bg-sunken); color: var(--ink); }
@media (max-width: 560px) {
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-2xl) var(--r-2xl) 0 0; }
  dialog.drawer, dialog.drawer.drawer--wide { width: 100vw; max-width: 100vw; }
}

/* ---------- Empty states and loading ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--muted); }
.empty__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--bg-sunken); display: flex; align-items: center; justify-content: center; color: var(--muted); margin-bottom: 6px; }
.empty__title { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); }
.empty__text { max-width: 420px; font-size: var(--fs-md); line-height: 1.5; }
.skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 37%, #EEF0F3 63%); background-size: 400% 100%; animation: bt-shimmer 1.3s ease infinite; min-height: 14px; }
.skeleton--line { height: 14px; margin: 8px 0; }
.skeleton--title { height: 22px; width: 40%; margin: 6px 0 14px; }
.skeleton--block { height: 120px; border-radius: var(--r-xl); }
@keyframes bt-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: bt-spin .8s linear infinite; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--muted); font-weight: 600; }
.error-box { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 18px 20px; border-radius: var(--r-xl); background: var(--bad-bg); color: var(--bad); font-weight: 600; }

/* ---------- Avatar, lists ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 800; flex-shrink: 0; text-transform: uppercase; }
.avatar--sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.list > li:last-child { border-bottom: 0; }

/* ---------- Time slot buttons (booking widget) ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 0 10px; border-radius: var(--r-lg); border: 1.5px solid var(--line-strong); background: var(--bg); font-weight: 800; font-size: var(--fs-base); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.slot:hover { border-color: #C5C9D1; }
.slot .icon { width: 15px; height: 15px; color: var(--accent); stroke-width: 2.2; }
.slot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.slot[aria-pressed="true"] .icon { color: var(--on-accent); }

/* ---------- Cookie banner (web-cookies) ---------- */
.cookie-banner { position: fixed; z-index: 1500; left: 0; right: 0; bottom: 24px; width: calc(100% - 48px); max-width: 1216px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; padding: 28px 32px; border-radius: 24px; background: var(--bg); box-shadow: 0 2px 6px rgba(18,24,38,.12), 0 24px 64px rgba(18,24,38,.28); }
.cookie-banner__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cookie-banner__title { font-size: var(--fs-2xl); line-height: 32px; font-weight: 800; }
.cookie-banner__body { font-size: 16px; line-height: 25px; font-weight: 500; color: var(--ink-2); }
.cookie-banner__body a { color: var(--red-strong); font-weight: 700; }
.cookie-banner__actions { flex: 1 1 520px; min-width: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.cookie-banner__actions .btn { flex: 1 1 150px; }
.cookie-row { display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cookie-row:first-child { border-top: 1px solid var(--line); }
.cookie-row__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cookie-row__title { font-size: 16px; font-weight: 700; }
.cookie-row__hint { font-size: var(--fs-md); line-height: 20px; font-weight: 500; color: var(--muted); }
@media (max-width: 720px) {
  .cookie-banner { bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100% - 24px); padding: 20px; gap: 14px; max-height: calc(100dvh - 100px); overflow-y: auto; }
  .cookie-banner__title { font-size: var(--fs-xl); line-height: 26px; }
  .cookie-banner__body { font-size: var(--fs-md); line-height: 21px; }
  .cookie-banner__actions .btn { flex: 1 1 100%; min-height: 48px; }
}

/* ---------- QR display ---------- */
.qr { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: var(--r-2xl); background: #fff; border: 1px solid var(--line); }
.qr img { width: var(--qr-size, 200px); height: var(--qr-size, 200px); image-rendering: pixelated; }
.qr__code { width: var(--qr-size, 200px); height: var(--qr-size, 200px); }
.qr__code svg { width: 100%; height: 100%; }
.qr__ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; font-weight: 800; letter-spacing: 0.06em; }
.qr__fallback { width: var(--qr-size, 200px); min-height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; border-radius: var(--r-lg); background: var(--bg-sunken); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }

/* ---------- Scanner ---------- */
.scanner { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-2xl); overflow: hidden; background: #0B1220; color: #fff; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner__frame { position: absolute; left: 50%; top: 50%; width: min(56%, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.scanner__frame::before, .scanner__frame::after { content: ""; position: absolute; inset: 0; border: 3px solid rgba(255,255,255,.95); border-radius: 18px; -webkit-mask: linear-gradient(#000 0 0) top/100% 22% no-repeat, linear-gradient(#000 0 0) bottom/100% 22% no-repeat; mask: linear-gradient(#000 0 0) top/100% 22% no-repeat, linear-gradient(#000 0 0) bottom/100% 22% no-repeat; }
.scanner__frame::after { -webkit-mask: linear-gradient(#000 0 0) left/22% 100% no-repeat, linear-gradient(#000 0 0) right/22% 100% no-repeat; mask: linear-gradient(#000 0 0) left/22% 100% no-repeat, linear-gradient(#000 0 0) right/22% 100% no-repeat; }
.scanner__line { position: absolute; left: 8%; right: 8%; height: 2px; background: #3EE08F; box-shadow: 0 0 12px #3EE08F; top: 50%; animation: bt-scanline 2.2s ease-in-out infinite; }
@keyframes bt-scanline { 0%, 100% { top: 14%; } 50% { top: 86%; } }
.scanner__hint { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-weight: 700; font-size: var(--fs-md); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.scanner__overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: #0B1220; }
.scanner__overlay p { color: #C9CFDA; max-width: 360px; }
.scanner__pill { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-pill); background: rgba(0,0,0,.45); font-size: var(--fs-xs); font-weight: 800; }
.scanner__overlay h3 { font-size: var(--fs-xl); color: #fff; }
.scanner__overlay .icon { color: #C9CFDA; }
.scanner__overlay .spinner { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
.scanner__dot { width: 8px; height: 8px; border-radius: 50%; background: #3EE08F; box-shadow: 0 0 0 3px rgba(62,224,143,.25); }
.scanner__controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; }
.scanner__btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-pill); border: 0; background: rgba(0,0,0,.5); color: #fff; }
.scanner__btn:hover { background: rgba(0,0,0,.7); }
.scanner__btn[aria-pressed="true"] { background: #fff; color: var(--ink); }
.scanner.is-paused video { filter: brightness(.45); }
.scanner.is-paused .scanner__frame { opacity: .5; }
.scan-result { border-radius: var(--r-2xl); border: 2px solid var(--line); padding: 18px 20px; background: var(--bg); }
.scan-result--valid { border-color: #2E9E62; background: #F3FBF6; }
.scan-result--used { border-color: #E2574C; background: #FFF6F5; }
.scan-result--not-found, .scan-result--wrong-day { border-color: #E8B04B; background: #FFFAF0; }
.scan-result__title { font-size: 26px; line-height: 1.2; font-weight: 800; }
.scan-result--valid .scan-result__title { color: var(--ok); }
.scan-result--used .scan-result__title { color: var(--bad); }
.scan-result--not-found .scan-result__title, .scan-result--wrong-day .scan-result__title { color: var(--warn); }

/* ---------- Mobile bottom sheet nav helpers ---------- */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--touch); height: var(--touch); border-radius: var(--r-lg); border: 0; background: transparent; color: var(--ink); }
.icon-btn:hover { background: var(--bg-sunken); }
.icon-btn--outline { border: 1.5px solid var(--line-strong); background: var(--bg); }

/* ---------- App shell (business dashboard and back office) ----------
   <div class="app"> <aside class="app-sidebar"> … </aside> <div class="app-backdrop"></div>
   <div class="app-main"> [test banner] <header class="app-header"> … </header> <main class="app-content"> … </main> </div> </div> */
.app { display: flex; align-items: flex-start; min-height: 100vh; }
.app-sidebar { position: sticky; top: 0; align-self: flex-start; flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; background: var(--bg); border-right: 1px solid var(--line); z-index: 120; }
.app-backdrop { display: none; }
.app-main { flex: 1 1 auto; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.app-header { position: sticky; top: 0; z-index: 90; min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 32px; background: var(--bg); border-bottom: 1px solid var(--line); }
.app-header__title { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-header__title h1 { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -0.01em; }
.app-header__sub { font-size: var(--fs-sm); line-height: 18px; font-weight: 600; color: var(--muted); }
.app-header .btn { min-height: 40px; padding: 0 16px; border-radius: var(--r-md); font-size: var(--fs-md); }
.app-search { display: flex; align-items: center; gap: 8px; height: 40px; width: 300px; max-width: 100%; padding: 0 12px; border-radius: var(--r-md); background: var(--bg-sunken); color: var(--muted); }
.app-search:focus-within { box-shadow: var(--focus); }
.app-search input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; font-size: var(--fs-md); font-weight: 500; color: var(--ink); }
.app-search input:focus-visible { box-shadow: none; }
.app-search .icon { width: 18px; height: 18px; }
.app-icon-btn { position: relative; width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--bg); color: var(--ink); text-decoration: none; }
.app-icon-btn:hover { background: var(--bg-head); text-decoration: none; }
.app-icon-btn__dot { position: absolute; top: 6px; right: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.app-menu-btn { display: none; }
.app-content { flex: 1 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 24px 32px 32px; min-width: 0; }
.app-content:focus { outline: none; }

.sidebar__brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 16px; }
.sidebar__brand-link { display: flex; flex-direction: column; gap: 8px; }
.sidebar__brand img { height: 26px; width: auto; }
.sidebar__tag { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: var(--navy); }
.app-sidebar .sidebar__close { display: none; }
.sidebar__card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; margin: 0 0 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-page); }
.sidebar__mark { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 800; flex-shrink: 0; text-transform: uppercase; }
.sidebar__card-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sidebar__card-name { font-size: var(--fs-md); line-height: 18px; font-weight: 800; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.sidebar__card-meta { font-size: var(--fs-xs); line-height: 16px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar__link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md); color: var(--ink-2); font-size: var(--fs-md); font-weight: 600; text-decoration: none; }
.sidebar__link:hover { background: var(--bg-page); color: var(--ink); text-decoration: none; }
.sidebar__link[aria-current="page"] { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.sidebar__label { flex: 1 1 auto; min-width: 0; }
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.sidebar__note { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-lg); background: var(--bg-page); border: 1px solid var(--line); }
.sidebar__note-title { font-size: var(--fs-sm); line-height: 18px; font-weight: 800; color: var(--ink); }
.sidebar__note-text { font-size: var(--fs-xs); line-height: 17px; font-weight: 500; color: var(--muted); }
.sidebar__note .btn--link { font-size: var(--fs-xs); align-self: flex-start; margin-top: 2px; }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.sidebar__user .avatar { width: 36px; height: 36px; background: var(--navy-soft); color: var(--navy); }
.sidebar__user-text { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.sidebar__user-name { font-size: var(--fs-md); font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-role { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.sidebar__icon-btn { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); border: 0; background: transparent; color: var(--muted); }
.sidebar__icon-btn:hover { background: var(--bg-sunken); color: var(--ink); }

@media (max-width: 900px) {
  .app { display: block; }
  .app-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: 100dvh; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: var(--shadow-lg); }
  .app.is-nav-open .app-sidebar { transform: none; visibility: visible; transition: transform .2s ease; }
  .app.is-nav-open .app-backdrop { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(18, 24, 38, 0.45); }
  .app-sidebar .sidebar__close { display: inline-flex; margin-left: auto; }
  .sidebar__brand { justify-content: flex-start; gap: 12px; }
  .app-menu-btn { display: inline-flex; }
  .app-header { min-height: 60px; gap: 10px; padding: 10px 16px; }
  .app-header__title { flex-basis: 120px; }
  .app-header__title h1 { font-size: 18px; line-height: 24px; }
  .app-search { display: none; }
  .app-content { gap: 16px; padding: 16px 16px 32px; }
}
@media (max-width: 560px) {
  .app-header__sub { display: none; }
  .app-header .btn .btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app-header .btn { width: 40px; padding: 0; }
}

/* Login pages fill the screen under the test banner without scrolling */
body.is-auth { display: flex; flex-direction: column; min-height: 100vh; }
body.is-auth > main { flex: 1 0 auto; display: flex; flex-direction: column; }
body.is-auth .admin-auth, body.is-auth .biz-auth { flex: 1 0 auto; min-height: 0; }

/* Panel headings inside app pages */
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { font-size: var(--fs-lg); font-weight: 800; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Test-site password gate (/beta, rendered by the server: server/src/http/beta.ts) ---------- */
.beta-gate { min-height: 100vh; min-height: 100dvh; background: var(--bg-page); }
.beta-gate__main { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.beta-gate__card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; padding: 32px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-2xl); box-shadow: 0 8px 24px rgba(18, 24, 38, 0.06); }
.beta-gate__logo { width: auto; height: 34px; align-self: flex-start; }
.beta-gate__head { display: flex; flex-direction: column; gap: 6px; }
.beta-gate__title { font-size: 24px; line-height: 30px; font-weight: 800; letter-spacing: -0.01em; }
.beta-gate__text { color: var(--muted); line-height: 1.5; }
@media (max-width: 420px) { .beta-gate__card { padding: 24px 20px; } }
