/* Cow Dogging — mobile-first, outdoor-readable, light + dark */
:root {
  --bg: #f3f4f6; --surface: #ffffff; --surface2: #f8fafc; --border: #e2e8f0;
  --text: #0f172a; --muted: #64748b;
  --brand: #1e293b; --accent: #f59e0b; --primary: #2563eb; --primary-ink: #fff;
  --go: #16a34a; --stop: #dc2626; --warn: #d97706; --ok-bg: #dcfce7; --ok-fg: #166534;
  --bad-bg: #fee2e2; --bad-fg: #991b1b; --warn-bg: #fef3c7; --warn-fg: #92400e; --chip: #eef2f7;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
  --tabbar-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #111a2e; --surface2: #0f172a; --border: #22304a;
    --text: #e5e9f0; --muted: #94a3b8; --brand: #0b1120; --primary: #3b82f6;
    --ok-bg: #0f2e1d; --ok-fg: #86efac; --bad-bg: #3a1010; --bad-fg: #fca5a5; --warn-bg: #3a2a08; --warn-fg: #fcd34d; --chip: #1b2741;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}
body.no-scroll { overflow: hidden; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; margin-top: 1.25rem; }
p { margin: .4rem 0 .8rem; }
code { background: var(--chip); padding: 1px 5px; border-radius: 5px; }
.small { font-size: .85rem; } .muted { color: var(--muted); } .center { text-align: center; }
.ic { flex: none; vertical-align: middle; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; } .row.gap, .gap { gap: .6rem; } .row.end { justify-content: flex-end; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.nowrap { white-space: nowrap; }
.pad { padding: 0 1rem .75rem; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--brand); color: #fff; padding: calc(env(safe-area-inset-top, 0px) + .7rem) 1rem .7rem;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; letter-spacing: .01em; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .ic { color: var(--accent); }
.who { opacity: .85; text-align: right; }
.who .badge { background: rgba(255,255,255,.15); color: #fff; }
main { max-width: 640px; margin: 0 auto; padding: 1rem; }
main.wide { max-width: 1200px; }
main:focus { outline: none; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--border); height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tabbar a.on { color: var(--primary); }
@media (min-width: 768px) {
  body { padding-bottom: 0; padding-left: 88px; }
  .tabbar { top: 0; right: auto; width: 88px; height: 100vh; flex-direction: column; justify-content: flex-start; padding-top: 72px; border-top: 0; border-right: 1px solid var(--border); }
  .tabbar a { flex: 0 0 76px; }
  .topbar { margin-left: -88px; padding-left: calc(88px + 1rem); z-index: 40; }
}

.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.25rem; margin-bottom: calc(-1 * (var(--tabbar-h) + var(--safe-b))); }
.center-pad { display: flex; justify-content: center; padding: 3rem 0; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.narrow { width: 100%; max-width: 400px; }
.card.flush { padding: 0; overflow: hidden; }
.card.hl { border-color: var(--accent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { margin: 0; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card:not([open]) > summary { border-bottom: 0; }

.auth { text-align: center; }
.auth form { text-align: left; }
.auth-brand { margin-bottom: 1rem; }
.auth-brand .logo { display: block; height: 96px; width: auto; margin: 0 auto .5rem; }
.brand-logo { height: 30px; width: 30px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; flex: none; }
.auth-brand h1 { font-size: 1.5rem; margin: 0; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.lbl { display: block; margin-bottom: .35rem; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: .65rem .75rem; width: 100%; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); flex: none; margin: 2px 0 0; }
input[type=range] { padding: 0; min-height: 32px; accent-color: var(--primary); background: none; border: 0; }
select.lg { font-weight: 600; }
label.check { flex-direction: row; align-items: flex-start; gap: .6rem; color: var(--text); font-weight: 500; }
.req { color: var(--stop); font-weight: 500; font-size: .75rem; }
textarea { resize: vertical; }
.note-wrap summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-top: .75rem; }
details.card.note-wrap summary { margin: 0; }
.note-wrap textarea { margin-top: .5rem; }
.help summary { cursor: pointer; font-size: .85rem; color: var(--primary); margin-top: .5rem; }
.help p { font-size: .85rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600;
  min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s, filter .15s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:hover:not(:disabled) { filter: brightness(.97); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.go { background: var(--go); color: #fff; border-color: transparent; }
.btn.stop { background: var(--stop); color: #fff; border-color: transparent; }
.btn.warn { background: var(--warn); color: #fff; border-color: transparent; }
.btn.danger { background: var(--stop); color: #fff; border-color: transparent; }
.btn.danger.ghost { background: transparent; color: var(--stop); border-color: currentColor; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; margin-top: .6rem; }
.btn.lg { min-height: 52px; font-size: 1.05rem; }
.btn.xl { min-height: 72px; font-size: 1.25rem; border-radius: 16px; width: 100%; }
.btn.sm { min-height: 36px; padding: .35rem .75rem; font-size: .88rem; }
.btn.busy { position: relative; }
/* "Continue with Google": Google asks for a white button with their G mark, in light and dark mode. */
.btn.google { background: #fff; color: #1f1f1f; border-color: #747775; }
.btn.google .g { flex: none; }
#socialWrap[hidden], #socialWrap [hidden] { display: none; }
#socialWrap .btn.block { margin-top: 0; }
.btn.apple { background: #000; color: #fff; border-color: #000; }
.auth > .small.muted { margin-top: .85rem; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin-top: .4rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn.disabled { opacity: .35; pointer-events: none; }
.link { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: .25rem; align-self: center; }
.seg { display: flex; background: var(--chip); border-radius: 10px; padding: 3px; margin-bottom: 1rem; }
.seg button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; padding: .55rem; border-radius: 8px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- clock screen ---------- */
.status-card { border-radius: 20px; padding: 1.25rem; margin-bottom: 1rem; color: #fff; background: #475569; box-shadow: var(--shadow); }
.status-card.on { background: linear-gradient(135deg, #15803d, #16a34a); }
.status-card.break { background: linear-gradient(135deg, #b45309, #d97706); }
.status-line { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; }
.status-card .dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.55); }
.status-card.on .dot { background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.timer { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: .25rem 0 0; }
.status-sub { opacity: .92; margin-top: .25rem; }
.loc-card { padding: .85rem 1rem; }
.loc { display: flex; gap: .7rem; align-items: flex-start; }
.loc .ic { margin-top: 2px; }
.loc.ok .ic { color: var(--go); } .loc.bad .ic { color: var(--stop); }
.loc.bad b { color: var(--stop); }
.actions { display: grid; gap: .75rem; margin-bottom: 1rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.stats.three { grid-template-columns: 1fr 1fr 1fr; }
.stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; display: flex; flex-direction: column; }
.stats b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ot { color: var(--warn); }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.plist li:first-child { border-top: 0; }
.plist .t { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: auto; }
.k { font-weight: 600; font-size: .9rem; }
.k-in { color: var(--go); } .k-out { color: var(--stop); } .k-break_start, .k-break_end { color: var(--warn); }

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; text-align: center; }
.day-head { display: flex; justify-content: space-between; margin-bottom: .25rem; }
.shift { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--border); }
.shift .hrs { font-weight: 700; font-variant-numeric: tabular-nums; }
.flags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.bad { background: var(--bad-bg); color: var(--bad-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.pill { white-space: nowrap; }
.pill.on { background: var(--ok-bg); color: var(--ok-fg); } .pill.break { background: var(--warn-bg); color: var(--warn-fg); }
.pill.near { background: var(--warn-bg); color: var(--warn-fg); margin-top: 4px; } .pill.ot { background: var(--bad-bg); color: var(--bad-fg); margin-top: 4px; }
.dotflag { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.dotflag.bad { background: var(--stop); } .dotflag.warn { background: var(--warn); }

/* ---------- admin ---------- */
.subnav { display: flex; gap: .35rem; overflow-x: auto; margin: -.25rem -1rem 1rem; padding: .25rem 1rem; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .85rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.subnav a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .subnav a.on { background: var(--primary); border-color: var(--primary); } }
.banner { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; background: #dbeafe; color: #1e40af; text-decoration: none; font-weight: 600; }
.banner.warn { background: var(--warn-bg); color: var(--warn-fg); }
.banner.bad { background: var(--bad-bg); color: var(--bad-fg); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.kpi b { font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi.on b { color: var(--go); } .kpi.break b { color: var(--warn); } .kpi.bad b { color: var(--stop); }
.grid2 { display: grid; gap: 1rem; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.crew, .list { list-style: none; margin: 0; padding: 0; }
.crew li, .list li { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid var(--border); }
.crew li:first-child, .list li:first-child { border-top: 0; }
.list li.clickable, tr.clickable { cursor: pointer; }
.list li.clickable:hover, tr.clickable:hover { background: var(--surface2); }
.crew .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .85rem; background: var(--chip); color: var(--muted); }
.avatar.on { background: var(--go); color: #fff; } .avatar.break { background: var(--warn); color: #fff; }
.map { height: 360px; background: var(--surface2); }
.small-map { height: 220px; border-radius: 10px; margin: .5rem 0; overflow: hidden; }
#jMap { height: 300px; border-radius: 10px; overflow: hidden; }
.map-fallback { padding: 1rem; }
.map-pop { font: 13px/1.45 system-ui, sans-serif; color: #0f172a; }
.map-pop a { color: #2563eb; }
.pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 10px/1 sans-serif; color: #fff; background: #475569; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin.on, .pin.inside { background: var(--go); } .pin.break { background: var(--warn); } .pin.outside { background: var(--stop); } .pin.job { background: var(--primary); }
.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar h2 { margin: 0; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .45rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: .88rem; font-weight: 600; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.range { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.range input { width: auto; min-height: 38px; padding: .35rem .5rem; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; align-items: flex-end; }
.filters label { flex: 1 1 140px; }
.filters label.check { flex: 0 0 auto; align-items: center; min-height: 44px; }
.filters input, .filters select { min-height: 38px; padding: .4rem .55rem; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: .6rem .75rem; text-align: left; border-top: 1px solid var(--border); vertical-align: middle; }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface2); border-top: 0; white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 700; background: var(--surface2); }
.tbl tr.dim td { color: var(--muted); }
.tbl tr.open td { background: var(--surface2); }
.tbl tr.voided td { opacity: .55; text-decoration: line-through; }
.tbl tr.voided td .badge { text-decoration: none; }
.tbl tr.detail > td { background: var(--surface2); padding: .5rem .75rem 1rem; }
.tbl.inner { font-size: .85rem; background: var(--surface); border-radius: 10px; overflow: hidden; }
.punch-meta { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.audit { padding-left: 1.1rem; margin: 0; }
.audit li { margin-bottom: .6rem; color: var(--text); }
.diff { color: var(--muted); }

/* ---------- modal / toast / spinner ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b); animation: up .18s ease-out; }
.modal.wide { max-width: 760px; }
@media (min-width: 640px) { .modal-wrap { align-items: center; padding: 1rem; } .modal { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .5rem; background: var(--surface); }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: .5rem 1rem 1.25rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); z-index: 200;
  background: #0f172a; color: #fff; padding: .8rem 1.1rem; border-radius: 12px; max-width: min(92vw, 520px); font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: all .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #166534; } .toast.error { background: #b91c1c; } .toast.warn { background: #b45309; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- print (timesheets) ---------- */
@media print {
  body { background: #fff; padding: 0; color: #000; }
  .topbar, .tabbar, .subnav, .toolbar, .card-head .row, .banner, #toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; }
  .tbl tr.detail[hidden] { display: none; }
}

/* Routes (shift GPS tracking) */
.map.tall { height: 420px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .75rem; padding: .55rem 0 .55rem .75rem; border-left: 3px solid var(--border); cursor: pointer; }
.timeline li .t { min-width: 4.8rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.timeline li.go { border-color: var(--go); } .timeline li.stop { border-color: var(--stop); }
.timeline li.warn { border-color: var(--warn); } .timeline li.job { border-color: var(--primary); }
.timeline li.bad { border-color: var(--stop); background: var(--bad-bg); }
.toolbar select, .toolbar input[type=date] { width: auto; flex: 0 1 auto; }

/* missed-punch requests, weekly sign-off */
.row.between { justify-content: space-between; }
ul.plain { list-style: none; margin: .5rem 0 0; padding: 0; }
li.mreq { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--border); }
li.mreq .right { text-align: right; }
.badge.bad { background: var(--bad-bg); color: var(--bad-fg); }

/* admin: employee page */
.person-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.person-head h2 { margin: 0 0 .15rem; font-size: 1.25rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.wchart .plot { position: relative; height: 170px; display: flex; align-items: flex-end; gap: 8px; border-bottom: 1px solid var(--border); margin-top: 1.25rem; }
.wbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 2px; position: relative; outline: none; }
.wbar b { text-align: center; font-size: .75rem; font-variant-numeric: tabular-nums; color: var(--text); margin-bottom: 2px; }
.wbar i { display: block; }
.wbar i:first-of-type { border-radius: 4px 4px 0 0; }
.wbar i.reg { background: var(--primary); } .wbar i.ot { background: var(--warn); }
.wbar:hover i, .wbar:focus i { filter: brightness(1.1); }
.otline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); pointer-events: none; }
.otline span { position: absolute; right: 0; top: -1.1rem; font-size: .7rem; color: var(--muted); }
.wchart .xl { display: flex; gap: 8px; } .wchart .xl span { flex: 1; text-align: center; font-size: .7rem; color: var(--muted); padding-top: 4px; }
.legend { display: inline-flex; align-items: center; gap: .35rem; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: .4rem; } .sw.reg { background: var(--primary); } .sw.ot { background: var(--warn); }
ul.hbars { list-style: none; padding: 0; margin: .5rem 0 0; }
ul.hbars li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .9rem; }
ul.hbars li .grow { flex: 1 1 40%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { flex: 1 1 45%; height: 10px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
ul.hbars b { width: 3.5rem; text-align: right; font-variant-numeric: tabular-nums; }
/* admin: reports grid */
.tbl.grid th, .tbl.grid td { padding-left: .4rem; padding-right: .4rem; }
.tbl.grid .wkend { background: var(--chip); }
.tbl.grid td.long { color: var(--warn-fg); background: var(--warn-bg); font-weight: 700; }

@media (min-width: 900px) { .subnav { flex-wrap: wrap; overflow: visible; } }

/* tablets: crew screens use the wider screen */
@media (min-width: 768px) {
  main.clock, main.hours { max-width: 1040px; padding: 1.25rem 1.5rem; }
  main.clock { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  main.clock .clock-side { position: sticky; top: 5rem; }
  main.clock .timer { font-size: 4rem; }
  main.clock .actions { grid-template-columns: 1fr 1fr; }
  main.clock .actions .btn:only-child, main.clock .actions .btn.block { grid-column: 1 / -1; }
  main.hours .days { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start; }
  main.hours .days > .card:only-child { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  main.hours .days { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- daily reports (js/reports.js): same sections as the Drive template ---------- */
.banner.ok { background: var(--ok-bg); color: var(--ok-fg); }
.warn-text { color: var(--warn-fg); }
.file-hide { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
label.btn { position: relative; flex-direction: row; font-size: .88rem; color: var(--text); }
.dr-date { align-items: flex-end; }
.dr-date input { width: auto; }
.dr-title { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; border-bottom: 2px solid var(--accent); padding-bottom: .5rem; margin-bottom: .75rem; }
.dr-title b { font-size: 1.1rem; letter-spacing: .04em; }
.dr-title span { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .9rem; }
.dr-grid > div { display: flex; flex-direction: column; }
.dr-grid .lbl, .dr-row .lbl, .dr-sigrow .lbl { font-size: .75rem; font-weight: 700; color: var(--muted); margin: 0 0 .15rem; }
.dr-rows .dr-hdr { display: none; }
.dr-row { border-top: 1px solid var(--border); }
.dr-hdr + .dr-row { border-top: 0; }
.dr-sum { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .8rem 1rem; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; min-height: 52px; }
.dr-sum b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-sum .t { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dr-rows.work .dr-sum .t { margin-left: 0; }
.dr-sum .h { font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 3.6rem; text-align: right; }
.dr-sum .ic { color: var(--muted); }
.dr-row.open .dr-sum { background: var(--surface2); }
.dr-fields { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .6rem; padding: .25rem 1rem 1rem; background: var(--surface2); }
.dr-row.open .dr-fields { display: grid; }
.dr-fields label { gap: 0; }
.dr-fields input, .dr-fields select { min-height: 44px; padding: .4rem .55rem; font-size: 1rem; }
.dr-fields .name, .dr-fields .task { grid-column: 1 / -1; }
.dr-fields > .icon-btn { grid-column: 1 / -1; justify-self: end; width: auto; padding: 0 .75rem; height: 36px; color: var(--stop); }
.dr-fields > .icon-btn::after { content: 'Remove'; font-size: .85rem; font-weight: 600; margin-left: .3rem; }
.dr-notes { display: grid; gap: .75rem; }
.dr-notes label span { color: var(--text); font-weight: 600; } .dr-notes i { color: var(--muted); font-weight: 400; font-size: .8rem; }
.dr-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-top: .75rem; }
.dr-photos figure { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface2); }
.dr-photos .ph { aspect-ratio: 4 / 3; background: var(--chip); }
.dr-photos img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.dr-photos figcaption { padding: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.dr-photos figcaption input, .dr-photos figcaption textarea { font-size: .88rem; padding: .35rem .5rem; min-height: 34px; }
.ph-full { width: 100%; height: auto; border-radius: 10px; }
.dr-sigrow { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .75rem; }
.dr-sigrow img.sig { max-width: 100%; height: 70px; object-fit: contain; background: #fff; border-radius: 6px; display: block; }
.sigline { height: 56px; border-bottom: 1px solid var(--muted); }
.sigpad { position: relative; height: 200px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; margin-bottom: .75rem; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.sigpad .x { position: absolute; left: 14px; bottom: 34px; color: #94a3b8; pointer-events: none; }
.sigpad::after { content: ''; position: absolute; left: 34px; right: 14px; bottom: 40px; border-bottom: 1px solid #cbd5e1; pointer-events: none; }
main.report { max-width: 760px; }

/* tablets and the website: rows line up as table columns like the paper log */
@media (min-width: 900px) {
  main.report { max-width: 1180px; }
  .dr-grid { grid-template-columns: repeat(4, 1fr); }
  .dr-rows .dr-hdr { display: grid; padding: .5rem 1rem; background: var(--surface2); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); gap: .5rem; }
  .dr-row .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dr-sum { display: none; }
  .dr-fields, .dr-row.open .dr-fields { display: grid; background: none; padding: .45rem 1rem; align-items: center; gap: .5rem; }
  .dr-rows.att .dr-hdr, .dr-rows.att .dr-fields { grid-template-columns: 2fr 1.3fr .9fr 1.1fr 1.1fr 1.1fr 1.1fr .8fr .7fr 34px; }
  .dr-rows.work .dr-hdr, .dr-rows.work .dr-fields { grid-template-columns: 1.2fr 3fr 1fr 1.1fr 1.1fr .8fr .8fr 34px; }
  .dr-fields input, .dr-fields select { min-height: 40px; font-size: .92rem; padding: .35rem .45rem; }
  .dr-fields .name, .dr-fields .task { grid-column: auto; }
  .dr-fields > .icon-btn { grid-column: auto; width: 34px; height: 34px; padding: 0; color: var(--text); }
  .dr-fields > .icon-btn::after { content: none; }
  .dr-notes { grid-template-columns: 1fr 1fr; }
}

/* the report as printed / previewed: plain tables like the Drive template */
.dr-preview { overflow-x: auto; }
.dr-print { color: #000; background: #fff; font-size: 11px; line-height: 1.3; padding: 12px; border-radius: 8px; min-width: 640px; }
.dr-print table { width: 100%; border-collapse: collapse; margin: 0 0 10px; }
.dr-print th, .dr-print td { border: 1px solid #94a3b8; padding: 3px 5px; text-align: left; vertical-align: top; }
.dr-print th { background: #f1f5f9; font-weight: 700; white-space: nowrap; }
.dr-print .dp-title { display: flex; align-items: center; gap: 10px; border: 1px solid #94a3b8; border-bottom: 0; padding: 6px 8px; }
.dr-print .dp-title img { width: 48px; height: 48px; }
.dr-print .dp-title b { font-size: 16px; letter-spacing: .05em; display: block; }
.dr-print .dp-title span { font-size: 10px; font-weight: 700; color: #475569; }
.dr-print .dp-head { table-layout: fixed; }
.dr-print tr.sec td { background: #1e293b; color: #fff; }
.dr-print tr.sec td b { margin-right: 8px; }
.dr-print .notes td { width: 50%; } .dr-print .notes i { color: #475569; }
.dr-print .nt { min-height: 34px; white-space: pre-wrap; margin-top: 3px; }
.dr-print .dp-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.dr-print .dp-photos figure { margin: 0; break-inside: avoid; }
.dr-print .dp-photos img { width: 100%; height: 170px; object-fit: cover; border: 1px solid #94a3b8; }
.dr-print .dp-photos figcaption { font-size: 10px; }
.dr-print .sign td { width: 35%; height: 60px; } .dr-print .sign img { height: 54px; max-width: 100%; object-fit: contain; display: block; }
.dr-print .dp-foot { text-align: center; font-size: 9px; color: #475569; margin: 6px 0 0; }
.print-host { display: none; }
@media print {
  body.printing-report > *:not(.print-host) { display: none !important; }
  body.printing-report .print-host { display: block; }
  body.printing-report .dr-print { min-width: 0; padding: 0; }
  .dr-print table, .dr-print tr { break-inside: avoid; }
  @page { margin: 12mm; }
}

/* ---------- problem photos ---------- */
.problem-link { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--text); }
.problem-link > svg:first-child { color: var(--primary); flex: none; }
.rc-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin: .25rem 0 .5rem; font-size: 1.1rem; }
.rc-amt { font-size: 1.35rem; }
.pb-note { white-space: pre-wrap; font-size: 1.02rem; margin: .5rem 0 .75rem; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; padding: .75rem; }
.pb-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface2); text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.pb-card .ph { position: relative; aspect-ratio: 4 / 3; background: var(--chip); }
.pb-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-count { position: absolute; right: .4rem; bottom: .4rem; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.pb-txt { padding: .55rem .65rem; display: flex; flex-direction: column; gap: .2rem; }

/* ---------- calendar ---------- */
.seg a { flex: 1; text-align: center; font-weight: 600; padding: .55rem; border-radius: 8px; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.day.today { border-color: var(--primary); }
.cal-ev .ic { vertical-align: -2px; }
.cal-ev.mine { box-shadow: inset 3px 0 0 var(--primary); padding-left: .6rem; }
.cal-notes { margin-top: .35rem; }
.cal-notes summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.cal-notes > div { margin-top: .35rem; overflow-wrap: anywhere; }
.cal-steps { padding-left: 1.2rem; margin: .75rem 0; }
.cal-steps li { margin-bottom: .35rem; }
.cal-code { width: 100%; margin-top: .75rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }
.cal-link select { width: auto; flex: 0 1 240px; }
.cal-link span { overflow-wrap: anywhere; }
.cal-in { margin-top: .5rem; }
