/* Ocean Buffet - the staff page (/staff/): staff accounts, time clock, reports and Form W-4.
   Built on styles.css's colors, type and buttons; loaded only by the staff page (build.py, page_staff). */

:root {
  --st-accent-ink: var(--accent-text);
  --st-accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --st-ok: var(--open);
  --st-muted: var(--ink-2);
  --st-line-strong: color-mix(in srgb, var(--ink) 30%, var(--surface));
  --st-radius: var(--r-md);
  --st-radius-sm: var(--r-sm);
}

[hidden] { display: none !important; }

.section--tight.staff-main { padding-block: 0 clamp(3rem, 7vw, 5rem); }
.btn--plain { background: transparent; color: var(--ink); padding-inline: 0.9rem; }
.btn--plain:hover { background: var(--tint); transform: none; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.muted { color: var(--st-muted); }
.small { font-size: 0.9rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.divider { height: 1px; background: var(--line); }
.team-notice { padding: 0.9rem 1.1rem; border-radius: var(--st-radius-sm); background: var(--st-accent-soft); color: var(--ink); }
.team-notice a, .staff-main p a { color: var(--st-accent-ink); text-underline-offset: 3px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label, .w4-label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-size: 0.85rem; color: var(--st-muted); }
.staff-main input[type="text"], .staff-main input[type="email"], .staff-main input[type="tel"], .staff-main input[type="number"],
.staff-main input[type="password"], .staff-main input[type="date"], .staff-main select {
  width: 100%; min-height: 46px; padding: 0.6rem 0.85rem; border-radius: var(--st-radius-sm);
  border: 1.5px solid var(--st-line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem;
}
.staff-main input::placeholder { color: var(--st-muted); opacity: 1; }
.staff-main input:focus, .staff-main select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }
.form-msg { margin-top: 0.75rem; font-weight: 600; min-height: 1.4em; }
.form-msg[data-state="error"] { color: var(--st-accent-ink); }
.form-msg[data-state="success"] { color: var(--st-ok); }

/* Panels and tables */
.staff-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--st-radius); padding: clamp(1.25rem, 3vw, 2rem); margin-top: 1.25rem; }
.staff-panel h2, .team-bar h2 { font-family: var(--font-display); font-weight: 750; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.02em; }
.staff-panel h3 { font-size: 1.05rem; }
.staff-panel table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 0.95rem; }
.staff-panel th, .staff-panel td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.staff-panel th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-muted); }
.staff-panel td.num, .staff-panel th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.staff-panel tr.total td { font-weight: 700; border-bottom-color: var(--st-line-strong); }
.staff-panel tr.detail td:first-child { padding-left: 1.5rem; color: var(--st-muted); }
.staff-panel td.neg { color: var(--st-accent-ink); }
.pill { display: inline-block; padding: 0.1rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--tint); }
.pill.ok { background: color-mix(in srgb, var(--st-ok) 16%, transparent); color: var(--st-ok); }
.pill.warn { background: var(--st-accent-soft); color: var(--st-accent-ink); }
.team-note { margin-top: 0.5rem; color: var(--st-muted); font-size: 0.88rem; }

/* Signed in */
.team-narrow { max-width: 520px; }
.team-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.25rem; }
.team-bar h2 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); }
.team-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; border-bottom: 1px solid var(--line); }
.team-tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.65rem 0.9rem; margin-bottom: -1px; font: inherit; font-weight: 650; color: var(--st-muted); cursor: pointer; }
.team-tab:hover { color: var(--ink); }
.team-tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.team-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem 1rem; }
.team-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.staff-main .team-controls select, .staff-main .team-controls input { width: auto; min-height: 42px; padding: 0.35rem 0.75rem; }
.team-stats { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.team-stats li strong { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; line-height: 1; }
.team-stats li span { display: block; margin-top: 0.35rem; color: var(--st-muted); font-size: 0.92rem; }
.team-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.1rem; }
.team-tile { background: var(--tint); border-radius: var(--st-radius-sm); padding: 0.9rem 1rem; }
.team-tile strong { display: block; font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; line-height: 1; }
.team-tile span { display: block; margin-top: 0.3rem; color: var(--st-muted); font-size: 0.9rem; }
.team-tile.is-good strong { color: var(--st-ok); }
.team-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.75rem; }
.team-cards h3 { margin-top: 1.5rem; }
.team-forms { align-items: start; }
@media (max-width: 900px) { .team-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .team-cards { grid-template-columns: 1fr; } }

/* Form W-4: the employee's form, and a filled-in official form to print */
.w4-form fieldset { border: 1px solid var(--line); border-radius: var(--st-radius-sm); padding: 1rem 1.1rem 1.15rem; margin: 0; }
.w4-form legend { font-weight: 700; font-size: 1.05rem; padding: 0 0.4rem; }
.w4-form p.small { line-height: 1.5; }
.w4-total { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; }
.w4-choices label, .w4-check { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.5rem; font-size: 0.95rem; line-height: 1.45; }
.w4-choices input, .w4-check input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.w4-worksheet { border-top: 1px dashed var(--st-line-strong); padding-top: 0.75rem; }
.w4-worksheet summary { cursor: pointer; font-weight: 650; color: var(--st-accent-ink); }
.w4-form [data-w4-steps][aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.w4-viewer { position: fixed; inset: 0; z-index: 300; background: rgb(6 25 30 / 0.65); overflow: auto; padding: 1rem; }
.w4-viewer-inner { max-width: 860px; margin: 0 auto; background: var(--surface); border-radius: var(--st-radius); padding: 1rem; }
.w4-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem 1rem; margin-bottom: 0.9rem; }
.w4-sheet { position: relative; width: 100%; aspect-ratio: 612 / 792; background: #fff; color: #000; container-type: inline-size; overflow: hidden; border: 1px solid var(--line); }
.w4-sheet img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.w4-sheet .f { position: absolute; display: flex; align-items: flex-end; font: 1.5cqw/1 "Helvetica Neue", Helvetica, Arial, sans-serif; color: #0b1f66; white-space: nowrap; overflow: hidden; padding-left: 0.3cqw; }
.w4-sheet .f.box { justify-content: center; align-items: center; padding: 0; font-weight: 700; font-size: 1.4cqw; }
.w4-sheet .f.sign { font-style: italic; font-size: 1.7cqw; }
.w4-sheet .f.small { font-size: 1.2cqw; white-space: normal; align-items: flex-start; line-height: 1.15; }
.w4-sheet input.f { border: 0; background: rgb(255 236 140 / 0.45); min-height: 0; border-radius: 0; padding: 0 0.3cqw; height: auto; }
@media print {
  body.w4-printing * { visibility: hidden !important; }
  body.w4-printing .w4-sheet, body.w4-printing .w4-sheet * { visibility: visible !important; }
  body.w4-printing .w4-viewer { position: static; background: none; padding: 0; overflow: visible; }
  body.w4-printing .w4-sheet { position: fixed; left: 0; top: 0; width: 8.1in; border: 0; }
  body.w4-printing .w4-sheet input.f { background: none; }
  body.w4-printing .w4-sheet input.f::placeholder { color: transparent; }
}
