/* ============================================================
   MAHUNE OPS — Mobile Field App design system
   ============================================================ */
:root {
  --navy: #075E6E; --navy-2: #053F4A; --amber: #0AB4CE; --amber-2: #0891A8;
  --bg: #F2F5F9; --card: #FFFFFF; --ink: #1B2A3A; --muted: #5A6572;
  --line: #DDE4EC; --ok: #2E7D32; --ok-bg: #E8F5E9;
  --bad: #C62828; --bad-bg: #FDECEA; --warn: #EF6C00; --warn-bg: #FFF3E0;
  --info: #1565C0; --info-bg: #E3F2FD;
  --radius: 14px; --shadow: 0 2px 10px rgba(7,31,61,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #0a1424; }
body { font-family: var(--font); color: var(--ink); }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ---------- screens ---------- */
.screen { min-height: 100vh; }
/* Electric-night theme (from the company artwork): icy top → electric blue →
   deep navy → slate blue, with a soft blue glow behind the card. */
#screen-login, #screen-pin {
  background:
    radial-gradient(120% 70% at 50% -12%, rgba(71,121,234,.55) 0%, rgba(71,121,234,.16) 44%, transparent 70%),
    radial-gradient(90% 55% at 50% 112%, rgba(136,177,227,.30) 0%, transparent 62%),
    linear-gradient(180deg, #D9EBFA 0%, #7FA8F0 9%, #4779EA 17%, #2554BF 29%, #0C2566 44%, #040E2F 60%, #020A24 77%, #0A1C4A 93%, #54689A 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-wrap {
  background: rgba(4, 14, 47, .88);
  border: 1px solid rgba(203, 230, 245, .20);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 20px; padding: 28px 24px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(1, 8, 28, .62), 0 0 44px rgba(37, 84, 191, .28);
  text-align: center;
}
.login-logo { width: 96px; height: 96px; border-radius: 22px; object-fit: contain; background: transparent; }
.login-logo.wide { width: 100%; max-width: 290px; height: auto; border-radius: 12px; padding: 6px; }
.login-logo.small { width: 64px; height: 64px; }
/* on the electric-night login screens the logo floats directly on the dark
   card — no white chip (tagline is already white inside logo-dark.png) */
#screen-login .login-logo, #screen-pin .login-logo { background: transparent; }
#screen-login .login-logo.wide { max-width: 340px; padding: 0; }
#screen-pin .login-logo.small { padding: 0; }
.login-wrap h1 { color: #E8F2FC; margin: 10px 0 2px; font-size: 26px; letter-spacing: .5px; text-shadow: 0 0 26px rgba(71,121,234,.55); }
.login-wrap h2 { color: #E8F2FC; margin: 10px 0 2px; font-size: 20px; }
.login-sub { color: #F2F8FE; font-size: 13px; margin: 4px 0 18px; line-height: 1.45; }
.login-wrap form { text-align: left; }
.login-wrap label { display: block; font-size: 12px; font-weight: 700; color: #88B1E3; text-transform: uppercase; letter-spacing: .4px; margin: 10px 0 4px; }
.login-wrap input { width: 100%; padding: 12px 14px; border: 1.5px solid #2E4A8F; border-radius: 10px; font-size: 15px; background: rgba(10, 28, 74, .65); color: #E8F2FC; }
.login-wrap input::placeholder { color: #7FA3C9; }
.login-wrap input:focus { outline: none; border-color: #4779EA; box-shadow: 0 0 0 3px rgba(71,121,234,.28); }
.login-wrap input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #0A1C4A inset; -webkit-text-fill-color: #E8F2FC; caret-color: #E8F2FC; }
/* electric-blue sign-in (login + PIN screens only) */
#screen-login .btn-primary, #screen-pin .btn-primary {
  background: linear-gradient(135deg, #4779EA, #2554BF);
  box-shadow: 0 4px 16px rgba(37, 84, 191, .55);
}
#screen-pin .btn-ghost { background: rgba(10, 28, 74, .65); color: #CBE6F5; border: 1.5px solid #2E4A8F; }
.demo-creds { margin-top: 16px; background: rgba(37, 84, 191, .14); border: 1px solid rgba(136, 177, 227, .22); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; color: #C9E0F2; line-height: 1.55; text-align: left; }
.demo-creds code { background: rgba(8, 20, 52, .9); color: #CBE6F5; border: 1px solid rgba(136, 177, 227, .28); border-radius: 4px; padding: 1px 5px; font-size: 10.5px; }
.login-foot { margin-top: 14px; font-size: 10.5px; color: #7FA3C9; }
.cross-link {
  display: flex; align-items: center; gap: 10px; text-align: left;
  margin-top: 16px; padding: 11px 13px; text-decoration: none;
  background: linear-gradient(135deg, #4779EA, #0C2566); color: #fff;
  border: 1px solid rgba(136, 177, 227, .25);
  border-radius: 12px; box-shadow: 0 4px 16px rgba(37, 84, 191, .4);
}
.cross-link .cross-icon { font-size: 20px; flex: none; }
.cross-link span:nth-child(2) { flex: 1; font-size: 11.5px; line-height: 1.35; }
.cross-link b { font-size: 13px; }
.cross-link .cross-arrow { font-size: 18px; font-weight: 800; }
.cross-link:active { transform: scale(.98); }
.pin-box { text-align: center; font-size: 26px !important; letter-spacing: 14px; font-weight: 700; }
.error-text { color: var(--bad); font-size: 12.5px; margin-top: 8px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.pin-pad button { padding: 14px 0; font-size: 20px; font-weight: 700; border: 1.5px solid #2E4A8F; background: rgba(10, 28, 74, .65); border-radius: 12px; color: #E8F2FC; }
.pin-pad button:active { background: #4779EA; border-color: #4779EA; color: #fff; }

/* ---------- app shell ---------- */
#screen-app { background: var(--bg); }
.app-header {
  position: sticky; top: 0; z-index: 40; background: linear-gradient(135deg, var(--navy-2), var(--navy));
  color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-top));
  padding-top: calc(12px + env(safe-area-inset-top)); box-shadow: 0 2px 12px rgba(7,31,61,.35);
  /* same column as the content below it (app shell is a 480px phone column) */
  width: 100%; max-width: 480px; margin: 0 auto;
}
.header-logo { width: 38px; height: 38px; border-radius: 10px; background: transparent; object-fit: contain; }
.header-titles { flex: 1; min-width: 0; }
.header-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-role { font-size: 11px; color: #B9C9DE; }
.icon-btn { position: relative; background: rgba(255,255,255,.12); border: none; color: #fff; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

/* ‹ Back button — standout amber so it is unmistakable on the blue header */
#back-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  width: auto; height: 38px; padding: 0 11px;
  font-size: 12px; font-weight: 800; color: #fff;
  background: #EF6C00; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
#back-btn:active { background: #D85B00; transform: scale(.97); }

.app-main { max-width: 480px; margin: 0 auto; padding: 14px 14px 96px; }
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
  display: flex; max-width: 480px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 14px rgba(7,31,61,.10);
}
.tab { flex: 1; background: none; border: none; padding: 8px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.tab.active { color: var(--navy); }
.tab-plus .plus-circle {
  width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--amber), var(--amber-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; margin-top: -20px;
  box-shadow: 0 6px 16px rgba(217,148,0,.45); border: 3px solid #fff;
}
.tab-plus span:last-child { margin-top: -3px; }

/* ---------- cards & layout ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 13px; color: var(--navy); text-transform: uppercase; letter-spacing: .5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sec-title { font-size: 13px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: .5px; margin: 18px 2px 8px; }

/* quick action tiles */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: var(--navy); text-align: center; box-shadow: var(--shadow); }
.qa svg { width: 26px; height: 26px; }
.qa:active { transform: scale(.96); }

/* module picker */
.mod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mod-tile { position: relative; }
.mod-badge { position: absolute; top: 6px; right: 6px; background: var(--amber); color: #fff; font-size: 9.5px; font-weight: 800; min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px; padding: 0 4px; text-align: center; z-index: 1; }
.mod-tile { background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 13px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.mod-tile .mod-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; }
.mod-tile .mod-icon svg { width: 21px; height: 21px; }
.mod-tile b { font-size: 13px; line-height: 1.25; color: var(--navy); }
.mod-tile span { font-size: 10.5px; color: var(--muted); line-height: 1.35; }

/* status chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; }
.chip.SUBMITTED { background: var(--info-bg); color: var(--info); }
.chip.PENDING_APPROVAL { background: var(--warn-bg); color: var(--warn); }
.chip.APPROVED { background: var(--ok-bg); color: var(--ok); }
.chip.REJECTED { background: var(--bad-bg); color: var(--bad); }
.chip.COMPLETED { background: #E8EAF6; color: #283593; }
.chip.DUALKEY { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 800; }
.badge.navy { background: var(--navy); color: #fff; }
.badge.amber { background: var(--amber); color: #fff; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* request list */
.req-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; }
.req-item .ri-icon { width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.req-item .ri-icon svg { width: 18px; height: 18px; }
.req-item .ri-body { flex: 1; min-width: 0; }
.req-item .ri-title { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.req-item .ri-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-item .ri-amt { font-weight: 800; font-size: 13px; color: var(--navy); text-align: right; }
.req-item .ri-date { font-size: 10.5px; color: var(--muted); text-align: right; }

/* filter chips row */
.filters { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 4px 0 8px; }
.filters button { flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; color: var(--muted); border-radius: 20px; padding: 6px 12px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.filters button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.search-input { width: 100%; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 13px; margin: 0 0 8px; background: #fff; color: var(--ink); }
.search-input:focus { outline: none; border-color: var(--navy); }

/* My Day rows (monday-style single-glance list) + comment threads */
.myday-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 8px 10px; margin-top: 8px; text-align: left;
}
.myday-row:active { background: var(--bg); }
.comment-item { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; background: #fff; }
.comment-item .row { gap: 6px; }

/* Crew roster chips (name buttons inside a day card) */
.roster-chip {
  background: var(--info-bg); color: #14375f; border: 1px solid #BBD6F0;
  border-radius: 20px; padding: 4px 10px; font-size: 11px; font-weight: 700;
  cursor: pointer;
}
.roster-chip.night { background: #EDE7F6; color: #4A148C; border-color: #D1C4E9; }

/* Offline / sync bar (outbox stage 2): sits in flow between the compliance
   strip and the content column — never overlaps the sticky header/strip. */
#offline-bar {
  max-width: 480px; margin: 0 auto 10px;
  background: #FFF3E0; border: 1px solid #F2A900; color: #7A3B00;
  border-radius: 8px; padding: 5px 12px; font-size: 11.5px; font-weight: 700; text-align: center;
}

/* forms */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 5px; }
.form-field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 14.5px;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--amber); }
.form-field textarea { min-height: 84px; resize: vertical; }
.field-error { color: var(--bad); font-size: 11.5px; margin-top: 4px; }
.rule-box { background: var(--info-bg); border-left: 4px solid var(--info); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #14375f; margin-bottom: 12px; line-height: 1.5; }
.rule-box.amber { background: var(--warn-bg); border-left-color: var(--warn); color: #7a3b00; }
.dualkey-banner { background: var(--warn-bg); border: 1.5px solid var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 700; color: #7a3b00; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.photo-preview { margin-top: 8px; }
.photo-preview img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); max-height: 200px; object-fit: contain; }
.gps-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-bg); color: var(--ok); border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 700; margin-top: 6px; }

/* buttons — ALL button sizes share ONE compact standard (matches Sign Out) */
.btn { border: none; border-radius: 8px; padding: 5px 11px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; }
.btn-primary { background: linear-gradient(135deg, var(--navy), #0A7A8F); color: #fff; box-shadow: 0 4px 12px rgba(11,46,89,.35); }
.btn-amber { background: linear-gradient(135deg, var(--amber), var(--amber-2)); color: #fff; box-shadow: 0 4px 12px rgba(217,148,0,.35); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn-block {
  display: block; margin-left: auto; margin-right: auto;
  padding: 5px 11px; font-size: 11.5px; font-weight: 700; border-radius: 8px;
}
.btn-sm { padding: 5px 11px; font-size: 11.5px; font-weight: 700; border-radius: 8px; }
.btn-xs { padding: 5px 11px; font-size: 11.5px; font-weight: 700; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(4,14,28,.55); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal-sheet { background: #fff; width: 100%; max-width: 480px; max-height: 92vh; border-radius: 22px 22px 0 0; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: slideUp .22s ease; }
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-sheet h3 { margin: 0 0 12px; color: var(--navy); font-size: 17px; }
.modal-close { float: right; background: var(--bg); border: none; border-radius: 10px; width: 32px; height: 32px; font-size: 17px; color: var(--muted); }

/* toast */
#toast-root { position: fixed; top: 16px; left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--navy-2); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; max-width: 90%; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: slideUp .2s ease; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }
.toast.warn { background: var(--warn); }

/* countdown clocks (compact — matches the small button scale) */
.clocks-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.clock { text-align: center; width: 72px; }
.clock .ring { position: relative; width: 58px; height: 58px; margin: 0 auto; }
.clock .ring svg { transform: rotate(-90deg); }
.clock .days { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.clock .days b { font-size: 14px; line-height: 1; }
.clock .days span { font-size: 7.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.clock .lbl { font-size: 9.5px; font-weight: 700; color: var(--ink); margin-top: 4px; line-height: 1.25; }
.clock .exp { font-size: 8.5px; color: var(--muted); }

/* segmented */
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.seg button { flex: 1 0 auto; min-width: 0; border: none; background: none; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }

/* timeline */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 12px; }
.tl-dot { position: absolute; left: -22px; top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); background: var(--muted); }
.tl-item.ok .tl-dot { background: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.tl-item.bad .tl-dot { background: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.tl-item.warn .tl-dot { background: var(--warn); box-shadow: 0 0 0 2px var(--warn); }
.tl-item b { font-size: 12.5px; display: block; }
.tl-item span { font-size: 11px; color: var(--muted); }

/* inline icons inside headings, rule boxes, dual-key banners and buttons:
   keep them SMALL and consistent (they otherwise default to 300px SVGs) */
.card h3 svg, h1 svg, h2 svg, h3 svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.rule-box svg, .dualkey-banner svg { width: 14px; height: 14px; flex: none; vertical-align: -2px; margin-right: 3px; }
.btn svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.chip svg { width: 10px; height: 10px; vertical-align: -1px; margin-right: 2px; }
.gps-chip svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }

/* kv table */
.kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kv td { padding: 7px 8px; border-bottom: 1px solid var(--bg); vertical-align: top; }
.kv td:first-child { color: var(--muted); font-weight: 600; width: 44%; }

/* banner */
.banner { border-radius: 12px; padding: 12px 14px; font-size: 12.5px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; line-height: 1.5; }
.banner.ok { background: var(--ok-bg); color: #1b4d1f; border: 1px solid #BFE3C2; }
.banner.bad { background: var(--bad-bg); color: #7c1c1c; border: 1px solid #F3C1BE; }
.banner.warn { background: var(--warn-bg); color: #7a3b00; border: 1px solid #FFD9A8; }
.banner.info { background: var(--info-bg); color: #14375f; border: 1px solid #BBD6F0; }
.banner svg { flex: none; margin-top: 1px; width: 15px; height: 15px; }
.banner[data-act] { cursor: pointer; transition: transform .08s ease; }
.banner[data-act]:active { transform: scale(.985); }

/* Compliance Records strip — the SAME slim banner for all users (≤1 cm tall,
   full width, sticky under the header so it is visible on every screen). */
.compliance-strip {
  position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 35;
  max-width: 480px; margin: 0 auto 12px;
  display: flex; align-items: center; gap: 8px;
  border-radius: 8px; padding: 5px 12px;
  cursor: pointer; border: 1px solid transparent;
  font-size: 11.5px; line-height: 1.2;
  max-height: 34px;              /* ≈ 1 cm */
  white-space: nowrap;
}
.compliance-strip:active { transform: scale(.99); }
.compliance-strip .cs-icon { font-size: 14px; flex: none; }
.compliance-strip .cs-body { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compliance-strip .cs-body b { text-decoration: underline; text-underline-offset: 2px; }
.compliance-strip .cs-action {
  flex: none; font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 10px; border-radius: 14px; background: #fff;
  /* level-matched dark text — readable on the white pill */
  color: #1B4D1F;             /* default green */
}
.compliance-strip.warn .cs-action { color: #7A3B00; }
.compliance-strip.bad  .cs-action { color: #7C1C1C; }
.compliance-strip.ok { background: linear-gradient(135deg, #2E7D32, #43A047); color: #fff; border-color: #2E7D32; }
.compliance-strip.warn { background: linear-gradient(135deg, #EF6C00, #F57C00); color: #fff; border-color: #EF6C00; }
.compliance-strip.bad { background: linear-gradient(135deg, #C62828, #E53935); color: #fff; border-color: #C62828; }

/* misc */
.avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), #0A7A8F); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; margin: 0 auto 8px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.flex1 { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 13px; }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 8px; }
.list-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.list-item b { font-size: 13.5px; }
.list-item .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.skeleton { background: linear-gradient(90deg, #EDF1F6 25%, #F7F9FC 50%, #EDF1F6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 60px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---- Eskom Site Inspections & Quoting (v57) ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap .kv td:first-child { width: auto; }
.table-wrap .kv td { white-space: normal; min-width: 70px; }
.qa { position: relative; }
.qa-badge { position: absolute; top: 5px; right: 5px; background: var(--amber); color: #fff; font-size: 9.5px; font-weight: 800; min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px; padding: 0 4px; }
.si-filter { max-width: 46%; }
.si-rate-row { padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* ---- Work Orders (v70) ---- */
.step-dots { display: flex; gap: 4px; margin: 8px 0 12px; }
.step-dots span { flex: 1; height: 4px; background: var(--line); border-radius: 2px; }
.step-dots span.on { background: var(--amber); }
.step-dots span.done { background: var(--ok); }

/* ============================================================================
   MIDNIGHT FIELD THEME (v70) — default dark-navy skin matching the approved
   reference design: bg #0A1020, panels #131C30/#16233C, amber accent #FFB020.
   Toggled on <body class="midnight">; the classic teal theme stays available
   via Profile → Theme (one tap).
   ========================================================================== */
body.midnight {
  --navy: #FFB020; --navy-2: #E89A00;
  --amber: #FFB020; --amber-2: #E89A00;
  --bg: #0A1020; --card: #131C30; --ink: #E8ECF5; --muted: #A3ACC0;
  --line: #26314E; --shadow: 0 2px 12px rgba(0,0,0,.45);
  --ok: #37C56A; --ok-bg: #12271A;
  --bad: #FF5A5A; --bad-bg: #2A1418;
  --warn: #FFB020; --warn-bg: #2A2210;
  --info: #5AA7FF; --info-bg: #101E33;
  background: var(--bg); color: var(--ink);
}
body.midnight .app-header { background: linear-gradient(135deg, #0E1527, #16233C); border-bottom: 1px solid var(--line); }
body.midnight .tab-bar { background: #0E1527; border-top-color: var(--line); }
body.midnight .qa, body.midnight .mod-tile, body.midnight .req-item, body.midnight .list-item,
body.midnight .comment-item, body.midnight .modal-sheet, body.midnight .myday-row {
  background: var(--card); border-color: var(--line); color: var(--ink); }
body.midnight .qa { color: var(--ink); }
body.midnight .filters button { background: var(--card); color: var(--muted); }
body.midnight .search-input { background: var(--card); color: var(--ink); }
body.midnight .btn-primary { background: linear-gradient(135deg, #E89A00, #FFB020); color: #1A1202; box-shadow: 0 4px 12px rgba(0,0,0,.45); }
body.midnight .btn-amber { background: linear-gradient(135deg, #E89A00, #FFB020); color: #1A1202; }
body.midnight .btn-ghost { background: transparent; color: var(--ink); }
body.midnight input, body.midnight select, body.midnight textarea {
  background: #0E1527 !important; color: var(--ink) !important; border-color: var(--line) !important; }
body.midnight .skeleton { background: linear-gradient(90deg, #131C30 25%, #1F2538 50%, #131C30 75%); background-size: 200% 100%; }
body.midnight .meter { background: #26314E; }
body.midnight .chip.COMPLETED { background: #12271A; color: #8FE3AF; }
body.midnight .rule-box { color: #BBD6F0 !important; }
body.midnight .rule-box.amber, body.midnight .dualkey-banner { color: #FFD68A !important; }
body.midnight .modal-back { background: rgba(4,8,18,.72); }
body.midnight .gps-chip { background: var(--ok-bg); color: #8FE3AF; }
body.midnight .toast { background: #1F2538; border: 1px solid var(--line); color: var(--ink); }
body.midnight .table-wrap .kv td { border-bottom-color: #1D2740; }
body.midnight .kv td:first-child { color: var(--muted); }
body.midnight .empty { color: var(--muted); }
body.midnight .hint { color: var(--muted); }
body.midnight .seg button { background: var(--card); color: var(--muted); border-color: var(--line); }
body.midnight .seg button.active { background: var(--amber); color: #1A1202; border-color: var(--amber); }

/* ---- v77 contrast fixes: banners carried hardcoded dark text colours ---- */
body.midnight .banner.ok { color: #8FE3AF; border-color: #2A4A36; }
body.midnight .banner.bad { color: #FFA3A3; border-color: #542A2E; }
body.midnight .banner.warn { color: #FFD08A; border-color: #54431E; }
body.midnight .banner.info { color: #A8CDFF; border-color: #29456B; }
/* Chips with hardcoded light-theme text */
body.midnight .chip.PENDING, body.midnight .chip.QUEUED { background: #1F2A3F; color: #B8C6DA; }
body.midnight .chip.DUALKEY { background: #2A2210; color: #FFD08A; }
/* Any dynamic row built with an inline white background inherits the card colour */
body.midnight [style*="background:#fff"],
body.midnight [style*="background: #fff"] { background: var(--card) !important; }
/* Roster chips carried dark-navy text on a light info background */
body.midnight .roster-chip { color: #A8CDFF; border-color: #29456B; }
body.midnight .roster-chip.night { background: #241A3A; color: #C9B8F2; border-color: #3A2C5E; }
/* Offline bar matches the warm dark skin */
body.midnight #offline-bar { background: #2A2210; border-color: #54431E; color: #FFD08A; }
