/* ============================================================================
   ClockBot staff — the staff app's sheet

   Loaded after Tabler and clockbot.css on every staff page (and the manager's
   preview frame), and built on the shared --cb-* tokens in clockbot.css, so
   the staff app wears the manager portal's palette and type. Tabler's own
   variables are re-pointed at the tokens under body.staff-portal, which carries
   every stock component (buttons, inputs, badges, links) with it; the rest is
   the staff shell — ink top bar, menu drawer, bottom tabs — and its pages.
   ========================================================================== */

/* Tabler's .modal-blur frosts the whole page behind the dialog via
   backdrop-filter: blur() — a GPU-heavy composite that janks on the low-end
   phones the staff portal targets. Drop it for staff only; the semi-transparent
   backdrop still dims the page. Managers (on desktops) keep the frosted look. */
body.staff-portal .modal-blur {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Drop the modal's drop-in slide on staff: Tabler eases .modal-dialog down from
   translate(0, -1rem) over .3s on open. Remove the offset + transition so the
   dialog appears in place; the .15s opacity fade is kept. */
body.staff-portal .modal.fade .modal-dialog {
  transform: none;
  transition: none;
}

/* And drop the opacity fade-in: the dialog and its backdrop appear at once, no
   .15s fade. The backdrop is a body child too, so the staff scope still holds. */
body.staff-portal .modal.fade,
body.staff-portal .modal-backdrop.fade {
  transition: none;
}

/* Staff alert + confirm modals render as a bottom sheet — the native mobile
   idiom. The markup is staff-specific (templates/staff/_notify_modal +
   _confirm_modal), so it and the manager's shared partial change
   independently. */
body.staff-portal .staff-sheet .modal-dialog {
  align-items: flex-end; /* override modal-dialog-centered */
  min-height: 100%;
  margin: 0;
  max-width: none;
}
body.staff-portal .staff-sheet .modal-content {
  width: 100%;
  border-radius: var(--cb-r-2xl) var(--cb-r-2xl) 0 0;
  border-bottom: 0;
}

/* A confirm/error is a decision point, not a content modal: one centred column
   — icon disc → title → message — the native iOS/Material alert idiom. The
   .modal-body's own symmetric padding lays it out, so there's nothing to
   un-skew (no header padding, no close-button reservation). */
body.staff-portal .staff-sheet .sheet-alert {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding-top: 1.75rem;
}

/* Icon sits in a soft tinted disc — the Material/iOS alert-glyph treatment; a
   bare stroked icon floating in space reads unfinished. The disc carries the
   tint, the glyph the solid intent colour. */
body.staff-portal .staff-sheet .sheet-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}
body.staff-portal .staff-sheet .sheet-alert-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
body.staff-portal #notify-modal .sheet-alert-icon {
  color: var(--tblr-danger);
  background: var(--tblr-danger-lt);
}
body.staff-portal #confirm-modal .sheet-alert-icon {
  color: var(--tblr-primary);
  background: var(--tblr-primary-lt);
}
body.staff-portal .staff-sheet .sheet-alert-title {
  margin: 0;
  font-size: var(--cb-fs-xl);
  font-weight: 600;
}

/* Full-width buttons in the thumb zone: stack them (primary on top), pad them
   up to a comfortable tap target, and clear the home-bar / notch inset. */
body.staff-portal .staff-sheet .modal-footer {
  flex-direction: column-reverse;
  flex-wrap: nowrap;
  gap: 0.5rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
body.staff-portal .staff-sheet .modal-footer > .btn {
  width: 100%;
  margin: 0;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Re-introduce a short slide-up — the sheet's signature motion. A translateY on
   a single element is GPU-cheap (it was the backdrop blur, not the transform,
   that janked low-end phones), so this stays true to the perf intent above. The
   ID selectors outrank the staff "no slide" rule, restoring it for these two. */
body.staff-portal .staff-sheet.modal.fade .modal-dialog {
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
}
body.staff-portal .staff-sheet.modal.show .modal-dialog {
  transform: none;
}

/* A form sheet: one bar of Cancel, the title and the action, as a phone's
   own forms are, over a body that scrolls when the form outgrows the
   screen. A drag down the bar lets it go (sheet_drag.js). */
body.staff-portal .staff-form-sheet .modal-dialog {
  height: 100%;
  min-height: 0;
  padding-top: calc(var(--staff-top-offset) + 8px);
}
body.staff-portal .staff-sheet.modal.fade .modal-dialog.cb-dragging {
  transition: none;
}
body.staff-portal .staff-form-sheet .modal-content {
  position: relative;
  max-height: 100%;
  overflow: hidden;
}
body.staff-portal .staff-form-sheet .modal-content::before {
  content: "";
  position: absolute;
  top: 7px;
  left: calc(50% - 19px);
  width: 38px;
  height: 4px;
  border-radius: var(--cb-r-2xs);
  background: var(--cb-line);
}
body.staff-portal .staff-form-sheet form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}
body.staff-portal .staff-form-sheet .modal-header {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 10px 12px;
  border-bottom: 1px solid var(--cb-line);
  background: #fff;
  color: var(--cb-text);
  touch-action: none;
}
body.staff-portal .staff-form-sheet .modal-title {
  margin: 0;
  font-size: var(--cb-fs-xl);
  font-weight: 600;
  color: var(--cb-text);
}
body.staff-portal .staff-form-sheet .modal-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}
.staff-sheet-btn {
  justify-self: start;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--cb-r-lg);
  background: transparent;
  color: var(--cb-ink-2);
  font: inherit;
  font-size: var(--cb-fs-md);
  font-weight: 600;
  cursor: pointer;
}
.staff-sheet-btn:active {
  background: var(--cb-hover);
}
.staff-sheet-btn--go {
  justify-self: end;
  padding: 0 16px;
  background: var(--cb-accent);
  color: #fff;
}
.staff-sheet-btn--go:active {
  background: var(--cb-accent-hover);
}

.progress-dots {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tblr-border-color);
}

.progress-dots .dot.active {
  background: var(--tblr-primary);
}

body.staff-portal {
  --tblr-primary: var(--cb-accent);
  --tblr-primary-rgb: var(--cb-accent-rgb);
  --tblr-primary-darken: var(--cb-accent-hover);
  --tblr-primary-fg: #fff;
  --tblr-primary-lt: var(--cb-accent-soft);
  --tblr-secondary: var(--cb-mid);
  --tblr-secondary-rgb: var(--cb-mid-rgb);
  --tblr-body-color: var(--cb-text);
  --tblr-body-color-rgb: var(--cb-text-rgb);
  --tblr-border-color: var(--cb-frame);
  --tblr-border-color-translucent: var(--cb-frame);
  --tblr-link-color: var(--cb-accent-ink);
  --tblr-link-color-rgb: var(--cb-accent-ink-rgb);
  --tblr-link-hover-color: var(--cb-accent-ink);
  --tblr-link-hover-color-rgb: var(--cb-accent-ink-rgb);
  --tblr-body-font-family: var(--cb-font);
  --staff-top-offset: calc(var(--cb-topbar-h) + env(safe-area-inset-top, 0px));  /* the bar as drawn */
  --staff-tabs-h: 64px;

  background: var(--cb-canvas);
  color: var(--cb-text);
  font-family: var(--cb-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Nothing animates until the page has loaded (staff_menu.js drops the
   class): iOS Safari otherwise runs transitions on the first paint — the
   Shifts button and its parked details sheet animated in on every load, and
   the status-bar tint went white for those frames. */
.staff-preload *,
.staff-preload *::before,
.staff-preload *::after {
  transition: none !important;
}
/* Clears the fixed top bar. The login pages share the class, not the bar. */
body.staff-portal:not(.login-body) {
  padding-top: var(--staff-top-offset);
}

.staff-portal .card {
  --tblr-card-box-shadow: none;
  --tblr-card-border-radius: 12px;
  --tblr-card-inner-border-radius: 11px;
}

.staff-portal .btn-primary {
  --tblr-btn-color: #fff;
  --tblr-btn-bg: var(--cb-accent);
  --tblr-btn-border-color: var(--cb-accent);
  --tblr-btn-hover-color: #fff;
  --tblr-btn-hover-bg: var(--cb-accent-hover);
  --tblr-btn-hover-border-color: var(--cb-accent-hover);
  --tblr-btn-active-color: #fff;
  --tblr-btn-active-bg: var(--cb-accent-hover);
  --tblr-btn-active-border-color: var(--cb-accent-hover);
  --tblr-btn-disabled-color: #fff;
  --tblr-btn-disabled-bg: var(--cb-accent);
  --tblr-btn-disabled-border-color: var(--cb-accent);
  --tblr-btn-box-shadow: var(--cb-accent-shadow);
  border-radius: var(--cb-r-lg);
  font-weight: 600;
}

/* The login's country picker, folded into the phone field: the dial code
   shows, the native select lies over it so each platform opens its own list. */
.staff-dial {
  position: relative;
  gap: 4px;
  cursor: pointer;
}
.staff-dial svg {
  width: 16px;
  height: 16px;
  color: var(--cb-dim);
}
.staff-dial select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: var(--cb-fs-xl);
  cursor: pointer;
  appearance: none;
}
.staff-dial:focus-within {
  outline: 2px solid var(--cb-accent);
  outline-offset: -2px;
  z-index: 5;
}

.staff-sent-phone {
  color: var(--cb-accent-ink);
}

.staff-portal .form-label {
  color: var(--cb-label-tx);
  font-weight: 600;
}
.staff-portal .form-control,
.staff-portal .form-select {
  border-color: var(--cb-input-bd);
  border-radius: var(--cb-r-lg);
  color: var(--cb-input-tx);
}
.staff-portal .form-control::placeholder {
  color: var(--cb-input-ph);
}
.staff-portal .form-control:focus,
.staff-portal .form-select:focus {
  border-color: var(--cb-input-bd-focus);
  box-shadow: var(--cb-focus-ring);
}

/* ------------------------------------------------------------- top bar -- */
.staff-topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1020;
  height: var(--staff-top-offset);
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cb-ink);
  color: var(--cb-t-bright);
}
.staff-burger {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  margin: 0 -8px 0 auto;
  border: 0;
  border-radius: var(--cb-r-lg);
  background: transparent;
  color: var(--cb-t-bright);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease;
}
.staff-burger:active {
  background: var(--cb-hair);
}
.staff-burger:focus-visible {
  outline: 2px solid var(--cb-accent);
  outline-offset: 2px;
}
.staff-burger-dot {
  position: absolute;
  top: 10px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cb-fail);
  box-shadow: 0 0 0 2px var(--cb-ink);
}
.staff-mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--cb-r-lg);
  background: var(--cb-mark);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: var(--cb-mark-shadow);
}
.staff-mark svg {
  width: 17px;
  height: 17px;
}
.staff-word {
  font-size: var(--cb-fs-lg);
  font-weight: 650;
  letter-spacing: -0.01em;
}
/* --------------------------------------------------------------- drawer -- */
/* From the right, where its button is. */
.staff-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 1090;
  width: min(300px, 84vw);
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--cb-ink);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.22s ease,
    visibility 0s linear 0.22s;
  box-shadow: 0 24px 48px -12px rgba(var(--cb-shade-rgb), 0.5);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* The page holds still under the open drawer: a page that scrolls folds
   Android Chrome's address bar away, and the drawer and backdrop are resized
   only once it has, leaving the page uncovered at the foot meanwhile. */
body.staff-drawer-open {
  overflow: hidden;
}
body.staff-drawer-open .staff-drawer {
  transform: none;
  visibility: visible;
  transition: transform 0.22s ease;
}
.staff-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1089;
  background: rgba(var(--cb-shade-rgb), 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
body.staff-drawer-open .staff-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}
/* The person, and the close button where the menu button was: the head is
   the bar's height, so its rule is level with the bar's bottom edge. */
.staff-drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: var(--cb-topbar-h);
  padding: 0 0 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--cb-hair);
}
.staff-drawer:focus {
  outline: none;
}
.staff-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.staff-drawer-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--cb-r-lg);
  background: transparent;
  color: var(--cb-t-dim);
  font: inherit;
  font-size: var(--cb-fs-lg);
  font-weight: 500;
  text-decoration: none;
  text-align: start;
  width: 100%;
  cursor: pointer;
}
.staff-drawer-item svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.staff-drawer-item:hover,
.staff-drawer-item:active {
  background: var(--cb-rail-hover);
  color: var(--cb-t-bright);
  text-decoration: none;
}
.staff-drawer-item:focus-visible {
  outline: 2px solid var(--cb-accent);
  outline-offset: -2px;
}
.staff-drawer-item.active {
  background: var(--cb-hair);
  color: var(--cb-t-bright);
}
.staff-drawer-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--cb-fail);
  color: #fff;
  font-size: var(--cb-fs-2xs);
  font-weight: 650;
}
.staff-drawer-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--cb-r-lg);
  display: grid;
  place-items: center;
  background: var(--cb-avatar-bg);
  color: var(--cb-avatar-tx);
  font-size: var(--cb-fs-xs);
  font-weight: 650;
  letter-spacing: 0.02em;
}
.staff-drawer-name {
  font-size: var(--cb-fs-md);
  font-weight: 600;
  color: var(--cb-t-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------- bottom tabs -- */
.staff-tabs {
  position: fixed;
  inset: auto 0 0;
  z-index: 1000;
  display: flex;
  padding: 6px 8px env(safe-area-inset-bottom, 0px);
  background: var(--cb-canvas);
  border-top: 1px solid var(--cb-frame);
}
.staff-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 52px;
  padding: 2px 0 6px;
  color: var(--cb-dim);
  font-size: var(--cb-fs-2xs);
  font-weight: 600;
  text-decoration: none;
}
.staff-tab:hover {
  color: var(--cb-ink-2);
  text-decoration: none;
}
.staff-tab-ic {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.staff-tab-ic svg {
  width: 22px;
  height: 22px;
}
.staff-tab.active {
  color: var(--cb-accent-ink);
}
.staff-tab.active .staff-tab-ic {
  background: var(--cb-accent-soft);
}
.staff-nav-badge {
  position: absolute;
  top: -3px;
  right: 6px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--cb-r-lg);
  background: var(--cb-fail);
  border: 2px solid var(--cb-canvas);
  color: #fff;
  font-size: var(--cb-fs-3xs);
  font-weight: 700;
  line-height: 1;
}

/* ---------------------------------------------------------------- page -- */
/* Clears the fixed tabs. Not on body — its box is viewport-height and the
   wrapper overflows it, so a bottom padding there never reaches the content. */
.staff-portal .page-wrapper {
  padding-bottom: calc(var(--staff-tabs-h) + 16px + env(safe-area-inset-bottom, 0px));
}
.staff-portal .page-body {
  margin: 16px 0 0;
}
.staff-portal .page-body > .container-xl {
  padding-inline: 16px;
}

.staff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.staff-title {
  margin: 0;
  font-size: var(--cb-fs-h2);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--cb-text);
}
/* A page under a tab: its way back is a small button on a row of its own
   above the title, so the title keeps the page's full width. */
.staff-back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: -4px 0 12px;
  border-radius: var(--cb-r-lg);
  background: var(--cb-hover);
  color: var(--cb-ink-2);
}
.staff-back:hover,
.staff-back:active {
  background: var(--cb-line);
  color: var(--cb-text);
}
/* A title with a line under it — what a document is and who issued it. */
.staff-head-t {
  min-width: 0;
}
/* Its way back sits on the title's first line (32px), and a title that
   wraps runs on under it at the page's full width. */
.staff-head-t > .staff-back {
  float: left;
  width: 32px;
  height: 32px;
  margin: 0 10px 0 0;
}
.staff-head-s {
  margin-top: 4px;
  font-size: var(--cb-fs-sm);
  color: var(--cb-mid);
}

.staff-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--cb-accent);
  box-shadow: var(--cb-accent-shadow);
  color: #fff;
  font-size: var(--cb-fs-md);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.staff-add:hover,
.staff-add:active {
  background: var(--cb-accent-hover);
  color: #fff;
  text-decoration: none;
}

.staff-sec {
  margin: 22px 2px 8px;
  font-size: var(--cb-eyebrow-size);
  font-weight: var(--cb-eyebrow-weight);
  letter-spacing: var(--cb-eyebrow-track);
  text-transform: uppercase;
  color: var(--cb-dim);
}
.staff-sec:first-child {
  margin-top: 0;
}
/* A section of a long list: its heading pins under the top bar while its
   rows scroll, and the next section's heading pushes it off — the section
   is the heading's sticky range, so the hand-over needs no script. It
   bleeds to the page edge so the rows pass under it, not beside it. */
.staff-group > .staff-sec {
  position: sticky;
  top: var(--staff-top-offset);
  z-index: 2;
  margin: 12px -16px 0;
  padding: 10px 18px 8px;
  background: var(--cb-canvas);
}
.staff-group:first-of-type > .staff-sec {
  margin-top: 0;
}

/* A group of rows on one hairline frame — the app's list. */
.staff-list {
  border: 1px solid var(--cb-frame);
  border-radius: var(--cb-r-xl);
  background: var(--cb-canvas);
  overflow: hidden;
}
.staff-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  color: inherit;
  text-decoration: none;
}
.staff-list-row + .staff-list-row {
  border-top: 1px solid var(--cb-line);
}
.staff-list-main {
  flex: 1;
  min-width: 0;
}
.staff-list-t {
  display: block;
  font-size: var(--cb-fs-lg);
  font-weight: 600;
  color: var(--cb-text);
}
.staff-list-s {
  display: block;
  margin-top: 2px;
  font-size: var(--cb-fs-sm);
  color: var(--cb-mid);
}
.staff-list-act {
  flex: none;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--cb-r-md);
  background: var(--cb-hover);
  color: var(--cb-ink-2);
  font-size: var(--cb-fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.staff-list-act:hover {
  color: var(--cb-text);
  text-decoration: none;
}

.staff-tile {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--cb-r-lg);
  display: grid;
  place-items: center;
  background: var(--cb-accent-soft);
  color: var(--cb-accent-ink);
}
.staff-tile svg {
  width: 20px;
  height: 20px;
}
.staff-tile--ok {
  background: var(--cb-ok-bg);
  color: var(--cb-ok);
}
.staff-tile--warn {
  background: var(--cb-warn-bg);
  color: var(--cb-warn);
}
.staff-tile--fail {
  background: var(--cb-fail-bg);
  color: var(--cb-fail);
}
.staff-tile--quiet {
  background: var(--cb-hover);
  color: var(--cb-dim);
}

.staff-pill {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: var(--cb-fs-xs);
  font-weight: 650;
  white-space: nowrap;
  background: var(--cb-accent-soft);
  color: var(--cb-accent-ink);
}

.staff-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--cb-mid);
}
.staff-empty .staff-tile {
  margin: 0 auto 14px;
}
.staff-empty p {
  margin: 0 0 16px;
}

/* A decision waiting to be read, at the top of Home. */
.staff-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--cb-r-xl);
  background: var(--cb-accent-soft);
  color: var(--cb-text);
  font-size: var(--cb-fs-md);
  font-weight: 500;
  text-decoration: none;
}
.staff-notice + .staff-notice {
  margin-top: 8px;
}
.staff-notice:hover {
  color: var(--cb-text);
  text-decoration: none;
}
.staff-notice .staff-tile {
  background: var(--cb-canvas);
}
.staff-notice-main {
  min-width: 0;
}
.staff-notice-t {
  display: block;
}
.staff-notice-d {
  display: block;
  margin-top: 2px;
  font-size: var(--cb-fs-sm);
  font-weight: 400;
  color: var(--cb-ink-2);
  white-space: pre-line;
}
.staff-notice-chev {
  margin-left: auto;
  flex: none;
  color: var(--cb-accent-ink);
}

/* ------------------------------------------------------- home: the clock -- */
.clock-btn {
  display: block;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  border: none;
  position: relative;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  margin: 0 auto;
  padding: 0;
  color: #fff;
}
.clock-btn:active {
  transform: scale(0.95);
}
.clock-btn:focus-visible {
  outline: 3px solid var(--cb-accent);
  outline-offset: 4px;
}
.clock-btn .clock-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 0;
}
.clock-btn .clock-icon svg {
  width: 48px;
  height: 48px;
  display: block;
}
.clock-btn-in {
  background: linear-gradient(160deg, color-mix(in srgb, var(--cb-ok) 82%, #fff), var(--cb-ok));
  box-shadow:
    0 0 0 10px var(--cb-ok-bg),
    0 10px 28px -10px color-mix(in srgb, var(--cb-ok) 70%, transparent);
}
.clock-btn-out {
  background: linear-gradient(160deg, color-mix(in srgb, var(--cb-fail) 82%, #fff), var(--cb-fail));
  box-shadow:
    0 0 0 10px var(--cb-fail-bg),
    0 10px 28px -10px color-mix(in srgb, var(--cb-fail) 70%, transparent);
}
.clock-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.clock-hint {
  text-align: center;
  margin-top: 20px;
  font-size: var(--cb-fs-md);
  font-weight: 600;
  color: var(--cb-ink-2);
}
.active-shift-timer {
  font-size: var(--cb-fs-display);
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--cb-text);
  text-align: center;
}
.active-shift-site {
  text-align: center;
  color: var(--cb-mid);
  font-weight: 500;
  margin-bottom: 4px;
}
.clock-title {
  margin: 0 0 4px;
  font-size: var(--cb-fs-h3);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--cb-text);
}
.clock-sub {
  margin: 0;
  font-size: var(--cb-fs-md);
  color: var(--cb-mid);
}
.stat-card {
  padding: 14px 16px;
}
.stat-value {
  font-size: var(--cb-fs-h2);
  font-weight: 650;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  color: var(--cb-text);
}
.stat-label {
  font-size: var(--cb-fs-sm);
  font-weight: 500;
  color: var(--cb-mid);
  margin-top: 2px;
}
.clock-header {
  min-height: 6rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* The viewport less the top bar, the page-body's top margin and the
     wrapper's bottom padding — so Home never scrolls as a page, only its list. */
  height: calc(
    100dvh - var(--staff-top-offset) - var(--staff-tabs-h) -
      env(safe-area-inset-bottom, 0px) - 32px
  );
}
.dashboard-top {
  flex-shrink: 0;
}
.dashboard-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  min-height: 0;
  scrollbar-width: thin;
}
.gps-status {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--cb-fs-sm);
  min-height: 1.5rem;
  margin-top: 0.75rem;
}
.gps-status .gps-pulse {
  animation: gps-pulse 1.4s ease-in-out infinite;
}
@keyframes gps-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.clock-stage {
  position: relative;
}
.clock-live {
  transition: opacity 0.2s ease;
}
body.choosing-site .clock-live {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.clock-header-idle,
.clock-header-choose {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity 0.2s ease;
}
.clock-header-choose {
  opacity: 0;
  visibility: hidden;
}
body.choosing-site .clock-header-idle {
  opacity: 0;
  visibility: hidden;
}
body.choosing-site .clock-header-choose {
  opacity: 1;
  visibility: visible;
}
.site-choose {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
body.choosing-site .site-choose {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.site-choose-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.site-choose-site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--cb-canvas);
  border: 1px solid var(--cb-input-bd);
  border-radius: var(--cb-r-lg);
  color: var(--cb-text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}
.site-choose-site::after {
  content: "\203A";
  color: var(--cb-dim);
  font-size: var(--cb-fs-h3);
  line-height: 1;
}
.site-choose-site:hover {
  border-color: var(--cb-accent);
}
.site-choose-site:active {
  transform: scale(0.98);
}
.site-choose-list.is-busy {
  pointer-events: none;
}
.site-choose-list.is-busy .site-choose-site {
  opacity: 0.45;
}
.site-choose-list.is-busy .site-choose-site.is-selected {
  opacity: 1;
  border-color: var(--cb-accent);
}
.site-choose-cancel {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  background: none;
  border: none;
  color: var(--cb-mid);
  font-size: var(--cb-fs-md);
  cursor: pointer;
}
.site-choose-cancel:hover {
  color: var(--cb-text);
}
.shift-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.shift-row + .shift-row {
  border-top: 1px solid var(--cb-line);
}
/* The Shifts list's rows open the details tray. */
.shift-row[data-shift] {
  cursor: pointer;
}
.shift-row[data-shift]:focus-visible {
  outline: 2px solid var(--cb-accent);
  outline-offset: -2px;
}
.shift-date {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--cb-r-lg);
  background: var(--cb-hover);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.shift-date-day {
  font-size: var(--cb-fs-lg);
  font-weight: 650;
  line-height: 1;
  color: var(--cb-text);
}
.shift-date-month {
  margin-top: 2px;
  font-size: var(--cb-fs-3xs);
  font-weight: 650;
  letter-spacing: var(--cb-eyebrow-track);
  color: var(--cb-mid);
  text-transform: uppercase;
}
.shift-details {
  flex: 1;
  min-width: 0;
}
.staff-shift-site {
  font-weight: 600;
  color: var(--cb-text);
}
.shift-time {
  font-size: var(--cb-fs-sm);
  color: var(--cb-mid);
}
.shift-duration {
  font-weight: 650;
  font-size: var(--cb-fs-md);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* shift_clock.js writes the fix's state as a Tabler badge; give it the
   portal's semantic tones. */
.gps-status .badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--cb-fs-xs);
  font-weight: 600;
}
.gps-status .bg-success-lt {
  background: var(--cb-ok-bg) !important;
  color: var(--cb-ok) !important;
}
.gps-status .bg-danger-lt {
  background: var(--cb-fail-bg) !important;
  color: var(--cb-fail) !important;
}
.gps-status .bg-orange-lt {
  background: var(--cb-warn-bg) !important;
  color: var(--cb-warn-deep) !important;
}

.staff-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 10px 2px 8px;
}
.staff-recent-head .staff-sec {
  margin: 0;
}
/* A text link in running copy — the manager's .cb-link, for the staff app. */
.staff-link {
  font-size: var(--cb-fs-sm);
  font-weight: 600;
  color: var(--cb-accent-ink);
  text-decoration: none;
}
.staff-link:hover {
  color: var(--cb-accent-ink);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .staff-drawer,
  .staff-drawer-backdrop,
  .clock-btn {
    transition: none;
  }
}
