/* ===========================================================================
   OCCC Scheduler
   One stylesheet, no build step, no external fonts or CDN requests.
   =========================================================================== */

/* --------------------------------------------------------------------------
   Palette and type taken from oceancitycoffee.com, so the scheduler reads as
   part of the same company rather than a separate tool.

     #231f20  warm near-black - text, buttons, footer
     #d7d7d7  light grey      - page background
     #b50937  crimson         - accent
     Avant Garde / Century Gothic - the site's geometric sans

   The font stack is deliberately all locally-installed faces: no webfont
   request, which keeps the strict Content-Security-Policy intact and means
   nothing breaks if the shop's internet is slow.
   -------------------------------------------------------------------------- */

:root {
  --ink:            #231f20;
  --ink-soft:       #55504f;
  --ink-faint:      #8a8583;
  --line:           #cfcbca;
  --line-soft:      #e6e3e2;
  --bg:             #d7d7d7;
  --surface:        #ffffff;
  --surface-alt:    #f4f3f2;

  /* The brand mark itself is the near-black; crimson is the accent. */
  --brand:          #231f20;
  --brand-dark:     #000000;
  --brand-tint:     #ecebea;

  --accent:         #b50937;
  --accent-dark:    #8e0729;
  --accent-tint:    #fbe9ee;

  --warn:           #9a5b12;
  --warn-tint:      #fbf0e2;
  --danger:         #b50937;
  --danger-tint:    #fbe9ee;
  --ok:             #2f6b48;
  --ok-tint:        #e9f2ec;

  --radius:         2px;
  --radius-lg:      3px;
  --shadow:         0 1px 2px rgba(35,31,32,.08);
  --shadow-lg:      0 6px 28px rgba(35,31,32,.22);

  --font: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic,
          AppleGothic, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.45rem; }
h2 { font-size: .88rem; text-transform: uppercase; letter-spacing: .07em; }
h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
h4 { font-size: .92rem; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- topbar -- */

/* White header with the real logo, the way the shop site does it. */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1500px; margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1rem; min-height: 64px;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-soft);
  padding-left: .6rem; border-left: 1px solid var(--line);
}

.mainnav { display: flex; align-items: center; gap: .1rem; flex: 1; flex-wrap: wrap; }
.mainnav > a, .nav-group-toggle {
  padding: .45rem .65rem; border-radius: var(--radius);
  color: var(--ink); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.mainnav > a:hover, .nav-group-toggle:hover { background: var(--surface-alt); text-decoration: none; }
.mainnav > a.is-active {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-divider { width: 1px; height: 20px; background: var(--line); margin: 0 .4rem; }

.nav-group { position: relative; }
.nav-group-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .35rem; z-index: 60;
}
.nav-group-menu.align-right { left: auto; right: 0; }
.nav-group.is-open .nav-group-menu { display: block; }
.nav-group-menu a, .menu-button {
  display: block; width: 100%; text-align: left; padding: .5rem .65rem;
  border-radius: 6px; color: var(--ink-soft); font-size: .88rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav-group-menu a:hover, .menu-button:hover { background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.menu-label {
  display: block; padding: .35rem .65rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-faint); border-bottom: 1px solid var(--line-soft); margin-bottom: .2rem;
}

.topbar-user { margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: .5rem; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
}
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

/* ----------------------------------------------------------------- page -- */

.page { max-width: 1500px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; }
.page-head .subtitle { color: var(--ink-soft); font-size: .9rem; margin: .25rem 0 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Dark footer band, as on the shop site. */
.footer {
  text-align: center; background: var(--ink); color: #999;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  padding: 1.4rem 1rem; margin-top: 2.5rem;
}
.footer-sep { margin: 0 .5rem; opacity: .5; }

/* ---------------------------------------------------------------- cards -- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.card-head {
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 1.1rem; }
.card-body.tight { padding: .6rem; }
.card-foot {
  padding: .75rem 1.1rem; border-top: 1px solid var(--line-soft);
  background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------------------------------------------------------------- stats -- */

.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow);
}
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--ink-soft); font-size: .82rem; margin-top: .2rem; }
.stat-note  { color: var(--ink-faint); font-size: .78rem; margin-top: .35rem; }
.stat.is-warn .stat-value { color: var(--warn); }
.stat.is-danger .stat-value { color: var(--danger); }
.stat.is-ok .stat-value { color: var(--ok); }
.stat a { color: inherit; }

/* -------------------------------------------------------------- buttons -- */

/* Squared-off, uppercase buttons, matching the shop's "Add to Cart". */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.05rem; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--surface); color: var(--ink);
  font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: .05em;
  text-decoration: none; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.btn:hover { background: var(--ink); color: #fff; text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); color: var(--ink); }

.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; color: #fff; }
.btn-accent  { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-danger  { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-ghost   { background: none; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--ink); }
.btn-sm { padding: .3rem .65rem; font-size: .68rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------- forms --- */

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label {
  display: block; font-size: .84rem; font-weight: 600; margin-bottom: .3rem; color: var(--ink);
}
.field .hint { display: block; font-size: .79rem; color: var(--ink-faint); margin-top: .3rem; }
.field .error { display: block; font-size: .79rem; color: var(--danger); margin-top: .3rem; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=url],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .5rem .65rem; font: inherit; font-size: .9rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}
input.has-error, select.has-error, textarea.has-error { border-color: var(--danger); }
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%237d8b99' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; padding-right: 1.8rem; }

.field-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 160px; margin-bottom: 1rem; }

.check { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .5rem; font-size: .88rem; }
.check input { width: auto; margin-top: .2rem; flex-shrink: 0; }
.check label { margin: 0; font-weight: 500; }
.check-inline { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; font-size: .85rem; }
.check-inline input { width: auto; }

.day-picker { display: flex; gap: .35rem; flex-wrap: wrap; }
.day-picker label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: .4rem .5rem; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; background: var(--surface); margin: 0;
}
.day-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.day-picker input:checked + span { color: var(--brand-dark); }
.day-picker label:has(input:checked) { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-dark); }
.day-picker label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; margin: 0 0 1rem; }
legend { font-size: .84rem; font-weight: 650; padding: 0 .4rem; }

/* -------------------------------------------------------------- tables --- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: .6rem .7rem; text-align: left; vertical-align: top; }
table.data thead th {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); font-weight: 700; border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--line-soft); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-alt); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .16rem .45rem; border-radius: var(--radius);
  font-size: .66rem; font-weight: 700; line-height: 1.5;
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-alt); color: var(--ink-soft); border: 1px solid var(--line);
}
.badge-ok      { background: var(--ok-tint);     color: var(--ok);     border-color: transparent; }
.badge-warn    { background: var(--warn-tint);   color: var(--warn);   border-color: transparent; }
.badge-danger  { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.badge-accent  { background: var(--accent-tint); color: var(--accent); border-color: transparent; }
.badge-brand   { background: var(--ink);         color: #fff;          border-color: transparent; }
.badge-ss      { background: var(--accent);      color: #fff;          border-color: transparent; }

.chip {
  display: inline-block; padding: .12rem .4rem; border-radius: var(--radius);
  font-size: .66rem; font-weight: 700; background: var(--surface-alt);
  text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid var(--line); color: var(--ink-soft); margin: 0 .2rem .2rem 0;
}

/* -------------------------------------------------------------- flashes -- */

.flashes { max-width: 1500px; margin: 1rem auto 0; padding: 0 1.25rem; }
.flash {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
  padding: .7rem .9rem; border-radius: var(--radius);
  margin-bottom: .6rem; font-size: .88rem; border: 1px solid transparent;
}
.flash-success { background: var(--ok-tint);     color: #14532d; border-color: #bce3cd; }
.flash-error   { background: var(--danger-tint); color: #7f1d1d; border-color: #f3c6c2; }
.flash-warning { background: var(--warn-tint);   color: #7c3d10; border-color: #f0d5b8; }
.flash-info    { background: var(--accent-tint); color: #1e3a5f; border-color: #c5d9ec; }
.flash-close { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.flash-close:hover { opacity: 1; }

/* --------------------------------------------------------------- notice -- */

.notice {
  padding: .75rem .9rem; border-radius: var(--radius); font-size: .86rem;
  border-left: 3px solid var(--line); background: var(--surface-alt); margin-bottom: 1rem;
}
.notice-warn   { border-left-color: var(--warn);   background: var(--warn-tint); }
.notice-danger { border-left-color: var(--danger); background: var(--danger-tint); }
.notice-ok     { border-left-color: var(--ok);     background: var(--ok-tint); }
.notice-info   { border-left-color: var(--accent); background: var(--accent-tint); }
.notice ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.notice li { margin-bottom: .2rem; }

.empty {
  text-align: center; padding: 2.5rem 1rem; color: var(--ink-faint);
}
.empty h3 { color: var(--ink-soft); }

/* ================================================================= GRID == */
/*  The weekly schedule, laid out like the paper version.                    */

.sched-toolbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.sched-toolbar .spacer { flex: 1; }

.week-nav { display: flex; align-items: center; gap: .3rem; }
.week-nav .week-label { font-weight: 650; padding: 0 .5rem; white-space: nowrap; }

.sched-grid-wrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}

table.sched {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: .82rem; min-width: 900px;
}
table.sched th, table.sched td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: .35rem .4rem; vertical-align: top;
}
table.sched th:last-child, table.sched td:last-child { border-right: 0; }

table.sched thead th {
  background: var(--surface-alt); position: sticky; top: 0; z-index: 3;
  font-size: .78rem; text-align: center; padding: .5rem .4rem;
}
table.sched thead th .dow { font-weight: 700; display: block; }
table.sched thead th .dnum { color: var(--ink-faint); font-weight: 500; font-size: .74rem; }
table.sched thead th.is-today { background: var(--brand-tint); }

.col-person {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  min-width: 190px; max-width: 190px;
  border-right: 1px solid var(--line) !important;
}
thead .col-person { z-index: 4; background: var(--surface-alt); }

.row-role td {
  background: var(--ink); color: #fff;
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .35rem .6rem;
}
.row-role td.col-person { background: var(--ink); color: #fff; }

.row-hours td {
  background: var(--surface-alt); font-size: .76rem; color: var(--ink-soft);
  text-align: center; font-weight: 600;
}
.row-hours td.col-person { background: var(--surface-alt); text-align: left; }

.row-events td { background: #fffdf5; font-size: .74rem; color: var(--warn); text-align: center; }
.row-events td.col-person { background: #fffdf5; text-align: left; color: var(--ink-soft); font-weight: 600; }

.person-cell { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; }
.person-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-hours { font-size: .74rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.person-hours.over { color: var(--warn); font-weight: 700; }

td.day-cell { min-width: 108px; cursor: pointer; }
td.day-cell:hover { background: var(--accent-tint); }
td.day-cell.is-closed { background: repeating-linear-gradient(45deg, #f7f8f9, #f7f8f9 6px, #eef1f5 6px, #eef1f5 12px); cursor: not-allowed; }

.shift {
  display: block; width: 100%; text-align: left;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius); padding: .22rem .35rem; margin-bottom: .2rem;
  font-size: .77rem; line-height: 1.3; cursor: pointer; font-family: inherit; color: var(--ink);
}
.shift:hover { box-shadow: var(--shadow); background: #fff; }
.shift:last-child { margin-bottom: 0; }
.shift .t { font-weight: 700; white-space: nowrap; display: block; font-variant-numeric: tabular-nums; }
.shift .m { color: var(--ink-faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; }
/* The supervisor shift is the one that must stand out - give it the crimson. */
.shift.is-super { background: var(--accent-tint); border-color: #efc9d4; border-left-color: var(--accent); }
.shift.is-super .m { color: var(--accent); font-weight: 700; }
.shift.is-open  { background: var(--warn-tint); border-color: #ecd9bd; border-left-color: var(--warn); color: var(--warn); font-weight: 700; }
.shift.is-callout { background: var(--accent-tint); border-color: #efc9d4; border-left-color: var(--accent); }
.shift.has-warning { box-shadow: inset 0 0 0 1px var(--warn); }

.day-cell .add-hint {
  display: none; font-size: .72rem; color: var(--accent); font-weight: 600; text-align: center; padding: .15rem;
}
td.day-cell:hover .add-hint { display: block; }
td.day-cell.is-closed:hover .add-hint { display: none; }

/* Coverage strip under the grid */
.coverage-list { display: grid; gap: .35rem; }
.coverage-row {
  display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem;
  border-radius: var(--radius); font-size: .82rem; background: var(--surface-alt);
}
.coverage-row.is-short { background: var(--danger-tint); }
.coverage-row.is-nosuper { background: var(--warn-tint); }
.coverage-row .cr-when { min-width: 150px; font-weight: 600; }
.coverage-row .cr-role { flex: 1; color: var(--ink-soft); }
.coverage-row .cr-count { font-variant-numeric: tabular-nums; font-weight: 650; }

/* -------------------------------------------------------------- modals --- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,32,45,.45);
  display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 200;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.modal-head {
  padding: 1rem 1.15rem; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 1.15rem; }
.modal-foot {
  padding: .85rem 1.15rem; border-top: 1px solid var(--line-soft);
  display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap;
  background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-foot .left { margin-right: auto; }
.modal-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-faint); padding: 0; }

/* Candidate picker inside the shift modal */
.candidates { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.candidate {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  width: 100%; text-align: left; padding: .5rem .65rem; border: 0; border-bottom: 1px solid var(--line-soft);
  background: none; cursor: pointer; font: inherit; font-size: .86rem;
}
.candidate:last-child { border-bottom: 0; }
.candidate:hover { background: var(--accent-tint); }
.candidate.is-blocked { cursor: not-allowed; opacity: .75; background: var(--surface-alt); }
.candidate.is-blocked:hover { background: var(--surface-alt); }
.candidate .c-name { font-weight: 600; }
.candidate .c-meta { font-size: .76rem; color: var(--ink-faint); display: block; }
.candidate .c-hours { font-size: .78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* --------------------------------------------------------------- auth ---- */

.auth-body { background: var(--ink); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card {
  background: var(--surface); width: 100%; max-width: 420px;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2rem 1.75rem;
}
.auth-head { text-align: center; margin-bottom: 1.75rem; }
.auth-logo { max-width: 220px; height: auto; display: block; margin: 0 auto .9rem; }
.auth-head h1 {
  font-size: .8rem; margin-bottom: .3rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-soft); font-weight: 700;
}
.auth-sub { color: var(--ink-faint); font-size: .78rem; margin: 0; text-transform: uppercase; letter-spacing: .06em; }
.auth-footer { color: rgba(255,255,255,.55); font-size: .7rem; margin-top: 1.5rem; text-transform: uppercase; letter-spacing: .06em; }
.auth-links { text-align: center; margin-top: 1.1rem; font-size: .82rem; }

/* -------------------------------------------------------------- public --- */

.public-body { background: var(--bg); }

/* Unmissable, and sticky, so a manager preview can never be mistaken for the
   real posted schedule however far down the page you scroll. */
.draft-banner {
  position: sticky; top: 0; z-index: 60;
  background: var(--accent); color: #fff; text-align: center;
  padding: .55rem 1rem; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
}
.public-head {
  background: var(--surface); color: var(--ink); text-align: center;
  padding: 1.5rem 1.25rem 1.25rem; border-bottom: 3px solid var(--ink);
}
.public-logo { max-width: 260px; height: auto; display: block; margin: 0 auto .75rem; }
.public-head h1 {
  margin: 0 0 .3rem; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-soft); font-weight: 700;
}
.public-head .week { font-size: 1.15rem; font-weight: 700; }
.public-head .note {
  font-size: .68rem; color: var(--ink-faint); margin-top: .55rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.public-wrap { max-width: 1500px; margin: 0 auto; padding: 1.25rem; }
.public-store-title {
  display: flex; align-items: center; gap: .6rem; margin: 1.75rem 0 .6rem;
  font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.public-store-title .dot { width: 12px; height: 12px; border-radius: 2px; }

/* ---------------------------------------------------------------- misc --- */

.mono { font-family: var(--mono); font-size: .84em; }
.muted { color: var(--ink-faint); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

.copy-row { display: flex; gap: .4rem; align-items: center; }
.copy-row input { font-family: var(--mono); font-size: .8rem; }

.inline-form { display: inline; }

.legend {
  display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .68rem;
  color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.legend-swatch {
  width: 16px; height: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left-width: 3px;
}
/* Kept in step with the .shift variants above. */
.swatch-scheduled { background: var(--surface-alt);  border-left-color: var(--ink); }
.swatch-super     { background: var(--accent-tint);  border-left-color: var(--accent); border-color: #efc9d4; }
.swatch-open      { background: var(--warn-tint);    border-left-color: var(--warn);   border-color: #ecd9bd; }
.swatch-callout   { background: var(--accent-tint);  border-left-color: var(--accent); border-color: #efc9d4; }

/* ------------------------------------------------------------ responsive - */

/* ============================================================== timeline == */

.timeline { list-style: none; margin: 0; padding: .3rem 0; }

.timeline-day {
  font-size: .64rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-faint);
  padding: .9rem .8rem .3rem; border-bottom: 1px solid var(--line-soft);
  margin-bottom: .3rem;
}
.timeline-day:first-child { padding-top: .2rem; }

.timeline-item {
  display: flex; gap: .65rem; padding: .5rem .8rem;
  border-left: 3px solid transparent;
}
.timeline-item:hover { background: var(--surface-alt); }
.timeline-item.kind-account      { border-left-color: var(--ink); }
.timeline-item.kind-shifts       { border-left-color: var(--accent); }
.timeline-item.kind-timeoff      { border-left-color: var(--ok); }
.timeline-item.kind-availability { border-left-color: var(--warn); }
.timeline-item.kind-messages     { border-left-color: #7a6a55; }

.timeline-icon {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-alt); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: .7rem; font-weight: 700; color: var(--ink-soft);
}
.timeline-body { min-width: 0; flex: 1; }
.timeline-title { font-size: .86rem; font-weight: 650; }
.timeline-detail {
  font-size: .8rem; color: var(--ink-soft); margin-top: .1rem;
  overflow-wrap: anywhere;
}
.timeline-meta {
  display: flex; gap: .7rem; flex-wrap: wrap;
  font-size: .68rem; color: var(--ink-faint); margin-top: .2rem;
}

@media (max-width: 640px) {
  .timeline-item { padding: .5rem .55rem; gap: .5rem; }
  .timeline-meta { gap: .45rem; font-size: .62rem; }
}

/* ============================================================== calendar == */

table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 640px; }
table.cal th {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); font-weight: 700; padding: .45rem .3rem;
  border-bottom: 2px solid var(--ink); text-align: center;
}
td.cal-day {
  border: 1px solid var(--line-soft); vertical-align: top;
  height: 96px; padding: .25rem; width: 14.28%;
}
td.cal-day.is-outside { background: var(--surface-alt); }
td.cal-day.is-outside .cal-daynum { color: var(--ink-faint); opacity: .6; }
td.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }

.cal-daynum {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: .74rem; font-weight: 700; margin-bottom: .2rem;
}
.cal-count {
  font-size: .55rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent);
}

.cal-entry {
  display: block; font-size: .66rem; line-height: 1.3;
  padding: .12rem .28rem; margin-bottom: .12rem;
  border-radius: var(--radius); border-left: 3px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); text-decoration: none;
}
.cal-entry.is-approved { background: var(--ok-tint);   border-left-color: var(--ok); }
.cal-entry.is-pending  { background: var(--warn-tint); border-left-color: var(--warn); }
.cal-entry.is-pending:hover { text-decoration: none; filter: brightness(.96); }
.cal-time { color: var(--ink-faint); }
.cal-q { font-weight: 700; color: var(--warn); }

@media (max-width: 640px) {
  td.cal-day { height: 74px; padding: .18rem; }
  .cal-entry { font-size: .58rem; }
  .cal-daynum { font-size: .66rem; }
}

/* ============================================================== the clock == */

.topbar-clock {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.15; padding-right: .9rem; margin-right: .2rem;
  border-right: 1px solid var(--line); white-space: nowrap;
}
.clock-date {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-faint);
}
.clock-time {
  font-size: .88rem; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ============================================================ responsive == */

@media (max-width: 980px) {
  .nav-toggle { display: block; order: 3; }
  .mainnav {
    display: none; order: 5; width: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem 0 .75rem; border-top: 1px solid var(--line-soft);
  }
  .mainnav.is-open { display: flex; }
  .mainnav > a, .nav-group-toggle {
    padding: .85rem .6rem; font-size: .82rem;   /* comfortable thumb targets */
  }
  .mainnav > a.is-active { box-shadow: inset 3px 0 0 var(--accent); }
  .nav-group-menu {
    position: static; box-shadow: none; border: 0;
    border-left: 2px solid var(--line); border-radius: 0; margin: 0 0 .3rem .5rem;
  }
  .nav-group-menu a, .menu-button { padding: .75rem .65rem; font-size: .82rem; }
  .nav-divider { display: none; }
  .topbar-user { order: 4; margin-left: 0; }
  .topbar-clock { order: 2; margin-left: auto; }
  .user-name { display: none; }
  .topbar-inner { flex-wrap: wrap; gap: .5rem; }
  .col-person { min-width: 128px; max-width: 128px; }
}

@media (max-width: 640px) {
  .page { padding: .9rem .7rem 2rem; }
  .flashes { padding: .75rem .7rem 0; }
  h1 { font-size: 1.15rem; }
  .card { border-radius: var(--radius-lg); margin-bottom: .9rem; }
  .card-body { padding: .85rem; }
  .card-head { padding: .8rem .85rem; }
  .card-foot { padding: .8rem .85rem; }
  .field-row { flex-direction: column; gap: 0; }
  .grid { gap: .9rem; }

  /* Stat tiles hold two or three words, so let them sit side by side rather
     than eating a whole screen each before the user reaches their shifts. */
  .grid-3, .grid-4 { grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); gap: .5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat { padding: .6rem .5rem; }
  .stat-value { font-size: 1.2rem; }
  .stat-label { font-size: .66rem; line-height: 1.25; }
  .stat-note  { font-size: .62rem; }

  .page-head { gap: .6rem; margin-bottom: .9rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }

  .brand-logo { height: 34px; }
  .brand-text { display: none; }
  .clock-date { font-size: .58rem; }
  .clock-time { font-size: .8rem; }

  /* Buttons and inputs big enough to hit with a thumb. 16px on inputs is
     what stops iOS Safari zooming the whole page when a field is focused. */
  .btn { padding: .7rem 1rem; font-size: .74rem; min-height: 42px; }
  .btn-sm { padding: .5rem .7rem; min-height: 34px; }
  input[type=text], input[type=email], input[type=password], input[type=tel],
  input[type=number], input[type=date], input[type=time], input[type=url],
  input[type=search], select, textarea {
    font-size: 16px; padding: .65rem .7rem; min-height: 44px;
  }
  .check input[type=checkbox], .check input[type=radio] {
    width: 22px; height: 22px; margin-top: .1rem;
  }
  .day-picker label { min-width: 46px; min-height: 44px; }

  /* ---- data tables become stacked cards --------------------------------
     Each row turns into its own block with the column name in front of the
     value, so nothing needs horizontal scrolling. Any table that should keep
     its grid shape opts out with class="keep-table". */
  table.data:not(.keep-table),
  table.data:not(.keep-table) tbody,
  table.data:not(.keep-table) tr,
  table.data:not(.keep-table) td {
    display: block; width: 100%;
  }
  table.data:not(.keep-table) thead { display: none; }
  table.data:not(.keep-table) tbody tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .6rem .7rem; margin-bottom: .6rem; background: var(--surface);
  }
  table.data:not(.keep-table) tbody tr:hover { background: var(--surface); }
  table.data:not(.keep-table) td {
    padding: .22rem 0; text-align: left !important; border: 0;
  }
  table.data:not(.keep-table) td:empty { display: none; }
  table.data:not(.keep-table) td[data-label]::before {
    content: attr(data-label);
    display: block; font-size: .6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    color: var(--ink-faint); margin-bottom: .1rem;
  }
  table.data:not(.keep-table) td.actions {
    margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line-soft);
    display: flex; gap: .4rem; flex-wrap: wrap;
  }
  table.data:not(.keep-table) td.actions .btn,
  table.data:not(.keep-table) td.actions form { flex: 1 1 auto; }
  table.data:not(.keep-table) td.actions form .btn { width: 100%; }

  /* ---- the schedule grid keeps its shape, but hint that it scrolls ---- */
  .sched-grid-wrap { position: relative; }
  .sched-grid-wrap::after {
    content: "swipe →"; position: absolute; top: .3rem; right: .4rem;
    font-size: .55rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ink-faint);
    background: rgba(255,255,255,.9); padding: .1rem .3rem; border-radius: 2px;
    pointer-events: none;
  }
  table.sched { min-width: 620px; font-size: .72rem; }
  td.day-cell { min-width: 88px; }
  .col-person { min-width: 104px; max-width: 104px; }
  .person-hours { display: none; }

  .sched-toolbar { padding: .6rem .7rem; gap: .5rem; }
  .sched-toolbar .btn { flex: 1 1 auto; }
  .sched-toolbar .spacer { display: none; }
  .week-nav { width: 100%; justify-content: space-between; }

  /* ---- modals go full height so long forms are usable ---------------- */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: none; max-height: 94vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-foot { position: sticky; bottom: 0; }
  .modal-foot .btn { flex: 1 1 auto; }

  .legend { font-size: .6rem; gap: .6rem; }
  .table-wrap { overflow-x: auto; }
}

/* Very small phones */
@media (max-width: 380px) {
  .page { padding: .75rem .5rem 2rem; }
  .brand-logo { height: 30px; }
  .topbar-clock { padding-right: .5rem; }
  .stat-value { font-size: 1.25rem; }
}

/* ---------------------------------------------------------------- print -- */

@media print {
  .topbar, .footer, .flashes, .page-actions, .sched-toolbar,
  .no-print, .nav-toggle, .modal-backdrop { display: none !important; }
  body { background: #fff; font-size: 10pt; }
  .page { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  table.sched { font-size: 8pt; min-width: 0; page-break-inside: auto; }
  table.sched thead { display: table-header-group; }
  table.sched tr { page-break-inside: avoid; }
  .col-person { position: static; min-width: 0; max-width: none; }
  .shift { border: 1px solid #bbb; background: #fff !important; }
  .shift.is-super { background: #eee !important; }
  a { color: #000; text-decoration: none; }
}

/* ------------------------------------------------------------- printable - */

.print-sheet { background: #fff; padding: 1rem; }
.print-title { text-align: center; margin-bottom: .9rem; }
.print-logo { max-width: 200px; height: auto; display: block; margin: 0 auto .4rem; }
.print-title h1 { font-size: 1.3rem; margin: 0; letter-spacing: .04em; }
.print-title .sub {
  font-size: .78rem; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .06em;
}
.print-draft {
  text-align: center; color: var(--danger); font-weight: 700;
  border: 2px dashed var(--danger); padding: .4rem; margin-bottom: .75rem; border-radius: var(--radius);
}

/* ---------------------------------------------------------------------------
   Tabs - used by People to switch between current and archived staff.
   Scrolls sideways on a phone rather than wrapping into a ragged block.
   --------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: .25rem;
  margin: 0 0 1rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { height: 0; }
.tab {
  flex: 0 0 auto;
  padding: .6rem .9rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

/* Tick column in the archived list. */
td.tight, th.tight { width: 1%; white-space: nowrap; padding-right: .25rem; }

/* Version marker in the footer - present for bug reports, not for reading. */
.footer-version { font-variant-numeric: tabular-nums; opacity: .75; }
