/* Messenger Time Clock: shared styles for the tablet and manager screens.
   Brand: navy #221d52, cardinal #782434 (Messenger Branding Guide). Harvestital display, Lato body. */
@font-face { font-family: "Harvestital"; src: url(/fonts/harvestital.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Lato"; font-weight: 400; src: url(/fonts/lato-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Lato"; font-weight: 700; src: url(/fonts/lato-700.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Lato"; font-weight: 900; src: url(/fonts/lato-900.woff2) format("woff2"); font-display: swap; }

:root {
  --bg: #f3f4f8; --surface: #ffffff; --surface-2: #eceef4; --ink: #1f1c38; --muted: #5d6070; --line: #dadde6; --line-strong: #b9bec9;
  --head-bg: #221d52; --head-fg: #ffffff; --head-muted: #c1d4e6; --head-line: rgba(255,255,255,.14);
  --brand: #221d52; --action: #782434; --action-hover: #611c29; --action-fg: #ffffff; --rule: #782434;
  --in: #2f7d63; --in-bg: #e2f1ec; --lunch: #a8650f; --lunch-bg: #fbefdc; --bad: #a3283c; --bad-bg: #f7e3e7; --pto: #33647e; --pto-bg: #e3edf5;
  --on-status: #ffffff; --out-block: #e3e5ec; --focus: rgba(51,100,126,.45); --scrim: rgba(20,17,58,.55);
  --f-display: "Harvestital", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-body: "Lato", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e22; --surface: #1a1735; --surface-2: #231f45; --ink: #ecebf6; --muted: #a6a5c0; --line: #322e58; --line-strong: #4a4677;
    --head-bg: #0b0a1c; --head-muted: #9ab6d3; --head-line: rgba(255,255,255,.12);
    --brand: #c1d4e6; --action: #b03d55; --action-hover: #c24d65; --rule: #c24d65;
    --in: #5ec8a3; --in-bg: #123029; --lunch: #e6a54f; --lunch-bg: #33250f; --bad: #ef8a9b; --bad-bg: #3a1520; --pto: #9ab6d3; --pto-bg: #1c2a3d;
    --on-status: #0b0a1c; --out-block: #2c2950; --focus: rgba(154,182,211,.55); --scrim: rgba(0,0,0,.65);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h2, h3 { margin: 0; color: var(--brand); text-wrap: balance; }
h2 { font-size: 20px; } h3 { font-size: 17px; }
p { margin: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.num { font-variant-numeric: tabular-nums; }
.disp { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0; line-height: 1; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Header */
header.top { background: var(--head-bg); color: var(--head-fg); position: sticky; top: 0; z-index: 5; }
.top .bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 12px 8px; }
.brandline .eyebrow { color: var(--head-muted); }
.brandline .disp { font-size: 34px; }
.brandline .disp::after { content: ""; display: block; width: 44px; height: 3px; background: var(--rule); margin-top: 6px; }
.clock { text-align: right; }
.clock .now { font-size: 30px; font-weight: 900; line-height: 1; }
.clock .meta { font-size: 12.5px; color: var(--head-muted); }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--head-line); }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button { background: none; border: 0; color: var(--head-muted); font-weight: 700; font-size: 15px; padding: 12px 12px 10px; border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
nav.tabs button[aria-selected="true"] { color: var(--head-fg); border-bottom-color: var(--rule); }
nav.tabs .grow { flex: 1; }
.badge { background: var(--action); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 900; padding: 1px 7px; }
main { padding-block: 18px 48px; display: flex; flex-direction: column; gap: 16px; }
.banner { padding: 10px 14px; border-radius: var(--r-sm); background: var(--pto-bg); }
.banner.warn { background: var(--lunch-bg); } .banner.bad { background: var(--bad-bg); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm); font-weight: 700; font-size: 15px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--action); border-color: var(--action); color: var(--action-fg); }
.btn.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn.dark { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.btn.big { min-height: 60px; font-size: 19px; width: 100%; border-radius: var(--r-lg); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  min-height: 44px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 20px; height: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .per { font-weight: 900; font-size: 18px; color: var(--brand); }
.toolbar select { width: auto; min-width: 200px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-weight: 700; cursor: pointer; }
.seg input:checked + label { background: var(--brand); border-color: var(--brand); color: var(--surface); }

/* Status */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.strip .stat { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.strip .stat b { font-size: 20px; font-weight: 900; }
.strip .grow { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.d-in { background: var(--in); } .d-lunch { background: var(--lunch); } .d-pto { background: var(--pto); } .d-out { background: var(--line-strong); } .d-bad { background: var(--bad); }
.sblock { flex: none; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 7px 12px; border-radius: 8px; color: var(--on-status); white-space: nowrap; }
.sblock.in { background: var(--in); } .sblock.lunch { background: var(--lunch); } .sblock.bad { background: var(--bad); } .sblock.pto { background: var(--pto); }
.sblock.out { background: var(--out-block); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.pill.in { background: var(--in-bg); color: var(--in); } .pill.lunch, .pill.warn { background: var(--lunch-bg); color: var(--lunch); } .pill.pto { background: var(--pto-bg); color: var(--pto); } .pill.bad { background: var(--bad-bg); color: var(--bad); }

/* Building tabs and one-touch cards (tablet) */
.loctabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.loctabs::-webkit-scrollbar { display: none; }
.loctabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-weight: 900; font-size: 17px; white-space: nowrap; cursor: pointer; }
.loctabs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.loctabs .ct { font-size: 13px; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; }
.loctabs .here-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pc { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); min-width: 0; }
.pc.stale { border-color: var(--bad); }
.pc-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.pc-id { min-width: 0; }
.pc .nm { font-weight: 900; font-size: 19px; line-height: 1.25; }
.pc .sub { font-size: 13.5px; color: var(--muted); }
.pc .sub .ot { color: var(--lunch); font-weight: 700; }
.pc-acts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.btn.act { min-height: 60px; font-size: 18px; padding: 0 10px; border-radius: var(--r-lg); }
.others summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 12px 0; }

/* Racks (overview) */
.racks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.rack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rack-h { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--brand); padding-bottom: 8px; }
.rack-h .disp { font-size: 28px; color: var(--brand); }
.rowline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.rowline:last-child { border-bottom: 0; }
.rowline .nm { font-weight: 700; }

/* Panels, tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.kv { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 104px; background: var(--surface); }
.kv .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kv .v { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.kv.hl { border-color: var(--brand); }
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); font-weight: 700; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.wrapcell { white-space: normal; min-width: 220px; }
tr.total td { font-weight: 900; border-top: 2px solid var(--brand); border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
td .z { color: var(--line-strong); }
td input, td select { min-height: 36px; padding: 5px 8px; }
td input[type=number] { width: 90px; } td input[type=text] { width: 120px; } td select { width: auto; }
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 10px; border-radius: var(--r-sm); background: var(--lunch-bg); font-size: 14px; }
.issue.bad { background: var(--bad-bg); } .issue.info { background: var(--surface-2); }
.ok { padding: 10px 12px; border-radius: var(--r-sm); background: var(--in-bg); color: var(--in); font-weight: 700; }
.days { display: flex; flex-direction: column; }
.day { display: grid; grid-template-columns: 100px 1fr 70px auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.day .dl { font-weight: 700; font-size: 14px; } .day .we { color: var(--muted); font-weight: 400; }
.day .hrs { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.day .sh { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.shift { font-size: 13px; padding: 3px 8px; border-radius: var(--r-sm); background: var(--surface-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shift.open { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.shift.void { text-decoration: line-through; opacity: .6; }
.shift small { color: var(--muted); font-size: 11px; font-weight: 700; margin-left: 4px; }
.wk { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0 14px; font-weight: 700; color: var(--brand); border-bottom: 2px solid var(--brand); margin-bottom: 6px; }
.log { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.log > div { padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm); }
.req { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.req .who { font-weight: 700; min-width: 140px; } .req .what { flex: 1; min-width: 180px; font-size: 14px; } .req .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* Modal and full-screen overlays */
.modal { position: fixed; inset: 0; z-index: 20; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { background: var(--surface); color: var(--ink); border-radius: var(--r-lg); width: 100%; max-width: 480px; max-height: calc(100% - 16px); overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.sheet.wide { max-width: 720px; }
.sheet .disp.name { font-size: 38px; color: var(--brand); }
.sheet .x { align-self: flex-end; margin: -8px -8px -12px 0; }
.err { color: var(--bad); font-weight: 700; font-size: 14px; min-height: 1.2em; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.dots4 { display: flex; gap: 14px; }
.dots4 i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); }
.dots4 i.on { background: var(--brand); }
.pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.pad button { height: 70px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 26px; font-weight: 900; cursor: pointer; }
.pad button.t { font-size: 15px; font-weight: 700; background: none; }
.pad button:active { background: var(--line); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.confirm { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; background: var(--in); color: #fff; }
.confirm.lunch { background: #a8650f; } .confirm.out { background: #221d52; } .confirm.queued { background: #33647e; }
.confirm .check { width: 110px; height: 110px; border-radius: 50%; border: 6px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 900; line-height: 1; }
.confirm .who { font-family: var(--f-display); text-transform: uppercase; font-size: 54px; line-height: 1; }
.confirm .what { font-size: 26px; font-weight: 900; }
.confirm .when { font-size: 20px; opacity: .9; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--brand); color: var(--surface); padding: 12px 18px; border-radius: var(--r-sm); font-weight: 700; z-index: 40; max-width: calc(100% - 32px); }
.pairing { max-width: 440px; margin: 10vh auto; }
.code-show { font-size: 44px; font-weight: 900; letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums; color: var(--brand); }

@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
@media (max-width: 640px) {
  .brandline .disp { font-size: 28px; } .clock .now { font-size: 24px; } .clock { text-align: left; }
  .day { grid-template-columns: 74px 1fr 56px; } .day .ed { grid-column: 1 / -1; justify-self: start; }
  .modal { align-items: flex-end; padding: 0; }
  .sheet { border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 94%; }
  .pad { grid-template-columns: repeat(3, 74px); }
  .confirm .who { font-size: 40px; }
}
