/* SRG Field — touch-first phone web app. Designed to run full-screen as an
   "Add to Home Screen" PWA, so it owns the whole viewport and respects safe areas. */
:root {
  --navy: #1E3A6B; --navy-deep: #0F1E3D; --teal: #00B0B9;
  --srg-red: #E30613;
  --red: #C2410C; --green: #15803D; --amber: #B45309; --slate: #64748B;
  --border: #E2E8F0; --bg: #F1F5F9; --card: #FFFFFF; --ink: #0F172A;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Source Sans 3', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  overscroll-behavior-y: none;
}
#field { min-height: 100%; }
.fld-boot { display: flex; align-items: center; justify-content: center; height: 100vh; color: var(--slate); }

/* ---- inputs / buttons ---- */
.fld-input {
  width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; font-size: 16px; margin-top: 6px; appearance: none; color: var(--ink);
}
.fld-input:focus { outline: none; border-color: var(--teal); }
.fld-pin { font-size: 24px; letter-spacing: 8px; text-align: center; }
.fld-label { display: block; font-weight: 700; color: var(--ink); margin-top: 14px; }
.fld-req { color: var(--red); }
.fld-btn {
  width: 100%; background: var(--navy); color: #fff; border: 0; border-radius: 12px;
  padding: 16px; font-size: 16px; font-weight: 800; margin-top: 16px;
}
.fld-btn:disabled { background: #94a3b8; }
.fld-btn-go { background: var(--green); padding: 18px; }
.fld-link { background: none; border: 0; color: var(--navy); font-weight: 600; font-size: 15px; padding: 8px 0; }
.fld-err { color: var(--red); font-weight: 600; margin-top: 12px; }

/* ---- auth screen ---- */
.fld-auth { min-height: 100vh; background: #fff; display: flex; flex-direction: column; }
.fld-auth-head { padding: calc(var(--safe-top) + 26px) 24px 14px; background: #fff; }
.fld-brand { color: var(--navy); font-size: 30px; font-weight: 800; }
.fld-sub { color: var(--slate); font-size: 14px; margin-top: 2px; }
.fld-auth-card {
  flex: 1; background: #fff;
  padding: 16px 20px; padding-bottom: calc(var(--safe-bottom) + 20px);
}
.fld-sub-dark { color: var(--slate); margin: 6px 0 4px; }
.fld-person-name { font-size: 22px; font-weight: 800; color: var(--ink); margin-top: 6px; }

/* ---- lists / rows ---- */
.fld-list { margin-top: 10px; max-height: 60vh; overflow: auto; }
.fld-row {
  display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 8px;
}
.fld-row-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.fld-row-meta { color: var(--slate); font-size: 12px; margin-top: 2px; }
.fld-empty { color: var(--slate); padding: 16px 4px; text-align: center; }

/* ---- screen scaffolding (home / sign-on) ---- */
.fld-screen { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
/* Keep the header (bar + brand stripe) pinned while the page scrolls. */
.fld-header { position: sticky; top: 0; z-index: 30; background: #fff; }
.fld-topbar {
  background: #fff; color: var(--ink); display: flex; align-items: center;
  padding: calc(var(--safe-top) + 8px) 12px 10px; min-height: 38px; box-sizing: border-box;
}
.fld-topbar .fld-link { color: var(--navy); white-space: nowrap; }
.fld-topbar-side { flex: 0 0 auto; min-width: 88px; display: flex; align-items: center; }
.fld-topbar-l { justify-content: flex-start; }
.fld-topbar-r { justify-content: flex-end; }
.fld-topbar-title { flex: 1; min-width: 0; text-align: center; font-size: 18px; font-weight: 800; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fld-topbar-left { flex: 1; }
.fld-body { padding: 18px; padding-bottom: calc(var(--safe-bottom) + 96px); flex: 1; }
.fld-hi { font-size: 24px; font-weight: 800; color: var(--ink); }

/* ---- shift segment ---- */
.fld-segment {
  display: flex; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 4px; margin: 16px 0;
}
.fld-seg { flex: 1; padding: 11px 0; border: 0; background: transparent; border-radius: 9px; font-weight: 700; color: var(--slate); }
.fld-seg.on { background: var(--navy); color: #fff; }

/* ---- big call-to-action buttons ---- */
.fld-cta { display: block; width: 100%; text-align: center; border: 0; background: var(--navy); color: #fff; border-radius: 16px; padding: 20px; margin-bottom: 10px; }
.fld-cta-teal { background: var(--teal); }
.fld-cta-title { font-size: 18px; font-weight: 800; }
.fld-cta-sub { color: #cdd9ef; font-size: 12px; margin-top: 2px; }

/* ---- on-site list ---- */
.fld-section { font-weight: 800; color: var(--ink); font-size: 16px; margin: 18px 0 8px; }
.fld-count { color: var(--slate); font-weight: 600; }
.fld-active { display: flex; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.fld-avatar { width: 46px; height: 46px; border-radius: 23px; margin-right: 12px; background: var(--border); object-fit: cover; }
.fld-avatar-lg { width: 84px; height: 84px; border-radius: 42px; background: var(--border); object-fit: cover; font-size: 30px; }
.fld-avatar-blank { display: flex; align-items: center; justify-content: center; color: var(--slate); font-weight: 800; }
.fld-active-main { flex: 1; min-width: 0; }
.fld-off { border: 0; background: #FEF2F2; color: var(--red); font-weight: 700; padding: 9px 12px; border-radius: 9px; }
.fld-chev { color: var(--slate); font-size: 22px; font-weight: 700; padding-left: 8px; }
.fld-btn-off { background: #DC2626; }
.fld-hint { color: var(--slate); font-size: 12px; font-weight: 500; margin-top: 4px; }
.fld-confirm { border: 1px solid #FCA5A5; background: #FEF2F2; border-radius: 12px; padding: 14px; margin-top: 12px; }
.fld-confirm .fld-hint { margin-bottom: 8px; }

/* ---- cards / photo ---- */
.fld-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.fld-photo {
  width: 100%; height: 230px; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; margin-top: 6px;
  color: var(--navy); font-weight: 700; font-size: 16px; padding: 0;
}
.fld-photo img { width: 100%; height: 100%; object-fit: cover; }
.fld-build { text-align: center; color: var(--slate); font-size: 11px; margin-top: 22px; opacity: 0.7; }

/* ---- branding ---- */
/* The signature SRG/Tronox stripe: navy → teal → red. */
.fld-stripe { height: 4px; background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 55%, var(--teal) 55%, var(--teal) 80%, var(--srg-red) 80%, var(--srg-red) 100%); }
.fld-logo { height: 36px; width: auto; margin-bottom: 12px; }
.fld-logo-sm { height: 24px; width: auto; margin-right: 10px; }

/* ---- fit-for-work declaration (matches the kiosk wording + look) ---- */
.fld-fitness { display: flex; gap: 12px; align-items: flex-start; background: #EEF3F8; border: 1px solid var(--border); padding: 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; margin: 14px 0; }
.fld-fitness input { width: 24px; height: 24px; flex: 0 0 auto; margin: 0; accent-color: var(--navy); }
.fld-onnote { background: #F2FBF5; border: 1px solid #BBF7D0; color: var(--green); font-weight: 700; padding: 14px; border-radius: 12px; margin-bottom: 10px; }
.fld-onnote-row { display: flex; align-items: center; gap: 12px; }
.fld-onnote-row span { flex: 1; }

/* ---- tabs / overlays ---- */
.fld-app { min-height: 100vh; }
.fld-overlay { position: fixed; inset: 0; z-index: 1200; background: var(--bg); overflow-y: auto; }
.fld-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: #fff; border-top: 1px solid var(--border); padding-bottom: var(--safe-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,0.04); }
.fld-tab { flex: 1; border: 0; background: none; padding: 9px 0 7px; color: var(--slate); }
.fld-tab.on { color: var(--navy); }
.fld-tab-icon { font-size: 20px; line-height: 1; }
.fld-tab-label { font-size: 11px; font-weight: 700; margin-top: 3px; }

/* ---- job board ---- */
.fld-job { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.fld-job-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fld-pri { color: #fff; font-weight: 800; font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.fld-bolt { color: var(--srg-red); font-weight: 800; }
.fld-job-id { font-weight: 800; color: var(--ink); }
.fld-job-status { margin-left: auto; font-weight: 700; font-size: 13px; }
.fld-job-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.fld-statusrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.fld-statusbtn { flex: 1 1 44%; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: #fff; font-weight: 700; color: var(--slate); }
.fld-statusbtn.on { color: #fff; border-color: transparent; }
.fld-tworow { display: flex; gap: 12px; }
textarea.fld-input { resize: vertical; font-family: inherit; }
select.fld-input { appearance: none; background-image: none; }

/* ---- scaffold ---- */
/* position+z-index contains Leaflet's internal panes (z-index up to ~1000) so
   they can't paint over modals layered above the page. */
.fld-map { height: 240px; border-radius: 14px; overflow: hidden; margin: 10px 0 4px; border: 1px solid var(--border); position: relative; z-index: 0; isolation: isolate; }
.fld-searchrow { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.fld-scan-btn { border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 14px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.fld-scan { width: 100%; height: 300px; background: #000; border-radius: 14px; object-fit: cover; }
.fld-duechip { color: #fff; font-weight: 800; font-size: 11px; padding: 3px 9px; border-radius: 7px; }
.fld-checks { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.fld-check { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 12px; background: #fff; }
.fld-check.pass { border-color: #BBF7D0; background: #F2FBF5; }
.fld-check.fail { border-color: #FCA5A5; background: #FEF2F2; }
.fld-check-mark { font-weight: 800; width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; }
.fld-check.pass .fld-check-mark { background: #15803D; }
.fld-check.fail .fld-check-mark { background: #DC2626; }
.fld-check-txt { font-size: 14px; color: var(--ink); }
/* active-confirm rows: text + pass/fail buttons, neither selected until tapped */
.fld-check3 { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; background: #fff; }
.fld-check3.pass { border-color: #BBF7D0; background: #F2FBF5; }
.fld-check3.fail { border-color: #FCA5A5; background: #FEF2F2; }
.fld-check3 .fld-check-txt { flex: 1; min-width: 0; }
.fld-check-btns { margin-left: auto; display: flex; gap: 6px; flex: 0 0 auto; }
.fld-pf { width: 42px; height: 42px; border-radius: 9px; border: 1px solid var(--border); background: #fff; font-weight: 800; font-size: 17px; color: var(--slate); }
.fld-pf.pass.on { background: #15803D; border-color: #15803D; color: #fff; }
.fld-pf.fail.on { background: #DC2626; border-color: #DC2626; color: #fff; }
.fld-checkprog { font-weight: 700; color: var(--slate); font-size: 13px; margin: 6px 0 8px; }
.fld-result { font-weight: 800; padding: 12px; border-radius: 11px; margin: 8px 0; text-align: center; }
.fld-result.pass { background: #F2FBF5; color: #15803D; }
.fld-result.fail { background: #FEF2F2; color: #DC2626; }
.fld-gps { width: 100%; border: 1px dashed var(--border); background: #fff; border-radius: 12px; padding: 14px; font-weight: 700; color: var(--navy); margin-top: 14px; }
.fld-gps.on { border-style: solid; border-color: #BBF7D0; background: #F2FBF5; color: var(--green); }
.fld-kv { margin-top: 10px; }
.fld-kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.fld-kv-row span { color: var(--slate); }
.fld-kv-row b { text-align: right; }
.fld-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fld-thumbs img { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
