/* SPK Field - the reps' phone app. Same navy and champagne gold as the ERP, system fonts (Burmese from the bundled Noto Sans Myanmar), big touch targets. */
@font-face { font-family: "Noto Sans Myanmar"; src: url("/fonts/myanmar-400.woff2") format("woff2"); font-weight: 100 500; font-display: swap; unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Myanmar"; src: url("/fonts/myanmar-600.woff2") format("woff2"); font-weight: 550 900; font-display: swap; unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F, U+200C-200D, U+25CC; }
:root {
  --navy-950: #061428; --navy-900: #0a1d38; --navy-800: #102a4c; --navy-700: #1a3a66;
  --gold: #b0894f; --gold-600: #96723c; --gold-300: #d9c39b; --gold-100: #f2ead9; --gold-50: #faf6ee;
  --blue: #1f5bb8; --blue-50: #eef3fb;
  --ink: #0d1b2e; --text: #364357; --mute: #687588; --faint: #9aa5b5;
  --line: #e2e6ec; --paper: #f5f6f8; --panel: #fff;
  --good: #1b7a4e; --good-bg: #e6f4ec; --warn: #9a5b0c; --warn-bg: #fbf1df; --bad: #b4232f; --bad-bg: #fbe9ea;
  --r: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Myanmar", "Myanmar Text", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); background: var(--paper); color: var(--text); padding-bottom: env(safe-area-inset-bottom); }
:lang(my) body, html[lang="my"] body { line-height: 1.7; }
h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.3; }
h1 { font-size: 20px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0 0 8px; }
small, .mute { color: var(--mute); font-size: 13.5px; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 2px; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #dfe6f0; border-bottom: 2px solid var(--gold); }
.bar .back { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; padding: 6px 10px 6px 0; min-height: 44px; }
.bar .ttl { flex: 1; min-width: 0; }
.bar .ttl b { display: block; color: #fff; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .ttl span { display: block; font-size: 12.5px; color: var(--gold-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.dot.off { background: #d36a6a; }
.qbtn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 12px; min-height: 40px; font-size: 14px; }

main { padding: 14px; max-width: 640px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(13,27,46,.05); }
.card h2, .card h3 { margin-bottom: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

/* buttons: at least 48 px tall */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--navy-800);
  background: var(--navy-800); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.block { display: flex; width: 100%; }
.btn.gold { background: var(--gold); border-color: var(--gold-600); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy-800); border-color: var(--line); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btns .full { grid-column: 1 / -1; }

/* forms */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 14px; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=search], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #cfd6df; border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 80px; }
input[type=checkbox] { width: 22px; height: 22px; vertical-align: middle; }
.err { color: var(--bad); font-weight: 600; margin: 8px 0; }
.ok { color: var(--good); font-weight: 600; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px; min-height: 64px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; color: inherit; text-decoration: none; }
.item .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-50); color: var(--gold-600); font-weight: 700; flex: none; }
.item .ic.doc { background: var(--blue-50); color: var(--blue); }
.item b { display: block; color: var(--ink); }
.item .meta { font-size: 13.5px; color: var(--mute); }
.item .dist { font-weight: 700; color: var(--navy-800); white-space: nowrap; }
.item.done { border-left: 5px solid var(--good); }
.item.active { border-left: 5px solid var(--gold); }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--text); border: 1px solid var(--line); margin-right: 4px; }
.badge.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--blue-50); color: var(--navy-800); font-size: 14.5px; margin-bottom: 10px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.good { background: var(--good-bg); color: var(--good); }
.note.bad { background: var(--bad-bg); color: var(--bad); }

/* punch card */
.punch { background: linear-gradient(135deg, var(--navy-800), var(--navy-950)); color: #dfe6f0; border: 0; }
.punch h2 { color: #fff; }
.punch .privacy { font-size: 13.5px; color: var(--gold-300); margin: 8px 0 12px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.kpis div { background: rgba(255,255,255,.08); border-radius: 10px; padding: 8px; text-align: center; }
.kpis b { display: block; font-size: 20px; color: #fff; }
.kpis span { font-size: 12px; color: #b8c4d6; }

/* photo */
.photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* cart */
.prod { border-bottom: 1px solid var(--line); padding: 10px 0; }
.prod:last-child { border-bottom: 0; }
.prod .qty { width: 96px; flex: none; text-align: right; }
.prod select { margin-top: 6px; }
.totalbar { position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--gold); padding: 12px 14px; display: flex; gap: 10px; align-items: center; margin: 0 -14px -14px; }
.totalbar b { font-size: 18px; color: var(--ink); }

.seq { counter-reset: s; }
.seq li { counter-increment: s; }
.seq li::before { content: counter(s) ". "; font-weight: 700; color: var(--gold-600); }

.langsw { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; overflow: hidden; }
.langsw button { background: none; border: 0; color: #dfe6f0; padding: 6px 12px; min-height: 36px; font-size: 13px; }
.langsw button.on { background: var(--gold); color: #fff; }

/* sign-in */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 18px; background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); }
.login .box { background: #fff; border-radius: 16px; padding: 22px 18px; max-width: 420px; width: 100%; margin: 0 auto; border-top: 4px solid var(--gold); }
.login .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.login .logo img { width: 52px; height: 52px; border-radius: 12px; }
.login .logo b { display: block; color: var(--ink); font-size: 17px; }
.login .logo span { color: var(--gold-600); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.login .top { display: flex; justify-content: flex-end; max-width: 420px; width: 100%; margin: 0 auto 12px; }

.toast { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; background: var(--navy-900); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 15px; }
.toast.bad { background: var(--bad); }

/* offline bar and queue list (shared /offline.js) */
#offline-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 10px; align-items: center; padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); font-size: 14px; background: var(--navy-800); color: #fff; }
#offline-bar.off { background: #4a5568; } #offline-bar.bad { background: var(--bad); } #offline-bar[hidden] { display: none; }
#offline-bar span { flex: 1; }
#offline-bar button { background: #fff; color: var(--navy-900); border: 0; border-radius: 8px; padding: 8px 12px; min-height: 40px; font-weight: 600; }
dialog.modal { border: 0; border-radius: 14px; padding: 16px; width: calc(100% - 24px); max-width: 520px; }
dialog.modal::backdrop { background: rgba(6, 20, 40, .5); }
dialog.modal h3 { margin-bottom: 10px; }
.offrow { border-bottom: 1px solid var(--line); padding: 8px 0; display: grid; gap: 4px; }
.offrow small { display: block; }
.offrow .btn, dialog.modal > .btn { min-height: 40px; margin-top: 6px; }
.btn.ghost.sm { background: #fff; }
