/* Pinga — calm, simple, one accent colour. System fonts only (nothing to download). */
:root {
  --accent: #0b7a5c;
  --accent-press: #08624a;
  --bg: #f5f5f7;
  --card: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --danger: #c4291c;
  --ok-bg: #e5f5ee;
  --wait-bg: #fff4e0;
  --wait: #8a5a00;
  --radius: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 22px; margin: 0 0 4px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 15px; }
.center { text-align: center; }

.page { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; padding-top: max(24px, env(safe-area-inset-top)); }
.narrow { max-width: 440px; }
.brand { font-weight: 700; color: var(--accent); font-size: 20px; margin: 16px 0 32px; letter-spacing: -0.01em; }
.loading { text-align: center; color: var(--muted); padding-top: 40vh; margin: 0; }
.back { display: inline-block; padding: 8px 0; margin-bottom: 16px; }
.foot { text-align: center; margin-top: 20px; font-size: 15px; }

.bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.bar h1 { margin: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; }
input {
  font: inherit; font-weight: 400; height: 52px; padding: 0 14px; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[readonly] { font-size: 14px; color: var(--muted); }

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

button, .button {
  font: inherit; font-weight: 600; min-height: 52px; border-radius: 14px; border: 0; padding: 0 20px;
  display: flex; align-items: center; justify-content: center; width: 100%; cursor: pointer;
}
.primary { background: var(--accent); color: #fff; }
.primary:active { background: var(--accent-press); }
.secondary { background: var(--card); color: var(--accent); border: 1px solid var(--line); }
button:disabled { opacity: .55; }
button.link { background: none; color: var(--accent); width: auto; min-height: 44px; padding: 0 4px; font-weight: 500; }
.error { color: var(--danger); font-size: 15px; margin: 0; min-height: 1px; }
.error:empty { display: none; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card .stack, .card.stack { margin-top: 0; }
.hero { padding: 28px 20px; margin-bottom: 20px; }
.list { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: inherit; }
.pill { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--accent); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0 auto; max-width: 420px;
  background: var(--text); color: #fff; padding: 14px 16px; border-radius: 14px; font-size: 15px; text-align: center;
}

/* Step 2 */
.tabs { display: flex; gap: 4px; background: #e8e8ed; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tabs a { flex: 1; text-align: center; padding: 10px 0; border-radius: 9px; color: var(--text); font-weight: 500; font-size: 15px; }
.tabs a.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }
.big { min-height: 64px; font-size: 20px; }
.status { font-size: 17px; margin: 0; }
.late { color: var(--wait); font-weight: 600; }
.waiting { text-align: center; color: var(--wait); font-size: 15px; margin-top: 16px; }
.empty { margin-top: 24px; }
.chev { color: var(--muted); font-size: 22px; }
.hint { font-weight: 400; font-size: 13px; }
.section { font-size: 17px; margin: 28px 0 0; }
.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: 500; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.days input { width: 18px; height: 18px; accent-color: var(--accent); }

.camera { width: 220px; height: 220px; margin: 12px auto 16px; border-radius: 50%; overflow: hidden; background: #dcdce1; }
.camera video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera.off { height: 0; margin: 0; }
.where { text-align: center; font-size: 15px; color: var(--muted); min-height: 22px; }
.where.good { color: var(--accent); font-weight: 600; }
.where.warn { color: var(--wait); }
.where.bad { color: var(--danger); }

.person { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.person h1 { margin: 0; }
.person p { margin: 0; }
.face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #dcdce1; flex: none; }
.record { align-items: flex-start; justify-content: flex-start; }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #ececf0; flex: none; }
.grow { flex: 1; }
.pill.warn { background: var(--wait-bg); color: var(--wait); display: inline-block; margin-top: 4px; }

/* Step 3: field visits (layout from the CHF Heron field sales tracker) */
.has-tabs { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 8px; background: rgba(255,255,255,.94); border-top: 1px solid var(--line); padding: 6px 16px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; max-width: 200px; text-align: center; padding: 12px 0; color: var(--muted); font-weight: 600; font-size: 15px; border-radius: 10px; }
.tabbar a.on { color: var(--accent); background: var(--ok-bg); }
.banner { background: var(--wait-bg); color: var(--wait); font-weight: 600; font-size: 14px; padding: 11px 14px; border-radius: 12px; }
.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: 84px; height: 84px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), #e5e5ea 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: 700; font-size: 22px; line-height: 1; }
.ring small { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.sortbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sortbar h3 { margin: 0; font-size: 17px; }
.seg { display: flex; background: #e8e8ed; padding: 3px; border-radius: 11px; gap: 2px; }
.seg button { width: auto; min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; background: transparent; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.sortnote { font-size: 13px; color: var(--muted); margin: 8px 2px; min-height: 18px; }
.sortnote b { color: var(--accent); }
input[type=search] { margin-bottom: 10px; }
.slist { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.store { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 0; padding: 14px 16px; background: var(--card); color: var(--text);
  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: #f2f2f5; }
.store .grow { display: flex; flex-direction: column; gap: 2px; }
.store .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--ok-bg); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; font-size: 17px; }
.store.done .ic { background: #e5f5ee; color: #1f8a4c; }
.store.done b { color: var(--muted); }
.store.next { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--radius); }
.store.next .ic { background: var(--accent); color: #fff; }
.tiny { font-size: 13px; }
.small { font-size: 14px; }
.pill { background: #ececf0; color: var(--text); }
.pill.near { background: var(--accent); color: #fff; }
.eyebrow { margin: 0; font-size: 14px; }
.gps { border-radius: 14px; padding: 12px 14px; background: #ececf0; font-weight: 600; font-size: 15px; margin: 14px 0 0; }
.gps.ok { background: var(--ok-bg); color: var(--accent); }
.gps.warn { background: var(--wait-bg); color: var(--wait); }
.gps.bad { background: #fdecea; color: var(--danger); font-weight: 500; }
.gps .tiny { opacity: .85; }
.camera video { transform: none; }
.camera video.mirror { transform: scaleX(-1); }
.stack.tight { gap: 10px; margin: 0 0 14px; }
.shot { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; }
textarea { font: inherit; font-weight: 400; padding: 12px 14px; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); resize: vertical; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.link.block { width: 100%; margin-top: 6px; }
.hide { display: none !important; }
.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%; }
.link-row { color: var(--text); padding: 8px 0 2px; }
.note { font-size: 14px; color: var(--text); }

/* Step 4: manager's Today page */
.tabs { overflow-x: auto; }
.tabs a { min-width: 64px; font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dayrow { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dayrow input { width: auto; height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { width: auto; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--line); font-weight: 500; font-size: 14px; white-space: nowrap; flex: none; }
.chip b { color: var(--muted); font-weight: 600; margin-left: 4px; }
.chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.chip.on b { color: #fff; opacity: .8; }
.selall { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; padding: 4px 16px 8px; }
.selall input, .ck input { width: 22px; height: 22px; accent-color: var(--accent); }
.board { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.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(--ok-bg); }
.brow .ck { flex: none; padding: 6px; margin: -6px; }
.brow .grow { display: flex; flex-direction: column; gap: 2px; color: var(--text); min-width: 0; }
.brow .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; flex: none; }
.by { display: block; }
.pill.bad { background: #fdecea; color: var(--danger); }
.pill.info { background: #e8f0fe; color: #1a56c4; }
.has-bulk { padding-bottom: 170px; }
.bulkbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(0,0,0,.06);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.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(--accent); border: 1px solid var(--line); border-radius: 12px; }
.bulk-btns button.ghost { color: var(--muted); }
.bulk-btns button:active { background: var(--ok-bg); }

/* Step 5: owner dashboard, setup, export */
select { font: inherit; font-weight: 400; height: 52px; padding: 0 12px; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); }
.dateline { margin: -8px 0 14px; }
.block { margin-bottom: 14px; padding: 18px; }
.block h2 { font-size: 17px; margin: 0 0 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; color: var(--text); }
.stats span { display: flex; flex-direction: column; align-items: center; background: #f2f2f5; border-radius: 12px; padding: 10px 4px; font-size: 13px; color: var(--muted); text-align: center; }
.stats b { font-size: 26px; color: var(--text); line-height: 1.15; }
.stats .warn b { color: var(--wait); }
.stats .bad b { color: var(--danger); }
.offices { list-style: none; margin: 12px 0 0; padding: 0; }
.offices li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.ok-text { color: var(--accent); font-weight: 600; }
.big-line { font-size: 17px; margin: 0 0 8px; }
.bar { height: 8px; background: #e5e5ea; border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.map { height: 240px; border-radius: 12px; margin-top: 14px; background: #e8eef0; 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(--accent); }
.legend .dot + .dot, .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: 700; letter-spacing: -0.02em; margin: 0; }
.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: #d1d1d6; 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(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.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; }
}
