/* Integra — shift workflow board (workflow.html). Same 1100px chrome as the
   admin board, so staff move between the two without the wordmark sliding. */

[hidden] { display: none !important; }

::selection { background: var(--blurple); color: var(--accent-ink); }

/* Subtle page-load fade — opacity only, gated on motion preference. */
@media (prefers-reduced-motion: no-preference) {
  body { animation: wf-page-in 150ms var(--ease); }
  @keyframes wf-page-in { from { opacity: 0; } }
}

.wf-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header (the tracker/admin chrome, verbatim) ---- */

.wf-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.wf-header .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s4) var(--s5);
  min-height: calc(41px + var(--s4) * 2);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.lockup-link { display: inline-flex; align-items: center; }
.lockup { height: 28px; width: auto; display: block; }

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--rule);
  flex: none;
}

.header-links {
  margin-left: auto;
  display: flex;
  gap: var(--s2);
}

.btn-sm { padding: 13px 16px; font-size: 13px; }
.wf-header .theme-toggle { flex: none; }

/* On a phone the page links give way to the board; the lockup still leads
   back to the dashboard. */
@media (max-width: 560px) {
  .header-links { display: none; }
  .wf-header .theme-toggle { margin-left: auto; }
}

/* ---- Main ---- */

.wf-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s8);
}

.page-title {
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin: 0 0 var(--s2);
}

.page-sub {
  font-size: 14px;
  margin: 0 0 var(--s5);
}

/* ---- Page-state notes (demo line, staff-only, missing tables) ---- */

/* While the note holds content it replaces the board. */
#wf-note:not(:empty) ~ #wf-board-wrap { display: none; }

.note-prose {
  font-size: 15px;
  margin: var(--s6) 0 0;
  max-width: var(--measure);
}
.note-action { margin: var(--s3) 0 0; font-size: 14px; }

.wf-demo-line { margin: 0 0 var(--s4); }

/* ---- Controls ---- */

.wf-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
}

.wf-daynav {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.wf-arrow { padding: 13px 12px; }

#wf-date {
  font-size: 14px;
  padding: 10px 10px;
  width: 158px;
}

.toggle-group { display: flex; gap: var(--s2); }

.toggle-btn {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  min-height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: flex-end;
  padding: 0 var(--s2) 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--graphite);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.toggle-btn:hover { color: var(--ink); }
.toggle-btn[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--blurple);
}

.wf-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

#wf-filter {
  font-size: 14px;
  padding: 10px 12px;
  width: 200px;
}

@media (max-width: 720px) {
  .wf-tools { margin-left: 0; width: 100%; }
  #wf-filter { flex: 1; width: auto; }
}

/* ---- Status line ---- */

.wf-status {
  font-size: 12px;
  color: var(--graphite);
  margin: var(--s3) 0 0;
  min-height: 20px;
}

.field-error {
  color: var(--fault-text);
  font-size: 12px;
  margin: var(--s2) 0 0;
}

/* ---- Day actions ---- */

.wf-dayactions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: var(--s4) 0;
  min-height: 41px;
}

/* ---- The board ---- */

.wf-scroll {
  overflow-x: auto;
  /* The hairline grid ends where the table does, not at the viewport edge. */
  border-bottom: 1px solid var(--rule);
}

.wf-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
}

.wf-table th,
.wf-table td {
  text-align: left;
  padding: 9px var(--s3);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

/* No position:sticky here: .wf-scroll's overflow-x makes it the scroll
   container, which never scrolls vertically, so a sticky header would never
   engage (table.css documents the same trap). The page scrolls instead. */
.wf-table thead th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--graphite);
}

.wf-table tbody tr {
  transition: background-color var(--t-fast) var(--ease);
}
.wf-table tbody tr:hover { background-color: var(--row-hover); }

/* base.css uppercases every th (label-style); a row header is a name. */
.wf-client {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.wf-slot {
  font-size: 13px;
  cursor: text;
  min-width: 110px;
}
.wf-slot:focus-visible {
  outline: 2px solid var(--blurple);
  outline-offset: -2px;
}

/* An open slot is reporting, not decoration. --attention itself is a dot
   colour (1.9:1 as text on light paper); --attention-text is its text-safe
   pair, the same arrangement --fault / --fault-text have. */
.wf-slot.is-open {
  color: var(--attention-text);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.wf-edit {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 8px;
  width: 130px;
  border: 1px solid var(--blurple);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

/* Row actions: quiet until the row is under the pointer or focus. */
.wf-rowactions { width: 1%; text-align: right; }

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 var(--s1);
  min-height: 24px; /* target floor without inflating the row like app.css's 40px would */
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--graphite);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
/* The armed '— sure?' step carries the fault colour; plain hover does not. */
.wf-archive.is-armed { color: var(--fault-text); opacity: 1; }

.wf-archive { opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.wf-table tr:hover .wf-archive,
.wf-archive:focus-visible { opacity: 1; }
@media (hover: none) { .wf-archive { opacity: 1; } }

/* ---- Add client ---- */

.wf-add {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
}
.wf-add .label { flex: none; }
#wf-add-name {
  font-size: 14px;
  padding: 10px 12px;
  width: 220px;
  max-width: 50vw;
}

.wf-hint { margin: var(--s4) 0 0; max-width: var(--measure); }

/* ---- Month ---- */

.wf-monthnav {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: var(--s4) 0;
}

.wf-month-name {
  font-size: 14px;
  min-width: 150px;
  text-align: center;
}

.wf-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.wf-cal-weekday {
  padding: var(--s2) var(--s2);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: right;
}

.wf-cal-pad {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--row-hover);
}

.wf-cal-day {
  appearance: none;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 72px;
  padding: var(--s2);
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.wf-cal-day:hover { background: var(--row-hover); }
.wf-cal-day:focus-visible {
  outline: 2px solid var(--blurple);
  outline-offset: -2px;
}

.wf-cal-date { font-size: 12px; color: var(--graphite); align-self: flex-end; }
.wf-cal-day.is-today .wf-cal-date {
  color: var(--accent-ink);
  background: var(--blurple);
  border-radius: var(--radius);
  padding: 0 4px;
}

.wf-cal-count { font-size: 13px; font-weight: 500; }
.wf-cal-std { color: var(--graphite); font-weight: 400; }
.wf-cal-open { font-size: 11px; color: var(--attention-text); }

/* A saved day carries the accent underline the toggles use. */
.wf-cal-day.is-saved { box-shadow: inset 0 -2px 0 var(--blurple); }

@media (max-width: 640px) {
  .wf-cal-day { min-height: 56px; }
  .wf-cal-open { display: none; }
}

/* ---- Staff view ---- */

.wf-staff-table { min-width: 560px; }
.wf-num { text-align: right; }
.wf-staff-table .wf-num { text-align: right; }

.wf-barcell { width: 150px; }
.wf-bar {
  display: inline-block;
  height: 8px;
  background: var(--blurple);
  vertical-align: baseline;
}

.wf-slotlist {
  white-space: normal;
  color: var(--graphite);
  max-width: 480px;
}

#wf-staff-day { margin: var(--s4) 0; }

/* ---- Footer ---- */

.wf-footer { border-top: 1px solid var(--rule); }

.wf-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s4) var(--s5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wf-footer .tagline { margin: 0; }
.wf-footer img { display: block; width: 16px; height: 16px; }
