/* Pinga — playful but calm. Mango orange, ink navy, cream. Nunito (self-hosted, slimmed). */
@font-face { font-family: Nunito; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/nunito-400.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/nunito-700.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 800; font-style: normal; font-display: swap; src: url(../fonts/nunito-800.woff2) format("woff2"); }

:root {
  /* Brand */
  --mango: #FF8A1F;          /* primary: buttons, highlights (with ink text on top) */
  --mango-press: #F07A0C;
  --mango-soft: #FFE8D1;     /* selected / highlighted backgrounds */
  --mango-ink: #A84E00;      /* orange for text and links (readable on cream and white) */
  --ink: #14213D;            /* text and headings */
  --cream: #FFF8EE;          /* page background */
  --card: #FFFFFF;
  --muted: #5B6478;
  --line: #F0E4D3;
  /* Statuses only */
  --ok: #1E7B45;   --ok-bg: #E2F4E8;
  --late: #94570A; --late-bg: #FFEFD4;
  --bad: #C0281B;  --bad-bg: #FDE7E4;
  --grey: #5B6478; --grey-bg: #F1ECE4;
  --info: #2155B8; --info-bg: #E6EEFC;

  --radius: 16px;
  --tabbar: 68px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 17px/1.45 Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--mango-ink); text-decoration: none; font-weight: 700; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 0 0 4px; font-weight: 800; }
h3 { font-weight: 800; }
p { margin: 0 0 12px; }
b, strong { font-weight: 800; }
.muted { color: var(--muted); font-size: 15px; font-weight: 400; }
.center { text-align: center; }
.ic { flex: none; vertical-align: middle; }

.page { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; padding-top: max(20px, env(safe-area-inset-top)); }
.narrow { max-width: 440px; }
.brand { margin: 12px 0 28px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 24px; color: var(--ink); letter-spacing: -0.01em; }
.loading { min-height: 90vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); margin: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; padding: 8px 0; margin-bottom: 12px; }
.foot { text-align: center; margin-top: 20px; font-size: 15px; }

/* Header: logo + company, page title, sign out */
.bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.bar h1 { margin: 0; }
.company { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; font-weight: 700; margin-bottom: 2px; }

.stack { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; }
input, select, textarea {
  font: inherit; font-weight: 400; width: 100%; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card);
}
input, select { height: 54px; padding: 0 14px; }
textarea { padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2.5px solid var(--mango); outline-offset: -1px; border-color: transparent; }
input[readonly] { font-size: 14px; color: var(--muted); }
input[type=search] { margin-bottom: 10px; }

fieldset.choices { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 15px; font-weight: 700; padding: 0; margin-bottom: 6px; }
.choice { flex-direction: row; align-items: center; gap: 12px; font-weight: 400; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.choice input { width: 22px; height: 22px; accent-color: var(--mango); flex: none; }
.choice:has(input:checked) { border-color: var(--mango); background: #FFFBF6; }

button, .button {
  font: inherit; font-weight: 800; min-height: 54px; border-radius: 16px; border: 0; padding: 0 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; cursor: pointer;
}
.primary { background: var(--mango); color: var(--ink); box-shadow: 0 2px 0 rgba(20,33,61,.12); }
.primary:active { background: var(--mango-press); transform: translateY(1px); box-shadow: none; }
.secondary { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
button:disabled { opacity: .55; }
button.link { background: none; color: var(--mango-ink); width: auto; min-height: 44px; padding: 0 4px; font-weight: 700; white-space: nowrap; flex: none; }
.error { color: var(--bad); font-size: 15px; margin: 0; min-height: 1px; font-weight: 700; }
.error:empty { display: none; }
.big { min-height: 66px; font-size: 21px; border-radius: 20px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(20,33,61,.05), 0 4px 14px rgba(20,33,61,.04); }
.card .stack, .card.stack { margin-top: 0; }
.hero { padding: 24px 20px; margin-bottom: 18px; }
.list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: inherit; font-weight: 400; }
.grow { flex: 1; }
.chev { color: var(--muted); display: inline-flex; }
.hint { font-weight: 400; font-size: 13px; }
.section { font-size: 18px; margin: 28px 0 0; }
.tiny { font-size: 13px; }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hide { display: none !important; }

/* Pills (statuses use status colours only) */
.pill { font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--grey-bg); color: var(--grey); display: inline-flex; align-items: center; gap: 4px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait, .pill.warn { background: var(--late-bg); color: var(--late); }
.pill.warn { margin-top: 4px; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.near { background: var(--mango); color: var(--ink); }
.late { color: var(--late); font-weight: 800; }
.ok-text { color: var(--ok); font-weight: 800; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0 auto; max-width: 420px; z-index: 50;
  background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 16px; font-size: 15px; font-weight: 700; text-align: center;
}
.has-tabs .toast, body:has(.tabbar) .toast { bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); }

/* Navigation: top segmented control on desktop, bottom tab bar on phones */
.tabs { display: none; gap: 4px; background: #F3E9DB; border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.tabs a { flex: 1; text-align: center; padding: 10px 0; border-radius: 11px; color: var(--ink); font-weight: 700; font-size: 15px; }
.tabs a.on { background: var(--card); box-shadow: 0 1px 3px rgba(20,33,61,.1); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); min-height: var(--tabbar);
}
/* Every tab identical: icon on top in a fixed-size slot, label underneath; only the colour changes. */
.tabbar a { flex: 1 1 0; min-width: 0; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
  padding: 4px 0 2px; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 700; text-align: center; }
.tabbar a .ic { display: block; width: 24px; height: 24px; margin: 4px 0 2px; }
.tabbar a span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar a.on { color: var(--mango); font-weight: 800; }
.has-tabs { padding-bottom: calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); }
/* Desktop = a wide screen with a mouse. Phones and tablets (any width) keep the bottom tab bar. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .tabs { display: flex; }
  .tabbar.manager { display: none; }
  .has-tabs.manager-page { padding-bottom: 48px; }
  .manager-page ~ .toast { bottom: max(16px, env(safe-area-inset-bottom)); }
}

.banner { background: var(--late-bg); color: var(--late); font-weight: 700; font-size: 14px; padding: 11px 14px; border-radius: 14px; }
a.banner { display: block; color: var(--late); margin-bottom: 14px; }
.banner.bad-banner { background: var(--bad-bg); color: var(--bad); }
p.banner { margin: 0 0 14px; }

/* Staff: home and clock-in */
.status { font-size: 17px; margin: 0; }
.waiting { text-align: center; color: var(--late); font-size: 15px; font-weight: 700; margin-top: 16px; }
.empty { margin-top: 24px; }
.camera { width: 220px; height: 220px; margin: 12px auto 16px; border-radius: 50%; overflow: hidden; background: #F1E6D6; border: 5px solid var(--card); box-shadow: 0 0 0 3px var(--mango-soft); }
.camera video { width: 100%; height: 100%; object-fit: cover; transform: none; }
.camera video.mirror { transform: scaleX(-1); }
.camera.off { height: 0; margin: 0; border: 0; box-shadow: none; }
.where { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 15px; color: var(--muted); min-height: 22px; font-weight: 700; }
.where.good { color: var(--ok); }
.where.warn { color: var(--late); }
.where.bad { color: var(--bad); }
.consent { font-size: 14px; color: var(--muted); background: var(--card); border-radius: 14px; padding: 12px 14px; }

.person { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.person h1, .person p { margin: 0; }
.face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #F1E6D6; flex: none; }
.record { align-items: flex-start; justify-content: flex-start; }
.thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #F4ECE1; flex: none; }

/* Field visits */
.prog { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.prog h3 { margin: 0 0 2px; font-size: 19px; }
.prog p { margin: 0; }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--mango) calc(var(--p) * 1%), #F3E9DB 0); }
.ring.done { background: conic-gradient(var(--ok) calc(var(--p) * 1%), #F3E9DB 0); }
.ring div { width: 68px; height: 68px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 23px; line-height: 1; }
.ring small { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.sortbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sortbar h3 { margin: 0; font-size: 18px; }
.seg { display: flex; background: #F3E9DB; padding: 3px; border-radius: 12px; gap: 2px; }
.seg button { width: auto; min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; background: transparent; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,33,61,.1); }
.sortnote { font-size: 13px; color: var(--muted); margin: 8px 2px; min-height: 18px; }
.sortnote b { color: var(--mango-ink); }
.slist { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(20,33,61,.05); }
.store { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 0; padding: 14px 16px; background: var(--card); color: var(--ink);
  border-radius: 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; justify-content: flex-start; }
.store:last-child { border-bottom: 0; }
.store:active { background: #FFFBF6; }
.store .grow { display: flex; flex-direction: column; gap: 2px; }
.store .ic-box { width: 44px; height: 44px; border-radius: 14px; background: var(--mango-soft); color: var(--mango-ink); display: flex; align-items: center; justify-content: center; flex: none; font-size: 17px; font-weight: 800; }
.store.done .ic-box { background: var(--ok-bg); color: var(--ok); }
.store.done b { color: var(--muted); }
.store.next { background: #FFFBF6; box-shadow: inset 0 0 0 2.5px var(--mango); border-radius: var(--radius); }
.store.next .ic-box { background: var(--mango); color: var(--ink); }
.eyebrow { margin: 0; font-size: 14px; }
.gps { display: flex; align-items: flex-start; gap: 8px; border-radius: 14px; padding: 12px 14px; background: var(--grey-bg); font-weight: 700; font-size: 15px; margin: 14px 0 0; }
.gps.ok { background: var(--ok-bg); color: var(--ok); }
.gps.warn { background: var(--late-bg); color: var(--late); }
.gps.bad { background: var(--bad-bg); color: var(--bad); font-weight: 400; display: block; }
.gps .tiny { opacity: .85; }
.stack.tight { gap: 10px; margin: 0 0 14px; }
.shot { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; }
.link.block { width: 100%; margin-top: 6px; }
.link-row { color: var(--ink); padding: 8px 0 2px; }
.note { font-size: 14px; color: var(--ink); }

/* Manager pages */
.pair { display: flex; gap: 12px; }
.pair label { flex: 1; }
.narrow-form { max-width: 440px; }
fieldset.days { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.days label { flex-direction: row; align-items: center; gap: 6px; font-weight: 700; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.days input { width: 18px; height: 18px; accent-color: var(--mango); }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form label { flex: 1; }
.inline-form button { width: auto; }
.inline-form .error { flex-basis: 100%; }

/* Today */
.dayrow { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dayrow input { width: auto; height: 46px; }
.chips { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 -16px 12px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { width: auto; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); font-weight: 700; font-size: 14px; white-space: nowrap; flex: none; }
.chip b { color: var(--muted); font-weight: 800; margin-left: 4px; }
.chip.zero { opacity: .5; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); opacity: 1; }
.chip.on b { color: #fff; opacity: .8; }
.selall { flex-direction: row; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 4px 16px 8px; }
.selall input, .ck input { width: 22px; height: 22px; accent-color: var(--mango); }
.board { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(20,33,61,.05); }
.brow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brow:last-child { border-bottom: 0; }
.brow.sel { background: var(--mango-soft); }
.brow .ck { flex: none; padding: 6px; margin: -6px; }
.brow .grow { display: flex; flex-direction: column; gap: 2px; color: var(--ink); min-width: 0; }
.brow .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; flex: none; }
.by { display: block; }
.has-bulk { padding-bottom: calc(var(--tabbar) + 170px); }
.bulkbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 30; background: rgba(255,255,255,.98); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(20,33,61,.08);
  padding: 12px 16px; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) { .bulkbar { bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); } .has-bulk { padding-bottom: 170px; } }
.bulkbar > div { max-width: 720px; margin: 0 auto; }
.bulk-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bulk-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bulk-btns button { min-height: 46px; padding: 0 4px; font-size: 14px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; }
.bulk-btns button.ghost { color: var(--muted); }
.bulk-btns button:active { background: var(--mango-soft); }

/* Overview */
.dateline { margin: -8px 0 14px; }
.block { margin-bottom: 14px; padding: 18px; }
.block h2 { font-size: 18px; margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 92px; padding: 14px 16px; border-radius: 16px; color: var(--ink); }
.tile b { font-size: 36px; line-height: 1; font-weight: 800; }
.tile span { font-size: 15px; font-weight: 700; }
.tile.present { background: var(--ok-bg); } .tile.present b { color: var(--ok); }
.tile.late { background: var(--late-bg); } .tile.late b { color: var(--late); }
.tile.notin { background: var(--bad-bg); } .tile.notin b { color: var(--bad); }
.tile.away { background: var(--grey-bg); } .tile.away b { color: var(--grey); }
.tile:active { transform: scale(.98); }
.offices { list-style: none; margin: 12px 0 0; padding: 0; }
.offices li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.offices li > span:last-child { white-space: nowrap; }
.offices li.total { font-weight: 800; }
.big-line { font-size: 17px; margin: 0 0 8px; }
.meter { height: 10px; background: #F3E9DB; border-radius: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--mango); border-radius: 10px; }
.map { height: 240px; border-radius: 14px; margin-top: 14px; background: #EFE6D8; overflow: hidden; z-index: 0; }
.legend { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9A9AA0; display: inline-block; }
.dot.on { background: var(--ok); }
.legend i.dot:nth-of-type(2) { margin-left: 10px; }
.notes { margin: 0; padding-left: 18px; }
.notes li { margin-bottom: 8px; }
.money { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.happy-state { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px; background: #FFFBF6; border-radius: 14px; }
.happy-state .happy { flex: none; }
.happy-state p { margin: 0; font-weight: 700; }

/* Get started */
.getstarted .head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.getstarted .head h2 { margin: 0; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--ink); }
.checklist li > a { display: flex; align-items: center; gap: 12px; flex: 1; color: var(--ink); }
.checklist .tick { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid #D9CFC2; display: flex; align-items: center; justify-content: center; flex: none; background: var(--card); }
.checklist .tick .ic { display: block; }
.checklist .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.checklist .title { display: block; font-weight: 800; font-size: 16px; line-height: 1.3; }
.checklist .desc { display: block; font-weight: 400; font-size: 13px; line-height: 1.35; color: var(--muted); margin-top: 2px; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .done .title { color: var(--muted); }
.checklist .next .tick { border-color: var(--mango); }
.checklist .next .title { color: var(--ink); }
.checklist .next .go { color: var(--mango-ink); flex: none; }
.checklist .later { opacity: .7; }

/* Setup */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 32px; background: #D9CFC2; transition: background .2s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--mango); outline-offset: 2px; }

/* Billing */
.plan-state { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.plan-state.ok { color: var(--ok); }
.plan-state.bad { color: var(--bad); }

.print-only { display: none; }
@media print {
  body { background: #fff; }
  #app > main, .toast, .bulkbar, .tabbar { display: none !important; }
  .print-only { display: block; font-size: 11px; }
  .print-only h1 { font-size: 18px; }
  .print-only table { width: 100%; border-collapse: collapse; }
  .print-only th, .print-only td { border-bottom: 1px solid #ccc; padding: 4px 6px; text-align: left; }
  .print-only thead { display: table-header-group; }
}
.staff-hero { display: flex; align-items: center; gap: 16px; }
.staff-hero h2 { margin: 0 0 2px; }
.page:has(.tabbar) { padding-bottom: calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) { .page:has(.tabbar.manager) { padding-bottom: 48px; } }
