/* cardscan.css — Scan client details cards (cardscan.js). */

.cs-sheet [hidden] { display: none !important; }

.cs-open-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; margin: 0 0 var(--space-3);
  border: 1.5px dashed var(--brand-border); border-radius: var(--radius-btn, 10px);
  background: var(--brand-tint); color: var(--brand-text);
  font: 600 var(--text-sm)/1.2 var(--font-sans); cursor: pointer;
}
.cs-open-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.cs-sheet .cs-content { max-width: 520px; width: 100%; }
.cs-for { margin: calc(var(--space-2) * -1) 0 var(--space-3); font-size: var(--text-sm); color: var(--text-secondary); }
.cs-count { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: var(--success-tint); color: var(--success-text); font-weight: 600; }
.cs-count:empty { display: none; }

.cs-wait { min-height: 120px; display: grid; place-items: center; text-align: center; color: var(--text-secondary); }
.cs-wait p { margin: 0; max-width: 34ch; line-height: 1.5; }

.cs-keypanel p { font-size: var(--text-sm); line-height: 1.5; color: var(--text-secondary); }
.cs-keypanel .ub-add-btn { width: 100%; }

.cs-video-wrap {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: #000; aspect-ratio: 4 / 3;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.cs-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cs-frame {
  position: absolute; inset: 6% 3%; border: 2px solid rgba(255,255,255,0.9);
  border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,0.25);
  aspect-ratio: 7 / 4; margin: auto; height: auto;
}
.cs-hint { margin: var(--space-2) 0; font-size: var(--text-sm); color: var(--text-secondary); text-align: center; }
.cs-hint--bad { color: var(--danger-text); font-weight: 600; }

.cs-read-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; border: 0; border-radius: var(--radius-btn, 10px);
  background: var(--grad-brand-btn); color: #fff;
  font: 700 var(--text-base)/1.2 var(--font-sans); cursor: pointer;
}
.cs-read-btn:disabled { opacity: 0.55; cursor: default; }
.cs-privacy { margin: var(--space-3) 0 0; font-size: var(--text-xs, 12px); color: var(--text-tertiary); line-height: 1.45; }

.cs-check { margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--text-secondary); }
.cs-row { margin-bottom: var(--space-3); border-radius: var(--radius-md); }
.cs-row--unsure input { border-color: var(--warn) !important; background: var(--warn-tint); }
.cs-row--unsure > label::after { content: " · check this"; color: var(--warn-text); font-weight: 600; }

.cs-pay { display: flex; gap: var(--space-2); }
.cs-pay .ub-chip { flex: 1 1 0; }
.cs-pay .ub-chip[aria-checked="true"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.cs-pay.cs-row--unsure .ub-chip[aria-checked="false"] { border-color: var(--warn); }

.cs-namepick {
  margin: calc(var(--space-2) * -1) 0 var(--space-3); padding: var(--space-3);
  border: 1.5px solid var(--warn-border); border-radius: var(--radius-md); background: var(--warn-tint);
}
.cs-namepick--need { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.cs-namepick__q { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--warn-text); font-weight: 600; line-height: 1.4; }
.cs-namepick__opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.cs-namepick__opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 56px; padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-primary); cursor: pointer; font-family: var(--font-sans);
}
.cs-namepick__opt span { font-size: var(--text-xs, 12px); color: var(--text-tertiary); }
.cs-namepick__opt strong { font-size: var(--text-base); overflow-wrap: anywhere; }
.cs-namepick__opt[aria-checked="true"] { border-color: var(--ink-900); background: var(--ink-900); color: #fff; }
.cs-namepick__opt[aria-checked="true"] span { color: rgba(255,255,255,0.75); }

.cs-notes p { margin: 0 0 var(--space-2); font-size: var(--text-sm); line-height: 1.45; color: var(--text-secondary); }
.cs-bad { color: var(--danger-text); font-weight: 600; }

.cs-actions { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2); margin-top: var(--space-3); }
.cs-again-btn {
  min-height: 52px; padding: 0 var(--space-4); border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-btn, 10px); background: var(--surface); color: var(--text-primary);
  font: 600 var(--text-sm)/1.2 var(--font-sans); cursor: pointer;
}

@media (max-width: 380px) {
  .cs-namepick__opts { grid-template-columns: 1fr; }
}

/* Who did it and the day of service, picked on each card (remembered). */
.cs-label { display: block; margin-bottom: 6px; font-size: var(--text-xs, 12px); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); }
.cs-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cs-chips .ub-chip { min-height: 40px; padding: 0 var(--space-3); }
.cs-chips .ub-chip[aria-checked="true"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.cs-chips .ub-chip[aria-checked="true"] i { color: var(--gold-300); }
.cs-row--unsure .cs-chips .ub-chip[aria-checked="false"] { border-color: var(--warn); }
.cs-row--unsure > .cs-label::after { content: " · pick one"; color: var(--warn-text); }
.cs-day-note { margin: 6px 0 0; font-size: var(--text-sm); color: var(--info-text); }
.cs-day-note:empty { display: none; }

/* Header button: icon on phones, icon + words on wider screens. */
.cs-head-label { margin-left: 6px; font-weight: 600; }
@media (max-width: 760px) { .cs-head-label { display: none; } }

/* "Scan cards" at the front of the category row: Super Admin, and staff
   ticked "Can scan cards" (body.gk-can-scan, set in cardscan.js). */
/* The id is needed: index.css forces "#category-tabs .category-tab" to show on phones. */
body:not(.gk-can-scan) .category-tab.category-tab--scan,
body:not(.gk-can-scan) #category-tabs .category-tab.category-tab--scan { display: none !important; }
body.gk-can-scan .category-tab.category-tab--scan {
  background: var(--brand-tint) !important; border-color: var(--brand-border) !important; color: var(--brand-text) !important;
  font-weight: 700;
}
body.gk-can-scan .category-tab.category-tab--scan i { color: var(--brand) !important; }

/* Installed phone app: the header and the category row are hidden on the
   billing screen to make room for tiles, so neither "Scan cards" above is
   seen. This one sits beside Custom Item, which the phone app does show. */
.btn-quick-custom-item.cs-quick-scan { display: none; }
@media (display-mode: standalone) {
  body.gk-can-scan .btn-quick-custom-item.cs-quick-scan {
    display: inline-flex !important; /* beats settings.css when Custom Item is switched off */
    background: var(--brand-tint); border-color: var(--brand-border); color: var(--brand-text); font-weight: 700;
  }
  body.gk-can-scan .btn-quick-custom-item.cs-quick-scan i { color: var(--brand); }
}

/* Reading by itself: a bar along the bottom of the picture fills while the
   card is held still. */
.cs-auto-bar {
  position: absolute; left: 0; bottom: 0; height: 6px; width: 100%;
  background: linear-gradient(90deg, var(--success, #1a9e5c) calc(var(--p, 0) * 100%), transparent 0);
  transition: background 0.2s linear;
}
.cs-auto-opt { display: flex; align-items: center; gap: 8px; margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--text-secondary); }
.cs-auto-opt input { width: 18px; height: 18px; accent-color: var(--brand); }

/* Why Save did not save: visible, right above the button. */
.cs-save-msg {
  margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); background: var(--danger-tint); color: var(--danger-text);
  font-size: var(--text-sm); font-weight: 600; line-height: 1.4;
}
@keyframes csFlash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 4px var(--danger-tint); } }
.cs-flash { animation: csFlash 0.9s ease 2; border-radius: var(--radius-md); }
.cs-field-hint { margin: 4px 0 0; font-size: var(--text-xs, 12px); color: var(--text-tertiary); }

/* Saved: a short celebration over the sheet, then the camera for the next card. */
.cs-sheet .cs-content { position: relative; }
.cs-cele {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  pointer-events: none; border-radius: inherit; overflow: hidden;
  background: rgba(255, 255, 255, 0); transition: background 0.2s ease;
}
.cs-cele.is-on { background: rgba(255, 255, 255, 0.72); }
.cs-cele__confetti { position: absolute; inset: 0; width: 100%; height: 100%; }
.cs-cele__card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--space-4) var(--space-5, 24px); border-radius: 20px;
  background: var(--surface, #fff); box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  transform: scale(0.6); opacity: 0;
}
.cs-cele.is-on .cs-cele__card { animation: csCelePop 0.45s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.cs-cele__tick {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--success, #059669); color: #fff; font-size: 30px; margin-bottom: 6px;
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.45);
}
.cs-cele.is-on .cs-cele__tick { animation: csCeleRing 1.1s ease-out 0.2s; }
.cs-cele__title { font: 800 1.35rem/1.1 var(--font-sans); color: var(--text-primary); }
.cs-cele__line { font-size: var(--text-base); font-weight: 600; color: var(--text-secondary); }
.cs-cele__count { margin-top: 2px; padding: 2px 10px; border-radius: 99px; background: var(--success-tint); color: var(--success-text); font-size: var(--text-sm); font-weight: 700; }
@keyframes csCelePop { to { transform: scale(1); opacity: 1; } }
@keyframes csCeleRing { 0% { box-shadow: 0 0 0 0 rgba(5,150,105,.45); } 100% { box-shadow: 0 0 0 26px rgba(5,150,105,0); } }
@media (prefers-reduced-motion: reduce) {
  .cs-cele.is-on .cs-cele__card { animation: none; transform: none; opacity: 1; }
  .cs-cele.is-on .cs-cele__tick { animation: none; }
}

/* My Stats → Staff Member → "Scanned cards": only the picker and the list. */
.mystats-layout.is-cards > :not(.mystats-hero):not(.mystats-cards) { display: none !important; }
.mystats-layout.is-cards .mystats-hero > :not(h3):not(.mystats-hero-icon):not(.mystats-period-bar) { display: none !important; }
.mystats-layout.is-cards .mystats-period-bar > .period-field:not(#mystats-staff-select-wrap) { display: none !important; }
.mystats-cards[hidden] { display: none !important; }
.cs-days { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cs-days__month { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; color: #A6005B; padding: 10px 2px 2px; border-bottom: 1px solid rgba(166,0,91,.18); }
.cs-days__day { border: 1px solid var(--border-color, #eadde4); border-radius: 12px; background: var(--surface, #fff); }
.cs-days__day summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 44px; }
.cs-days__day summary::-webkit-details-marker { display: none; }
.cs-days__date { font-weight: 600; flex: 1; }
.cs-days__n { font-size: 13px; color: var(--text-muted, #6b6470); }
.cs-days__sum { font-weight: 700; min-width: 72px; text-align: right; }
.cs-days__day ul { list-style: none; margin: 0; padding: 0 14px 10px; }
.cs-days__day li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--border-color, #eadde4); font-size: 14px; }
.cs-days__day li small { color: var(--text-muted, #6b6470); margin-left: 4px; }
.cs-days__head h3 { margin: 0; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.cs-days__head h3 i { color: #A6005B; }
.cs-days__head p { margin: 4px 0 6px; font-size: 14px; color: var(--text-muted, #6b6470); }
.cs-days__head strong { font-size: 15px; }

/* Scanned cards: as scanned / by date, and Change date (Uma, 2026-11-10). */
.cs-days__tabs { display: flex; gap: 6px; margin-top: 12px; background: rgba(166,0,91,.07); border-radius: 999px; padding: 4px; }
.cs-days__tabs button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 9px 10px; font: inherit; font-weight: 600; font-size: 14px; color: #6b2a4c; cursor: pointer; min-height: 40px; }
.cs-days__tabs button[aria-selected="true"] { background: #fff; color: #A6005B; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.cs-days__warn { color: #9a5b00; font-size: 13px; margin: 8px 0 0; }
.cs-days__note { margin: 0 14px 4px; font-size: 13px; color: var(--text-muted, #6b6470); }
.cs-days__wait { color: var(--text-muted, #6b6470); }
.cs-days__day ol { list-style: none; margin: 0; padding: 0 14px 10px; }
.cs-card-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "n who amt" "n move move"; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--border-color, #eadde4); font-size: 14px; }
.cs-days__day li.cs-card-row { display: grid; }
.cs-card-row__n { grid-area: n; align-self: start; min-width: 26px; height: 26px; border-radius: 50%; background: rgba(166,0,91,.1); color: #A6005B; font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.cs-card-row__who { grid-area: who; font-weight: 600; }
.cs-card-row__who small { font-weight: 400; color: var(--text-muted, #6b6470); }
.cs-card-row__day { display: block; margin-top: 2px; }
.cs-card-row__amt { grid-area: amt; font-weight: 700; text-align: right; }
.cs-card-row__amt small { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted, #6b6470); }
.cs-card-row__move { grid-area: move; justify-self: start; min-height: 36px; }
.cs-move { margin: auto; inset: 0; position: fixed; border: 0; border-radius: 16px; padding: 0; width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.cs-move::backdrop { background: rgba(20,10,20,.45); }
.cs-move__box { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.cs-move__box h3 { margin: 0; font-size: 18px; }
.cs-move__who { margin: 0; font-size: 15px; line-height: 1.5; }
.cs-move__label { font-weight: 600; font-size: 14px; }
.cs-move__day { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--border-color, #d8c9d1); border-radius: 10px; min-height: 44px; }
.cs-move__paid { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; align-items: center; }
.cs-move__paid[hidden] { display: none; }
.cs-move__paid legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.cs-move__paid label { display: flex; gap: 6px; align-items: center; font-size: 15px; min-height: 40px; }
.cs-move__msg { color: #b3261e; font-size: 14px; margin: 0; }
.cs-move__btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.cs-move__btns .btn { min-height: 44px; }
.cs-move__amtbox { display: flex; flex-direction: column; gap: 6px; }
.cs-move__amtbox[hidden] { display: none; }
.cs-move__btns { flex-wrap: wrap; }
.cs-move__gap { flex: 1; }
.cs-move__del { color: #b3261e; border-color: #e3b2ad; }
.cs-move__del[data-sure="1"] { background: #b3261e; color: #fff; border-color: #b3261e; }
.cs-move__hint { font-size: 12px; color: var(--text-muted, #6b6470); }
.cs-check { width: min(480px, calc(100vw - 32px)); }
.cs-check__list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.cs-check__day { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; cursor: pointer; }
.cs-check__day input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.cs-check__day span { display: flex; flex-direction: column; gap: 2px; }
.cs-check__day small { color: var(--text-secondary, #666); line-height: 1.4; }
