/* HR touch surface — the clock-in desk (.cid*) and the phone scan page (.cis*).
   These rules lived in ClockInDesk.razor.css / ClockInScan.razor.css as SCOPED css, which
   never reached any host bundle: scoped .razor.css in a referenced project is not collected
   into the head's <App>.styles.css, so both screens have been rendering unstyled. Shipping
   them as a plain wwwroot stylesheet at _content/SPC.Blazor.HR.Touch/hr-touch.css is what
   makes them apply for the first time. Tokens (--touch-*) come from each head's own touch
   theme sheet, so the café keeps its espresso palette and the salon keeps its own. */

/* ── clock-in desk ─────────────────────────────────────────────────────────── */
/* Clock-in counter screen, inside the café touch shell: home button top-left, the live date on
   top, big QR on the left, tap-to-PIN roster on the right.

   Colour comes entirely from the shell's --touch-* tokens (cafe-touch.css), so day and night roast
   both work and no colour literal lives here. The two panels carry .touch-glass in the markup for
   their frosted surface — this file lays them out and never restates their background, so the two
   rules can't fight over specificity. */

.cid {
    /* "On shift" is the one state the shared tokens don't name. Kept as a single local token so
       the night roast can be given its own value in one place if it ever needs one. */
    --cid-on: #2f8f5b;

    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Pinned to the viewport rather than growing with the roster. A salon with fifty technicians
       used to make this page taller than the screen, and because the QR panel is centred in the
       column it slid down out of sight. The screen now owns exactly one viewport and the names
       scroll inside their own panel. */
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
    /* The standard touch-page frame, same as the kiosk launcher (.kioskpick): a wider, viewport-
       scaled gutter than the flat 24px this screen used to carry, so it lines up with every other
       full-bleed touch page instead of sitting tight against the edge. */
    padding: 24px clamp(18px, 4vw, 56px) 40px;
}

/* Header row: home + title on the left, the clock where the launcher puts its Setup pill. The home
   button used to be absolutely positioned in the corner, overlapping the content and ignoring the
   page gutter; inline in a flex row it lands on the same baseline as the title, like everywhere else. */
.cid__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.cid__head-l { display: flex; align-items: center; gap: 14px; }

.cid__datebar {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--touch-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Page-level subtitle, the counterpart of .kioskpick__sub — it describes both columns (scan the
   code OR tap a name), so it belongs to the page rather than to the QR panel. */
.cid__sub { margin: 0 0 22px; color: var(--touch-muted); font-size: 1rem; }

.cid__cols { flex: 1; min-height: 0; display: flex; gap: 24px; align-items: stretch; }

/* Sized to its contents, not to half the screen: the code only has to be big enough for a phone
   camera at arm's length, and every pixel it doesn't take is another technician's name on screen.
   Top-anchored, so it stays where the eye expects however tall the row grows. */
.cid__qr {
    flex: 0 0 auto;
    width: clamp(220px, 22vw, 300px);
    align-self: flex-start;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 18px;
}

/* Matches .kioskpick__title — the page title now sits in the header row, not inside the QR panel. */
.cid__title { margin: 0; font-size: 1.9rem; font-weight: 800; color: var(--touch-ink); }

/* White plate behind the symbol. The cream gradient and the slideshow both sit behind the frosted
   panel, and a QR needs a genuinely white quiet zone to scan reliably. */
.cid__img {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 1 / 1;
    height: auto;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
}

/* The URL under the QR is the fallback for a phone whose camera won't focus — deliberately quiet. */
.cid__url {
    max-width: 90%;
    word-break: break-all;
    text-align: center;
    color: var(--touch-hint);
    font-size: 0.8rem;
}

/* Deliberately quiet: scanning the code above is the primary path, and the badge reader is the
   alternative for whoever has a pass in their wallet. */
.cid__badge-link {
    margin-top: 4px;
    color: var(--touch-muted);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Takes every pixel the QR panel leaves. It does not scroll itself — .cid__roster-list does — so
   the "On shift" header and the manager selection bar stay visible over a long roster. */
.cid__roster {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    overflow: hidden;
}

/* Names flow into as many ~300px columns as the panel affords, so a big salon reads at a glance
   instead of one long scroll; whatever still doesn't fit scrolls here and nowhere else. */
.cid__roster-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Multi-column rather than a grid, because the reading order is the point: an alphabetical roster
   has to run DOWN each column and then across, the way a printed staff list does. A grid would
   deal the names out row-first (A, B across, then C, D), which is the same order but the wrong
   shape to search with a finger. Column height balances itself, so the columns stay even. */
.cid__roster-cols {
    columns: 280px;
    column-gap: 24px;
}

.cid__roster-h { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; color: var(--touch-ink); }
.cid__roster-title { white-space: nowrap; }
.cid__count {
    min-width: 26px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--cid-on);
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---- Manager bulk clock-in ---- */

.cid__mgr-btn {
    -webkit-appearance: none;
    appearance: none;
    margin-left: auto;
    border: 1px solid var(--touch-control-border);
    border-radius: 999px;
    background: var(--touch-control);
    color: var(--touch-accent);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 7px 14px;
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
}
.cid__mgr-btn:not(:disabled):hover { filter: brightness(0.97); }

.cid__mgr-badge {
    margin-left: auto;
    border-radius: 999px;
    background: var(--touch-accent-fill, var(--touch-accent));
    color: var(--touch-on-accent);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    white-space: nowrap;
}
.cid__mgr-hint { color: var(--touch-accent); font-size: 0.9rem; font-weight: 600; padding: 2px 2px 4px; }

.cid__check {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 6px;
    border: 2px solid var(--touch-control-border);
    background: var(--touch-control);
    box-sizing: border-box;
    position: relative;
}
.cid__check.is-on { background: var(--touch-accent-fill, var(--touch-accent)); border-color: transparent; }
.cid__check.is-on::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--touch-on-accent);
    font-size: 0.85rem;
    font-weight: 900;
}

/* Action bar at the foot of the roster while selecting. It is a sibling of the scrolling name
   list rather than sticky inside it, so it simply never leaves the screen. */
.cid__selbar {
    flex: 0 0 auto;
    margin: 8px -20px -20px;
    padding: 14px 20px;
    display: flex;
    gap: 10px;
    background: var(--touch-tile-alt);
    border-top: 1px solid var(--touch-line);
}
.cid__selbar-go {
    flex: 1;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: var(--touch-accent-fill, var(--touch-accent));
    color: var(--touch-on-accent);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}
.cid__selbar-go:disabled { opacity: 0.45; cursor: default; }
.cid__selbar-done {
    height: 52px;
    padding: 0 20px;
    border: 1px solid var(--touch-control-border);
    border-radius: 12px;
    background: var(--touch-control);
    color: var(--touch-ink);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.cid__flash {
    background: color-mix(in srgb, var(--cid-on) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--cid-on) 45%, transparent);
    color: var(--cid-on);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 600;
}
.cid__empty { color: var(--touch-hint); font-size: 1rem; padding: 12px 2px; }

/* ---- Roster row ----
   Full strength means "this row is live to a tap", not "this person is on shift". Normally the two
   agree and the off-the-clock names recede. In manager mode they invert: the off-shift names are
   the ones being picked, so they come forward and the on-shift rows — which the mode cannot act on
   — are the ones that recede. The projector decides which it is and sends .is-dim; nothing here
   re-derives it from the shift state, which is how the picking list came to be the greyed one. */

.cid__row {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--touch-line);
    display: flex;
    /* Never let a column break cut a name in half. */
    break-inside: avoid;
    align-items: center;
    gap: 12px;
    /* ~56px tall: the 40px avatar disc sets the height now, so the padding only has to keep the
       rows from touching. Still a comfortable finger target. */
    padding: 8px 4px;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
}
.cid__row:not(:disabled):hover { background: var(--touch-control); border-radius: 10px; }
.cid__row:disabled { cursor: default; }
/* Picked. Deliberately louder than :hover — on a tablet there is no hover, so this is the only
   feedback that a tap landed, and it has to read across the room. */
.cid__row.is-sel {
    background: var(--touch-control);
    border-radius: 10px;
    box-shadow: inset 3px 0 0 0 var(--touch-accent-fill, var(--touch-accent));
}

/* The face beside the name. It replaced the plain status dot, so it carries the state itself:
   a solid on-shift ring, a flat hairline for anyone off the clock. Sized in one place — the
   photo and the monogram share the disc, so they can never disagree about it. */
.cid__av {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 999px;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--touch-control);
    border: 2px solid var(--touch-line);
}
.cid__av.is-in { border-color: var(--cid-on); }
.cid__av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cid__av-mono {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--touch-muted);
    /* The disc is round and the ring is 2px — nudge nothing else, just keep the two letters
       optically centred whatever the head's font is. */
    line-height: 1;
}

.cid__name { flex: 1; font-size: 1.15rem; font-weight: 700; color: var(--touch-ink); }
.cid__since { font-size: 0.9rem; color: var(--touch-hint); font-variant-numeric: tabular-nums; }
/* The job somebody is on. Sits under the arrival time, quieter than the name and dimmer than the
   time — it is context for a row a manager is scanning, not something they are looking for. */
.cid__position { font-size: 0.8rem; color: var(--touch-hint); opacity: 0.75; }

.cid__row.is-dim { opacity: 0.5; }

/* ---- PIN / confirm modal ---- */

.cid-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(43, 33, 26, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
/* Surface comes from .touch-glass--solid in the markup; this is size and stacking only. */
.cid-modal__card {
    width: 360px;
    max-width: 92vw;
    max-height: 92vh;
    overflow: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.cid-modal__h { font-size: 1rem; font-weight: 800; color: var(--touch-accent); text-transform: uppercase; letter-spacing: 0.05em; }
.cid-modal__who { font-size: 1.6rem; font-weight: 800; color: var(--touch-ink); text-align: center; }
.cid-modal__sub { font-size: 0.95rem; color: var(--touch-muted); text-align: center; }
.cid-modal__err { color: #b3123c; font-size: 0.95rem; font-weight: 600; }
.cid-modal__cancel {
    margin-top: 6px;
    background: none;
    border: none;
    color: var(--touch-muted);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    touch-action: manipulation;
}

.cid-modal__actions { display: flex; gap: 12px; width: 100%; margin-top: 8px; }
.cid-modal__btn { flex: 1; height: 52px; border-radius: 12px; border: none; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.cid-modal__btn--ghost { background: var(--touch-control); color: var(--touch-ink); }
.cid-modal__btn--danger { background: var(--touch-accent-fill, var(--touch-accent)); color: var(--touch-on-accent); }

/* ---- Turn order (salon: the order a manager clocks techs in is the order of their turns) ---- */

/* The turn slot on a row: an empty ring until picked, then the number that name goes in at. A
   number, not a tick — the order is the point, and it has to read across the room. */
.cid__turn {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px dashed var(--touch-control-border);
    background: var(--touch-control);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--touch-on-accent);
}
.cid__turn.is-on { background: var(--touch-accent-fill, var(--touch-accent)); border: 2px solid transparent; }

.cid-modal__card--wide { width: 460px; }
.cid-order {
    list-style: none;
    margin: 8px 0 4px;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 52vh;
    overflow: auto;
}
.cid-order__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 12px;
    background: var(--touch-control);
}
.cid-order__name { flex: 1; min-width: 0; font-weight: 700; color: var(--touch-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cid-order__mv {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid var(--touch-control-border);
    background: var(--touch-tile-alt, var(--touch-control));
    color: var(--touch-ink);
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    touch-action: manipulation;
}
.cid-order__mv:disabled { opacity: 0.3; cursor: default; }
.cid-order__rm { color: var(--touch-muted, var(--touch-ink)); }

/* ---- Manager picker (who is unlocking) ---- */

.cid-mgr-list { display: flex; flex-direction: column; gap: 8px; width: 100%; margin: 4px 0; }
.cid-mgr-tile {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--touch-control-border);
    border-radius: 12px;
    background: var(--touch-control);
    color: var(--touch-ink);
    font: inherit;
    padding: 12px 14px;
    cursor: pointer;
    touch-action: manipulation;
}
.cid-mgr-tile:hover { filter: brightness(0.97); }
.cid-mgr-tile__name { font-size: 1.1rem; font-weight: 800; }
.cid-mgr-tile__role { font-size: 0.85rem; color: var(--touch-muted); }

/* A phone or a portrait tablet can't hold two columns: stack them and hand the scrolling back to
   the page, so the QR sits above the roster and both are reachable by scrolling as normal. */
@media (max-width: 900px) {
    .cid { padding: 16px; height: auto; max-height: none; min-height: 100dvh; overflow: visible; }
    .cid__cols { flex-wrap: wrap; }
    .cid__qr { flex: 1 1 100%; width: auto; align-self: stretch; }
    .cid__roster { flex: 1 1 100%; overflow: visible; }
    .cid__roster-list { overflow: visible; }
}

/* A phone: the date can't share a row with the title — "Clock In" squeezed onto two lines and the
   nowrap date ran off the right edge. Title row first, the date on its own line under it. */
@media (max-width: 640px) {
    .cid__head { flex-wrap: wrap; gap: 4px 16px; }
    .cid__title { font-size: 1.6rem; white-space: nowrap; }
    .cid__datebar { flex: 1 1 100%; font-size: 1rem; white-space: normal; }
}

/* ── phone scan page ───────────────────────────────────────────────────────── */
/* Barista clock-in scan (phone), inside the café touch shell: one centred card — camera, then
   result. Same --touch-* tokens as the counter screen so the two read as one feature; the card's
   frosted surface comes from .touch-glass in the markup. */

.cis {
    min-height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cis__panel {
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 28px 22px;
}

/* The result states earn a coloured edge: this is read at arm's length, mid-rush, and the answer
   has to land before the words do. */
.cis__panel.is-in { border-color: #2f8f5b; }
.cis__panel.is-out { border-color: #c9a227; }

.cis__panel h1 { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--touch-ink); }
.cis__sub { margin: 0; font-size: 1rem; color: var(--touch-muted); }
.cis__hint { margin: 0; font-size: 0.9rem; color: var(--touch-hint); }
.cis__ic { font-size: 2.6rem; line-height: 1; }
.cis__time { font-size: 1.6rem; font-weight: 800; color: var(--touch-ink); font-variant-numeric: tabular-nums; }

.cis__video {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    background: #111;
}
.cis__video.is-hidden { display: none; }

.cis__err {
    width: 100%;
    box-sizing: border-box;
    color: #b3123c;
    background: color-mix(in srgb, #b3123c 8%, transparent);
    border: 1px solid color-mix(in srgb, #b3123c 35%, transparent);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.cis__btn {
    -webkit-appearance: none;
    appearance: none;
    min-height: 54px;
    padding: 0 26px;
    border-radius: 14px;
    border: none;
    background: var(--touch-accent-fill, var(--touch-accent));
    color: var(--touch-on-accent);
    font: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cis__btn--ghost {
    background: var(--touch-control);
    border: 1px solid var(--touch-control-border);
    color: var(--touch-ink);
}
