/* JOHNSONKREIS Timesheets
   Scene: a foreman on a tailgate at 4pm, phone in full sun. White paper, black ink, the company blue.
   Type: News Cycle (the brand's own condensed face) carries headings and every big number.
         IBM Plex Sans carries labels and body. Numbers are always tabular.
   Depth comes from paper on paper: a cool page ground, white surfaces, 1px hairlines. No drop-shadow decoration. */

@font-face { font-family: 'News Cycle'; font-weight: 400; font-display: swap; src: url('/fonts/news-cycle-400.woff2') format('woff2'); }
@font-face { font-family: 'News Cycle'; font-weight: 700; font-display: swap; src: url('/fonts/news-cycle-700.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-600.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-700.woff2') format('woff2'); }

:root {
  --blue: #00529F;
  --blue-deep: #003F7C;
  --blue-ink: #0B2E52;
  --blue-tint: #E9F0F9;
  --blue-tint-2: #D2E1F3;
  --blue-wash: rgba(0, 82, 159, 0.055);

  --ink: #131820;
  --ink-2: #2B3340;
  --ink-3: #525B69;
  --ink-4: #737C8A;

  --paper: #F3F5F8;
  --paper-2: #E9EDF2;
  --surface: #FFFFFF;
  --line: #D7DDE6;
  --line-2: #E7EBF1;
  --line-strong: #B9C2CF;

  --ok: #1B7A4B;
  --ok-tint: #E3F3EA;
  --warn: #A3580A;
  --warn-tint: #FBEEDB;
  --danger: #B3271B;
  --danger-tint: #FBE8E6;

  --display: 'News Cycle', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --body: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --r-1: 4px;
  --r-2: 6px;
  --r-3: 10px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 120ms;
  --t-base: 180ms;

  --z-sticky: 20;
  --z-drawer: 40;
  --z-modal: 50;
  --z-toast: 60;

  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: 2.125rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--blue-tint-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: 0.005em;
  cursor: pointer; user-select: none; white-space: nowrap; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:not(:disabled):hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:not(:disabled):hover { border-color: var(--ink-3); }
.btn-secondary:not(:disabled):active { background: var(--paper-2); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:not(:disabled):hover { background: var(--blue-tint); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:not(:disabled):hover { background: var(--danger-tint); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 44px; }
.btn .spin { display: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .spin { display: inline-block; }
.btn.is-loading .lbl { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.field .hint { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.field .err { font-size: 13px; color: var(--danger); font-weight: 500; }
.input, select.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-2);
  background: var(--surface); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.input::placeholder { color: var(--ink-4); }
.input:hover { border-color: var(--ink-3); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint-2); outline: none; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled { background: var(--paper); color: var(--ink-3); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23525B69' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 13px; background: var(--line-strong); transition: background-color 160ms var(--ease-out); }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 180ms var(--ease-out); box-shadow: 0 1px 2px rgba(19, 24, 32, 0.3); }
.switch input:checked ~ .track { background: var(--blue); }
.switch input:checked ~ .knob { transform: translateX(20px); }
.switch input:focus-visible ~ .track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .t { font-weight: 600; }
.switch-row .d { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; letter-spacing: 0.01em; }
.pill svg.i { width: 14px; height: 14px; stroke-width: 2.5; }
.pill-ok { background: var(--ok-tint); color: var(--ok); }
.pill-warn { background: var(--warn-tint); color: var(--warn); }
.pill-danger { background: var(--danger-tint); color: var(--danger); }
.pill-blue { background: var(--blue-tint); color: var(--blue-ink); }
.pill-neutral { background: var(--paper-2); color: var(--ink-3); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand .sub { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding-left: 12px; border-left: 1px solid var(--line); line-height: 1; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: var(--z-toast); pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: 420px; width: 100%;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-3);
  font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(8px) scale(0.98);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: var(--ok); }
.toast.danger { background: var(--danger); }
.toast.warn, .toast.offline { background: var(--warn); }
/* No icons on the office side, toasts included. */
body.office .toast svg.i { display: none; }

/* ---------- Dialog ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto;
  width: min(100% - 32px, 460px);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-3);
  box-shadow: 0 24px 60px rgba(11, 46, 82, 0.32);
}
dialog.sheet::backdrop { background: rgba(11, 46, 82, 0.48); }
dialog.sheet[open] { animation: sheet-in 200ms var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.sheet-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.sheet-body h2 { font-size: 1.5rem; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.sheet-actions .btn { flex: 1 1 auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================================
   LOGIN
   ========================================================= */
.login { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); }
.login-top { padding: calc(24px + var(--safe-t)) 20px 8px; display: flex; justify-content: center; }
.login-top .brand img { height: 36px; }
.login-main { display: flex; align-items: flex-start; justify-content: center; padding: 24px 20px 40px; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.login-card h1 { font-size: 2.5rem; letter-spacing: -0.005em; }
.login-card .lede { color: var(--ink-3); font-size: 15px; margin-top: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper-2); border-radius: var(--r-2); padding: 4px; }
.seg button { min-height: 40px; border: 0; background: transparent; border-radius: var(--r-1); font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(19, 24, 32, 0.14); }
.login form { display: flex; flex-direction: column; gap: 16px; }
.pin-input { letter-spacing: 0.5em; font-family: var(--display); font-size: 30px; font-weight: 700; text-align: center; height: 64px; padding-left: calc(12px + 0.5em); }
.login-foot { padding: 16px 20px calc(16px + var(--safe-b)); text-align: center; font-size: 13px; color: var(--ink-4); }
.login-photo { display: none; }
@media (min-width: 900px) {
  .login { grid-template-columns: minmax(440px, 46%) 1fr; grid-template-rows: 1fr; }
  .login-top { grid-column: 1; grid-row: 1; align-self: start; justify-content: flex-start; padding: 40px 64px; }
  .login-main { grid-column: 1; grid-row: 1; align-self: center; padding: 130px 64px 90px; justify-content: flex-start; }
  .login-foot { grid-column: 1; grid-row: 1; align-self: end; text-align: left; padding: 28px 64px; }
  .login-photo { display: block; grid-column: 2; grid-row: 1; background: var(--blue-ink); position: relative; overflow: hidden; }
  .login-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .login-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 46, 82, 0) 45%, rgba(11, 46, 82, 0.78) 100%); }
  .login-photo .cap { position: absolute; left: 48px; right: 48px; bottom: 44px; z-index: 1; color: #fff; font-family: var(--display); font-weight: 700; font-size: 2.5rem; line-height: 1.02; max-width: 560px; }
  .login-photo .cap::before { content: ''; display: block; width: 48px; height: 4px; background: #fff; margin-bottom: 18px; }
  .login-photo .cap small { display: block; font-family: var(--body); font-weight: 500; font-size: 15px; line-height: 1.5; opacity: 0.92; margin-top: 12px; max-width: 46ch; }
}

/* Install instructions on the login page */
.install { border-top: 1px solid var(--line); padding-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.install h2 { font-size: 1.375rem; }
.install-cols { display: grid; grid-template-columns: 1fr; gap: 12px; }
.install-col { background: var(--paper); border-radius: var(--r-3); padding: 14px 16px 12px; }
.install-col h3 { font-size: 1rem; margin-bottom: 6px; }
.install-col ol { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.install-note { font-size: 13px; color: var(--ink-3); }
@media (min-width: 560px) { .install-cols { grid-template-columns: 1fr 1fr; } }

/* =========================================================
   PM APP (mobile first)
   ========================================================= */
.app { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--surface); border-bottom: 1px solid var(--line); padding-top: var(--safe-t); }
.topbar-in { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.topbar .who { font-size: 14px; font-weight: 600; color: var(--ink-2); text-align: right; line-height: 1.2; }
.topbar .who small { display: block; font-weight: 400; color: var(--ink-4); font-size: 12px; margin-top: 1px; }
.offline-bar { background: var(--warn-tint); color: var(--warn); font-size: 13px; font-weight: 600; text-align: center; padding: 7px 16px; }

.main { flex: 1; max-width: 720px; width: 100%; margin: 0 auto; padding: 16px 16px 24px; }
.screen { display: flex; flex-direction: column; gap: 14px; }
.screen > h2 { font-size: 1.75rem; padding: 4px 0 2px; }

.weeknav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: 2px 0; }
.weeknav .btn-icon { border-radius: 50%; }
.weeknav .range { text-align: center; }
.weeknav .range h2 { font-size: 1.625rem; }
.weeknav .range .sub { font-size: 13px; color: var(--ink-3); margin-top: 1px; display: flex; justify-content: center; gap: 8px; align-items: center; }
.weeknav .range .sub button { border: 0; background: transparent; color: var(--blue); font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-3); font-size: 14px; line-height: 1.45; }
.banner-ok { background: var(--ok-tint); color: var(--ok); }
.banner-warn { background: var(--warn-tint); color: var(--warn); }
.banner-blue { background: var(--blue-tint); color: var(--blue-ink); }
.banner strong { font-weight: 700; }

/* Job bar */
.jobbar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.jobbar label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.jobbar-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.jobbar select.input { font-weight: 600; border-color: var(--blue); color: var(--blue-ink); background-color: var(--blue-tint); }

/* Crew list */
.crewlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.crewrow { border-bottom: 1px solid var(--line-2); }
.crewrow:last-child { border-bottom: 0; }
.crewhead { width: 100%; display: grid; grid-template-columns: 1fr auto auto 24px; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; min-height: 62px; transition: background-color var(--t-fast) var(--ease-out); }
@media (hover: hover) { .crewhead:hover { background: var(--paper); } }
.crewhead .nm { font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.05; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crewhead .tot { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.crewhead .tot small { font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--ink-3); margin-left: 3px; }
.crewhead .chev { color: var(--ink-4); transition: transform 160ms var(--ease-out); }
.crewrow.open .chev { transform: rotate(180deg); }
.crewrow.open .crewhead { background: var(--blue-tint); }
.crewrow.locked .crewhead .nm { color: var(--ink-3); }
.crewbody { border-top: 1px solid var(--line-2); background: var(--paper); padding: 8px 8px 10px; }

/* Day rows */
.days { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.day { border-bottom: 1px solid var(--line-2); }
.day:last-child { border-bottom: 0; }
.day-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; min-height: 64px; }
.day-lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.day-lbl .dow { font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1; display: flex; align-items: center; gap: 8px; }
.day-lbl .date { font-size: 12.5px; color: var(--ink-3); }
.day-lbl .date b { color: var(--ink-2); font-weight: 600; }
.day-lbl .today { font-family: var(--body); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--blue); border-radius: 3px; padding: 3px 6px; line-height: 1; }
.day.is-today { background: var(--blue-wash); }
.day.is-future .day-row { opacity: 0.55; }

/* Stepper: a machined control. Buttons sit in a recessed well, the number is the display. */
.stepper { display: inline-grid; grid-template-columns: 42px 70px 42px; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-2); overflow: hidden; background: var(--surface); }
.stepper button { border: 0; background: var(--paper); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
@media (hover: hover) { .stepper button:not(:disabled):hover { background: var(--paper-2); color: var(--ink); } }
.stepper button:not(:disabled):active { background: var(--blue-tint-2); color: var(--blue-ink); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper input {
  width: 100%; height: 46px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.5rem; background: var(--surface); color: var(--ink);
  -moz-appearance: textfield; transition: background-color var(--t-fast) var(--ease-out);
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--blue-tint); }
.stepper input:disabled { background: var(--paper); color: var(--ink-3); }
.stepper.is-zero input { color: var(--ink-4); }
.stepper.sm { grid-template-columns: 34px 56px 34px; }
.stepper.sm input { height: 36px; font-size: 1.1rem; }

.day-extra { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.day-note-btn { border: 0; background: transparent; color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.day-note { font-size: 12.5px; color: var(--ink-3); font-style: italic; }
/* Day notes: who left it, then the note. */
.day-notes { display: flex; flex-direction: column; gap: 4px; }
.note-line { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.note-line b { font-weight: 600; color: var(--ink); }
.day-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.day > .day-notes { padding: 0 12px 10px; }
.day-lbl .day-note-btn { font-size: 12px; align-self: flex-start; margin-top: 2px; }
.note-mine { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; font: inherit; }
.note-mine:hover b { color: var(--blue); }
.roster .note-mark { color: var(--blue); font-weight: 700; margin-left: 1px; }
.other-line { display: grid; grid-template-columns: 1fr auto 32px; align-items: center; gap: 8px; }
.other-line .ol-job { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.other-line .rm { border: 0; background: transparent; color: var(--ink-4); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.other-line .rm:hover { background: var(--danger-tint); color: var(--danger); }
.day-total { font-size: 13px; color: var(--ink-3); }
.day-total b { color: var(--ink); font-family: var(--display); font-size: 16px; }
.crewacts { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 4px 0; flex-wrap: wrap; }

/* Job lines (per-line editor in the office drawer) */
.job-lines { display: flex; flex-direction: column; gap: 8px; }
.job-line { display: grid; grid-template-columns: 1fr auto 36px; gap: 8px; align-items: center; }

/* Sticky week footer */
.weekfoot {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: var(--z-sticky);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
}
.weekfoot .total { display: flex; flex-direction: column; }
.weekfoot .total .n { font-family: var(--display); font-weight: 700; font-size: 2.125rem; line-height: 1; letter-spacing: -0.01em; }
.weekfoot .total .n small { font-size: 1rem; color: var(--ink-3); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.weekfoot .total .s { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.weekfoot .total .s .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.weekfoot .total .s.pending .dot { background: var(--warn); }

/* Bottom nav */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.bottomnav-in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); height: var(--nav-h); }
.bottomnav button { border: 0; background: transparent; color: var(--ink-4); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer; transition: color var(--t-fast) var(--ease-out); position: relative; }
.bottomnav button svg.i { width: 22px; height: 22px; }
.bottomnav button[aria-selected="true"] { color: var(--blue); }
.bottomnav button[aria-selected="true"]::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 2px; background: var(--blue); border-radius: 0 0 2px 2px; }

/* History */
.hist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.hist button { width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; text-align: left; cursor: pointer; }
.hist button:last-child { border-bottom: 0; }
@media (hover: hover) { .hist button:hover { background: var(--paper); } }
.hist .r { font-weight: 600; }
.hist .r small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.hist .h { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }

/* Panels (settings screens) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 18px; }
.panel h3 { margin-bottom: 6px; }
.panel .desc { font-size: 14px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.5; }
.install-tip { font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.install-tip ol { margin: 0; padding-left: 20px; }
.empty { text-align: center; padding: 32px 16px; color: var(--ink-3); font-size: 14px; }
.notice { font-size: 13px; color: var(--ink-3); }

/* Pick list (add crew dialog) */
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.pick-title { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 0; }
.pick-list button { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); cursor: pointer; font-weight: 500; }
.pick-list button:hover { background: var(--paper); }
.pick-list button.sel { border-color: var(--blue); background: var(--blue-tint); }

/* =========================================================
   OFFICE
   ========================================================= */
.adm { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.adm-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: var(--z-sticky); }
.adm-top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; height: 64px; }
.adm-top .who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.adm-body { display: grid; grid-template-columns: 232px 1fr; min-height: 0; }
.adm-nav { border-right: 1px solid var(--line); background: var(--surface); padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); }
.adm-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: transparent; border-radius: var(--r-2); text-align: left; font-weight: 600; font-size: 14.5px; color: var(--ink-3); cursor: pointer; position: relative; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.adm-nav button:hover { background: var(--paper); color: var(--ink); }
.adm-nav button[aria-selected="true"] { background: var(--blue-tint); color: var(--blue-ink); }
.adm-nav button[aria-selected="true"]::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--blue); border-radius: 0 2px 2px 0; }
.adm-nav .count { margin-left: auto; font-size: 12px; background: var(--paper-2); color: var(--ink-3); border-radius: 10px; padding: 2px 7px; font-weight: 600; }
.adm-nav button[aria-selected="true"] .count { background: var(--surface); color: var(--blue-ink); }
.adm-main { padding: 28px 32px 56px; min-width: 0; }
.adm-main > .view { max-width: 1280px; display: flex; flex-direction: column; gap: 20px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head h1 { font-size: 2.125rem; }
.view-head .sub { color: var(--ink-3); font-size: 14px; margin-top: 4px; max-width: 70ch; }
.view-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.weekbar { display: flex; align-items: center; gap: 8px; }
.weekbar .btn-sm { min-height: 36px; }
.weekbar .lbl { font-family: var(--display); font-weight: 700; font-size: 1.375rem; min-width: 200px; text-align: center; }
.weekbar .jump { border: 0; background: transparent; color: var(--blue); font-weight: 600; font-size: 13px; cursor: pointer; }

.statline { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; font-size: 13.5px; color: var(--ink-3); padding: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.statline b { color: var(--ink); font-family: var(--display); font-size: 1.25rem; margin-right: 5px; font-weight: 700; }
.statline .warn b { color: var(--warn); }
.statline .grow { flex: 1; }

/* Manager cards */
.mgrstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.mgrcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; text-align: left; transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.mgrcard:hover { border-color: var(--line-strong); }
.mgrcard[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-tint); }
.mgrcard .n { font-weight: 600; }
.mgrcard .m { font-size: 13px; color: var(--ink-3); display: flex; gap: 12px; }
.mgrcard .m b { color: var(--ink); font-family: var(--display); font-size: 1.1rem; }
.mgrcard .m .warn { color: var(--warn); }

/* Roster table */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: auto; }
table.roster { border-collapse: collapse; width: 100%; min-width: 1040px; font-size: 14px; }
.roster th { position: sticky; top: 0; z-index: 1; background: var(--paper); color: var(--ink-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.roster th:first-child, .roster td:first-child { text-align: left; position: sticky; left: 0; z-index: 2; background: inherit; }
.roster th:first-child { z-index: 3; }
.roster th.today { color: var(--blue); }
.roster th.pm { text-align: left; }
.roster td { padding: 0; border-bottom: 1px solid var(--line-2); text-align: right; background: var(--surface); }
.roster tbody tr:last-child td { border-bottom: 0; }
.roster tbody tr { cursor: pointer; }
.roster tbody tr:hover td { background: var(--blue-tint); }
.roster td .c { display: block; padding: 12px; }
.roster td.name .c { font-weight: 600; color: var(--ink); white-space: nowrap; }
.roster td.name .c small { display: block; font-weight: 400; color: var(--ink-4); font-size: 12px; margin-top: 1px; }
.roster td.pm .c { font-size: 13px; color: var(--ink-3); text-align: left; white-space: nowrap; }
.roster td.z .c { color: var(--line-strong); }
.roster td.total .c { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.roster td.ot .c { color: var(--warn); font-weight: 600; }
.roster td.today .c { background: var(--blue-wash); }
.roster tfoot td { background: var(--paper); font-weight: 700; border-top: 1px solid var(--line); }
.roster tfoot td:first-child { text-align: left; }
table.hist-table { min-width: 900px; }

/* Drawer */
.drawer-back { position: fixed; inset: 0; background: rgba(11, 46, 82, 0.4); z-index: var(--z-drawer); opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease-out); }
.drawer-back.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(100%, 540px); background: var(--surface); z-index: calc(var(--z-drawer) + 1); transform: translateX(100%); transition: transform 240ms var(--ease-out); display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.625rem; }
.drawer-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 14px; background: var(--paper); }
.drawer-foot { padding: 12px 22px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--surface); }
.drawer-foot .grow { flex: 1; }
.drawer .days .day-row { min-height: 56px; }
.drawer .job-line { grid-template-columns: 1fr auto; }
.drawer .job-line .meta { font-size: 13px; line-height: 1.35; }
.drawer .job-line .meta b { display: block; color: var(--ink); }
.drawer .job-line .meta span { color: var(--ink-4); }
.add-line { display: grid; grid-template-columns: 1fr 1fr 90px auto; gap: 6px; align-items: center; margin-top: 8px; }
.add-line .input { min-height: 38px; padding: 6px 8px; font-size: 13px; }
@media (max-width: 520px) { .add-line { grid-template-columns: 1fr 1fr; } }

/* Generic lists (managers, crew, jobs) */
table.list { border-collapse: collapse; width: 100%; font-size: 14px; }
.list th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.list td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.list td:first-child { white-space: nowrap; }
.list tbody tr:last-child td { border-bottom: 0; }
.list td.acts { text-align: right; white-space: nowrap; }
.list td.acts .btn { margin-left: 4px; }
.list tr.inactive td { color: var(--ink-4); }
.list .muted { color: var(--ink-4); font-size: 13px; }

.two { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .two { grid-template-columns: 1fr 380px; } }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pin-peek { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }

.settings-sec { display: flex; flex-direction: column; gap: 4px; }
.settings-sec h3 { margin-bottom: 4px; }
.settings-sec .desc { font-size: 14px; color: var(--ink-3); margin-bottom: 12px; }
.inline-fields { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.inline-fields .field { min-width: 150px; }
.inline-fields .field.grow { flex: 1; min-width: 220px; }
.acct-list { display: flex; flex-direction: column; }
.acct { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.acct:last-child { border-bottom: 0; }
.acct-acts { display: flex; gap: 4px; }

.log { font-size: 13px; }
.log td { padding: 9px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.log td.t { white-space: nowrap; color: var(--ink-4); }
.log td.a { font-weight: 600; white-space: nowrap; }
.log td.d { color: var(--ink-3); word-break: break-word; }
.log-more { display: flex; justify-content: center; padding: 12px 14px; border-top: 1px solid var(--line-2); }

/* Hours (per-person history) */
.hours { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.hours-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 88px; }
.hours-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: auto; max-height: calc(100vh - 210px); }
.hours-row { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; text-align: left; cursor: pointer; transition: background-color var(--t-fast) var(--ease-out); }
.hours-row:last-child { border-bottom: 0; }
.hours-row:hover { background: var(--paper); }
.hours-row.sel { background: var(--blue-tint); }
.hours-row.inactive .n { color: var(--ink-4); }
.hours-row .n { font-weight: 600; }
.hours-row .m { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.hours-row .m .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.hours-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hours-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hours-head h2 { font-size: 1.625rem; }
.hours-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.hours-head .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hours-head select.input { width: auto; min-height: 40px; }
.custom-range { display: inline-flex; gap: 6px; align-items: center; }
.custom-range .input { width: auto; min-height: 40px; padding: 6px 8px; }
.seg-sm { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--paper-2); border-radius: var(--r-2); padding: 3px; }
.seg-sm button { min-height: 30px; padding: 0 12px; border: 0; background: transparent; border-radius: var(--r-1); font-weight: 600; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.seg-sm button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(19, 24, 32, 0.14); }

/* Office on a phone */
@media (max-width: 860px) {
  .adm-body { grid-template-columns: 1fr; }
  .adm-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; gap: 4px; position: sticky; top: 64px; height: auto; }
  .adm-nav button { width: auto; white-space: nowrap; padding: 8px 12px; }
  .adm-nav button[aria-selected="true"]::before { display: none; }
  .adm-nav .count { margin-left: 6px; }
  .adm-main { padding: 16px 16px 40px; }
  .adm-top-in { padding: 0 16px; }
  .brand .sub { display: none; }
  .hours { grid-template-columns: 1fr; }
  .hours-side { position: static; }
  .hours-list { max-height: 260px; }
}

.restore { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.restore .desc { margin-bottom: 6px; }
input[type="file"].input { padding: 8px 10px; font-size: 14px; }
input[type="file"].input::file-selector-button { font: inherit; font-weight: 600; font-size: 13px; padding: 6px 10px; margin-right: 10px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); color: var(--ink); cursor: pointer; }
