/*
 * Login screen only, so far. Design tokens + font-face are ported as-is
 * from the field-rep app's styles.css (kept per rules-and-facts.md's
 * reuse map); everything else here is fresh, mobile-native CSS scoped to
 * just the login/PIN screens this feature needs.
 */
@font-face{
  font-family:'Nexa';
  src:url('fonts/Nexa-Book.woff2') format('woff2'),
      url('fonts/Nexa-Book.woff') format('woff');
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:'Nexa';
  src:url('fonts/Nexa-Bold.woff2') format('woff2'),
      url('fonts/Nexa-Bold.woff') format('woff');
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

:root{
  --accent: #0F6B5C;
  --accent-soft: #E3F0EE;
  --surface: #FFFFFF;
  --bg: #FAFAF9;
  --text: #1C1C1E;
  --muted: #5F6673;
  --line: #E7E5E4;
  --ok: #16A34A;
  --warn: #D97706;
  --warn-ink: #B45309;
  --bad: #DC2626;

  /* Home-grid metro tile colors — exact values from HQ Brand Guidelines'
     green/blue/grey color-ramps (2026-08-29, supplied directly — supersedes
     the earlier visually-estimated 6-color set). Order rotates which
     family goes first every 3 entries (G,B,Gr / B,Gr,G / Gr,G,B / ...)
     rather than a fixed G,B,Gr repeat — a fixed period-3 interleave lines
     up exactly with the 3-column home grid, so every column would still
     lock onto one family (tile 1 and tile 4 both green — 2026-08-29
     feedback) even though adjacent tiles varied. Rotating breaks that
     alignment. app.js computes each one's text color (white vs dark) at
     runtime from its actual luminance, not a hand-picked guess per swatch. */
  --metro-1: #0F5227;  --metro-2: #3BB3E4;  --metro-3: #C6C2C8;
  --metro-4: #5BBCE8;  --metro-5: #413D3F;  --metro-6: #246425;
  --metro-7: #636266;  --metro-8: #3B772A;  --metro-9: #74C5EB;
  --metro-10: #588C29; --metro-11: #88CCF0; --metro-12: #848487;
  --metro-13: #9ED6F3; --metro-14: #9C9FA5; --metro-15: #71A025;
  --metro-16: #92B627; --metro-17: #B2E0F6;
  --metro-18: #ABD10A; --metro-19: #C6E8F8;
  --metro-20: #289C40; --metro-21: #58AD5A; --metro-22: #82BC71;
  --metro-23: #A5D18C; --metro-24: #146237; --metro-25: #22733A;
  --metro-26: #368439; --metro-27: #49923A; --metro-28: #5CA534;

  /* Derived shades (2026-08-29, explicit sign-off) — darker variants of
     palette blues/greens above that individually failed the 4.5:1
     white-text contrast check (see app.js's contrastWithWhite()); these
     pass. Not HQ Brand Guidelines-exact values, computed by darkening the
     nearest guideline swatch 30-45% toward black, kept in the same hue
     family as their source. Added purely to widen the randomizable pool
     after the low-contrast originals got filtered out. */
  --metro-29: #297DA0; --metro-30: #20627D; --metro-31: #18485B;
  --metro-32: #3E621D; --metro-33: #4F701A; --metro-34: #667F1B;
  --metro-35: #1C6D2D; --metro-36: #3E793F; --metro-37: #336629;
  --metro-38: #407324;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
body{
  font-family:'Nexa', -apple-system, "Segoe UI", Roboto, sans-serif;
  background:var(--bg);
  color:var(--text);
}
button{ font-family:inherit; }

#app{ display:flex; flex-direction:column; height:100dvh; position:relative; }

/* ---- Post-login header — logo left, lang/notifications/profile right.
   Ported as-is from the field-rep app's .topbar (same shell chrome kept
   deliberately, see this repo's CLAUDE.md). ---- */
.topbar{
  flex:0 0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:env(safe-area-inset-top,0px) 10px 0; height:calc(60px + env(safe-area-inset-top,0px));
  background: var(--accent);
  box-shadow: inset 0px 0px 72px 0px rgba(0,0,0,.3);
}
.topbar h1{ font-size:17px; margin:0; font-weight:600; color:#fff; }
.hq-logo-btn{ background:none; border:none; padding:0; cursor:pointer; display:block; }
.hq-logo-chip{ display:inline-flex; align-items:center; justify-content:center; height:44px; padding:0 0 0 4px; border-radius:8px; }
.hq-logo-chip img{ height:100%; width:auto; display:block; filter:brightness(0) invert(1); }
.topbar-right{ display:flex; align-items:center; gap:10px; }
.lang-toggle{
  background:rgba(255,255,255,.18); color:#fff; border:none; font-family:inherit;
  font-size:13px; font-weight:700; padding:5px 9px; border-radius:999px; cursor:pointer;
}
.bell-wrap{ position:relative; background:none; border:none; padding:4px; cursor:pointer; }
.bell-wrap svg{ width:22px; height:22px; stroke:#fff; fill:none; stroke-width:1.8; }
.profile-btn{
  width:30px; height:30px; border-radius:50%; background:rgba(255,255,255,.22); color:#fff;
  border:none; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer;
}

/* ---- Breadcrumb — "Category › Feature", shown whenever a leaf feature
   is active. Own fixed-height shell row (sibling of .topbar/.content/
   .bottomnav in #app), not inside .content, so it never fights
   .page-hero's negative-margin full-bleed trick. ---- */
.breadcrumb{
  flex:0 0 auto; display:flex; align-items:center; gap:6px;
  padding:8px 12px; background:var(--accent);
  font-size:14px; color:rgba(255,255,255,.75); overflow-x:auto; white-space:nowrap;
}
.breadcrumb .crumb-current{ color:#fff; font-weight:600; }

.content{ flex:1 1 auto; overflow-y:auto; overflow-x:hidden; padding:0 10px; scrollbar-width: none;} .content::-webkit-scrollbar {display: none; margin-bottom: 70px; }

/* ---- Page hero — slim variant, capped at 40px, for holding a screen's
   own tab strip. Same full-bleed negative-margin + solid-accent +
   rounded-bottom technique as the field-rep app's .page-hero
   (border-radius:0 0 22px 22px), just short since this one only ever
   holds tabs, never a title/stat block. ---- */
.page-hero{
  position:relative; background:var(--accent); color:#fff;
  margin:0px -10px 0; height:40px; max-height:40px; overflow:hidden;
  border-radius:0 0 22px 22px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:0 16px;
}
.page-hero + *{ margin-top:14px; }
/* Reps Map sits flush under the hero instead (see .reps-map-screen below,
   which needs -10px on every side for its own full-bleed edges) — an
   explicit higher-specificity override rather than relying on this rule
   and .reps-map-screen's happening to be equal-specificity and just
   ordered right in the file, which would silently break on a future
   stylesheet reorder. */
.page-hero + .reps-map-screen{ margin-top:-10px; }

/* ---- Hero tab strip — sized down from the field-rep app's .ph-card
   (pill instead of a padded block, to fit inside 40px) but the same
   active/inactive treatment: translucent white at rest, solid white +
   accent text when active. ---- */
.hero-tabs{ display:flex; gap:8px; align-items:center; justify-content:space-between; height:100%; overflow-x:auto; }
.hero-tab{
  flex:0 0 auto; background:rgba(255,255,255,.14); border:none; border-radius:999px;
  padding:6px 10px; font-family:inherit; font-size:14px; font-weight:700; color:#fff;
  cursor:pointer; white-space:nowrap;
}
.hero-tab.active{ background:#fff; color:var(--accent); }
/* Hero variant that also carries an icon action (2026-09-01, Regional
   Orders' refresh button moved from its own list-toolbar row into the
   hero, next to the Active/History tabs) — .page-hero's default
   justify-content:center is right for a lone tab strip (Route Sales'
   own hero), but centering a [tabs][icon] pair would just push both
   toward the middle; this modifier spaces them to the two ends instead,
   scoped so it doesn't affect any hero that isn't asking for it. */
/* flex-end, not space-between: Regional Orders' hero currently holds only
   the refresh icon (its tab strip was removed 2026-09-01) — space-between
   on a single child pins it to the start, not the end. Revisit if a tab
   strip returns alongside it. */
.page-hero.with-action{ justify-content:flex-end; }
.hero-icon-btn{
  flex:0 0 auto; width:28px; height:28px; border-radius:50%; border:none;
  background:rgba(255,255,255,.14); display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.hero-icon-btn svg{ width:16px; height:16px; stroke:#fff; fill:none; }
.hero-icon-btn:disabled{ opacity:.5; cursor:default; }

/* ---- Bottom nav — capability-gated section tabs. Deliberately bolder
   than the field-rep app's own .bottomnav (dark resting text/icons + a
   shadow lifting it off the content, not just pale --muted) — the field-
   rep version read as too faint (2026-08-29 feedback). ---- */
.bottomnav{
  position:relative; z-index:20;
  flex:0 0 calc(68px + env(safe-area-inset-bottom,0px)); display:flex; background:var(--surface);
  box-shadow:0 -3px 12px rgba(0,0,0,.08);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.navitem{
  position:relative;
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; background:none; border:none; color:var(--text); font-family:inherit;
  font-size:14px; font-weight:700; cursor:pointer; padding:6px 0 4px;
}
.navitem svg{ width:30px; height:30px; stroke:var(--text); fill:none; stroke-width:1.4; }
/* Color alone read too subtle at a glance (2026-08-29 feedback) — a soft
   background pill behind the active tab, same pattern Material-style nav
   bars use, makes the selected tab obvious without a second look. */
.navitem.active::before{
  content:''; position:absolute; inset:2px 8px; z-index:-1;
  background:var(--accent-soft); border-radius:14px;
}
.navitem.active{ color:var(--accent); }
.navitem.active svg{ stroke:var(--accent); }

/* ---- Home landing grid — total redesign (2026-08-29): flat flex grid,
   4 columns, wraps; no animation/transition of any kind (dropped the
   prior Live Tiles flip/cascade entirely, animation.js removed). Each
   tile is a plain flat-color square (icon at 70% of the box) with its
   label as a separate line below the box, not overlaid on it. ---- */
.home-grid{ display:flex; flex-wrap:wrap; gap:20px 40px; }
.home-tile-wrap{
  flex:0 0 calc(25% - 30px); min-width:0; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:6px;
}
.home-tile{
  position:relative; width:100%; aspect-ratio:1; border-radius:14px; background:var(--tile-color);
  display:flex; align-items:center; justify-content:center;
}
.home-tile-icon{ width:70%; height:70%; display:flex; align-items:center; justify-content:center; }
.home-tile-icon svg{ width:100%; height:100%; stroke:#fff; fill:none; stroke-width:1.4; }
.home-tile-label{
  font-size:12px; font-weight:700; color:currentColor; text-align:center; line-height:1.25;
}
/* Locked tile (2026-09-05: every tile always shows now, this is the only
   thing distinguishing one the viewer can't use) — dimmed, plus a small
   badge instead of hiding the tile outright. */
.home-tile-wrap.locked{ opacity:.5; }
.home-tile-lock{
  position:absolute; top:-4px; right:-4px; width:20px; height:20px; border-radius:50%;
  background:var(--muted); display:flex; align-items:center; justify-content:center;
  border:2px solid var(--bg);
}
.home-tile-lock svg{ width:11px; height:11px; stroke:#fff; fill:none; }

/* ---- Home hero + badge row (2026-08-30) — adopted from a sibling HQ
   mockup's own homepage. Full-bleed green hero (negative margin cancels
   .content's 10px padding, same technique .page-hero already uses) with
   the badge row's white card negative-margined up over it, so the card
   visually overlaps the hero's bottom edge. ---- */
.home-hero{
  margin:-16px -10px 0; padding:36px 10px 90px; background:var(--accent); color:#fff; border-radius:0 0 22px 22px;
  display:flex; flex-direction:column; align-items:center; text-align:center;
}
.home-hero-label{ font-size:18px; color:#abffc9; margin-bottom:6px; }
.home-hero-count{ font-size:42px; font-weight:800; line-height:1; margin-bottom:16px; }
.home-hero-btn{
  background:rgba(255,255,255,.16); color:#fff; border:none; border-radius:12px; width:250px;
  padding:10px 30px; font-family:inherit; font-size:17px; font-weight:700; cursor:pointer;
}
.home-badges{
  display:flex; justify-content:space-around; gap:6px;
  background:#fff; border-radius:20px; margin:-60px 0 24px; padding:14px 6px;
  box-shadow:0 6px 18px rgba(0,0,0,.12); position:relative; z-index:2;
}
.home-badge{ background:none; border:none; padding:0; display:flex; flex-direction:column; align-items:center; gap:8px; cursor:pointer; font-family:inherit; }
.home-badge-circle{
  position:relative; width:50px; height:50px; border-radius:50%; background:var(--accent-soft);
  display:flex; align-items:center; justify-content:center;
}
.home-badge-circle svg{ width:22px; height:22px; stroke:var(--accent); fill:none; }
.home-badge-count{
  position:absolute; top:-4px; right:-4px; background:var(--warn); color:#fff;
  font-size:11px; font-weight:700; border-radius:999px; min-width:18px; height:18px;
  display:flex; align-items:center; justify-content:center; padding:0 4px;
}
.home-badge-label{ font-size:12.5px; color:var(--text); }

/* ---- Home dept sections — tinted band per NAV_ITEMS category (2026-08-29
   band convention already established elsewhere in this app), holding
   that dept's real .home-grid tiles. Full-bleed same as .home-hero. ---- */
.home-section{ margin:20px -4px 0; padding:18px 20px 4px; background:var(--accent-soft); border-radius:14px; }
.home-section-hd{ font-size:17px; font-weight:700; color:var(--text); margin-bottom:14px; padding:0 4px; }
.home-section .home-grid{ padding-bottom:14px; }

/* ---- "Check All" — flat merged list, reached only from the home hero. ---- */
.checkall-screen{ margin-top:5px; }
.checkall-back{
  background:none; border:none; color:var(--accent); font-family:inherit; font-size:15px; font-weight:700;
  padding:6px 0; margin-bottom:8px; cursor:pointer;
}
.checkall-list{ display:flex; flex-direction:column; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
/* Subject+date on one line, a truncated single-line excerpt below it,
   then a small pending-stage pill — not the plain two-column row this
   started as (2026-08-30 revision). */
.checkall-row{ display:flex; flex-direction:column; gap:4px; background:#fff; padding:12px 14px; cursor:pointer; }
.checkall-row-top{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.checkall-row-subject{ font-size:14.5px; font-weight:700; color:var(--text); }
.checkall-row-date{ font-size:12px; color:var(--muted); flex-shrink:0; }
.checkall-row-excerpt{ font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.checkall-row-stage{
  align-self:flex-start; font-size:11.5px; font-weight:700; color:var(--warn-ink); background:#FDF3E3;
  border-radius:999px; padding:3px 10px; margin-top:2px;
}

/* ---- HR Policies (Bottom nav > More > Human Resources > Policies) — same
   row shape as Check All above (subject/right-side on one line, truncated
   excerpt below), own class family per this app's usual per-feature-prefix
   convention even though visually near-identical. ---- */
.policy-screen{ margin-top:5px; }
.policy-list{ display:flex; flex-direction:column; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.policy-row{ display:flex; flex-direction:column; gap:4px; background:#fff; padding:12px 14px; cursor:pointer; }
.policy-row-top{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.policy-row-subject{ font-size:14.5px; font-weight:700; color:var(--text); }
.policy-row-version{ font-size:12px; color:var(--muted); flex-shrink:0; }
.policy-row-excerpt{ font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ---- Policy detail (tap a Policies row) — hr_policy_content is raw
   pasted HTML with its own structure/styling; this wrapper only sets
   defensive baseline readability + overflow guards, deliberately not
   fighting whatever styling the pasted content brings with it. ---- */
.policy-detail-back{
  background:none; border:none; color:var(--accent); font-family:inherit; font-size:15px; font-weight:700;
  padding:6px 0; margin-bottom:8px; cursor:pointer;
}
.policy-detail-content{ font-size:14px; line-height:1.5; color:var(--text); overflow-x:auto; }
.policy-detail-content img{ max-width:100%; height:auto; }
.policy-detail-content table{ max-width:100%; }

/* ---- Empty state — used by nav placeholders and the notifications sheet. ---- */
.empty-state{
  height:auto; padding:40px 30px 20px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; color:var(--muted);
}
.empty-state svg{ width:40px; height:40px; stroke:var(--muted); fill:none; stroke-width:1.5; margin-bottom:14px; }
.empty-state .es-title{ font-size:15px; font-weight:600; color:var(--text); margin-bottom:4px; }
.empty-state .es-sub{ font-size:14px; }

/* ---- Shared bottom sheet — profile / notifications. ---- */
.backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.35); opacity:0; pointer-events:none;
  transition:opacity .2s ease-out; z-index:10;
}
.backdrop.open{ opacity:1; pointer-events:auto; }
.sheet{
  position:fixed; left:0; right:0; bottom:calc(56px + env(safe-area-inset-bottom,0px)); background:var(--surface);
  border-radius:20px 20px 0 0;
  /* translateY(100%) alone only shifts by the sheet's OWN height — since
     the box is anchored 56px+safe-area above the viewport bottom (not
     bottom:0), that offset is what's left exposed when "closed",
     regardless of content height: a permanent sliver (containing the
     .handle bar) sitting on top of the bottom nav on every screen, most
     visible on short-content screens like Reps Remittances. Adding the
     same offset to the closed-state transform pushes the whole box fully
     clear; .sheet.open below is unchanged, so the open resting position
     stays exactly where it was. */
  transform:translateY(calc(100% + 56px + env(safe-area-inset-bottom,0px))); transition:transform .25s ease-out;
  z-index:11; max-height:85%; display:flex; flex-direction:column; padding-bottom:30px;
}
.sheet.open{ transform:translateY(0); }
.sheet .handle{ width:36px; height:4px; background:var(--line); border-radius:2px; margin:10px auto 6px; flex-shrink:0; }
.sheet .list{ overflow-y:auto; padding-top:12px; }
.sheet-close{
  position:absolute; top:10px; right:10px; z-index:1;
  width:32px; height:32px; border-radius:50%; background:var(--bg); border:none;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.sheet-close svg{ width:16px; height:16px; stroke:var(--muted); fill:none; }
.sheet-detail{ padding:6px 16px 20px; }
.sheet-detail .head{ display:flex; align-items:center; gap:14px; margin-bottom:16px; }
.sheet-detail .avatar-lg{
  width:56px; height:56px; border-radius:50%; background:var(--accent-soft); color:var(--accent);
  display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; flex-shrink:0;
}
.sheet-detail .head-name{ font-size:17px; font-weight:600; }
.sheet-detail .head-role{ font-size:14px; color:var(--muted); margin-top:2px; }
.sheet-detail .row{ display:flex; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--line); }
.sheet-detail .row:last-of-type{ border-bottom:none; }
.sheet-detail .row .k{ font-size:14px; color:var(--muted); }
.sheet-detail .row .v{ font-size:15px; font-weight:600; color:var(--text); text-align:right; }
.sheet-section-title{ font-size:12.5px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin:18px 0 6px; }
.sheet-section-title.lg{ font-size:18px; font-weight:700; color:var(--text); text-transform:none; letter-spacing:normal; }
.home-item{ padding:13px 2px; border-bottom:1px solid var(--line); display:flex; align-items:flex-start; gap:10px; }
.home-item svg{ width:20px; height:20px; flex-shrink:0; stroke:var(--muted); fill:none; margin-top:2px; }
.home-item:last-of-type{ border-bottom:none; }
.home-item .title{ font-weight:600; font-size:18px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Locked menu row (2026-09-05, same "show everything, mark what's locked"
   change as the Home tile grid) — dimmed, trailing lock icon instead of
   being hidden outright; tapping still fires (selectFeature() itself is
   the one place that actually blocks it with a toast). */
.home-item.locked{ opacity:.5; }

.login-screen{
  height:100dvh; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:#CDD8D3; color:var(--text);
  padding:24px; padding-top:calc(24px + env(safe-area-inset-top,0px)); padding-bottom:calc(24px + env(safe-area-inset-bottom,0px));
  overflow-y:auto;
}
.login-topbar{
  width:100%; display:flex; align-items:center; justify-content:space-between;
  position:absolute; top:calc(20px + env(safe-area-inset-top,0px)); left:50%; transform:translateX(-50%);
  padding:0 30px;
}
.login-topbar-left{ display:flex; align-items:center; gap:10px; }
.login-user-icon{
  width:36px; height:36px; border-radius:50%; background:#EFEBE8; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.login-user-icon svg{ width:20px; height:20px; fill:#C5C2BC; stroke:none; }
.login-greeting-block{ display:flex; flex-direction:column; line-height:1.25; }
.login-greeting-hello{ font-size:12px; color:var(--muted); }
.login-greeting-name{ font-size:15px; font-weight:700; color:var(--text); }
.login-topbar-logo{ height:40px; width:auto; }
.login-header{ display:flex; flex-direction:column; align-items:center; margin-bottom:28px; flex:0 0 auto; }
.login-title{ font-size:23px; font-weight:700; }
.login-sub{ font-size:16px; opacity:.75; margin-top:14px; text-align:center; }
.login-card{ width:100%; max-width:360px; background:transparent; padding:0 5px; color:var(--text); }

.login-field{ margin-bottom:20px; }
.login-field label{ display:block; font-size:16px; font-weight:600; color:var(--muted); margin-bottom:6px; }
.login-field input{
  width:100%; font-family:inherit; font-size:19px; line-height:1.5; padding:10px 12px;
  border:1px solid var(--accent); border-radius:10px; background:#fff; color:var(--text);
}
.login-field input:focus{ outline:none; border-color:var(--ok); }
.login-field input:disabled{ background:var(--bg); color:var(--muted); }
.login-submit-btn{
  width:100%; font-family:inherit; font-size:18px; font-weight:600; color:#fff;
  background:var(--accent); border:none; border-radius:8px; padding:13px 0; cursor:pointer;
  margin-top:16px; display:flex; align-items:center; justify-content:center; gap:7px;
}

.pin-dots{ display:flex; justify-content:center; gap:14px; margin-bottom:18px; }
.pin-dot{ width:14px; height:14px; border-radius:50%; background:#fff; border:1px solid var(--line); }
.pin-dot.filled{ background:#333; border-color:#333; }
.pin-status{ color:var(--muted); font-size:14px; text-align:center; margin-bottom:8px; }
.pin-keypad.disabled{ opacity:.5; pointer-events:none; }
.pin-key-row{ display:grid; grid-template-columns:repeat(3, 1fr); justify-items:center; align-items:center; margin-bottom:26px; }
.pin-key{
  width:66px; height:66px; border-radius:50%; border:none; background:#DDE5DF;
  color:#000; font-family:inherit; font-size:21px; font-weight:600; cursor:pointer;
}
.pin-key-forgot{
  font-size:12.5px; font-weight:600; color:var(--muted); background:none;
}
.pin-key-back{ display:flex; align-items:center; justify-content:center; }
.pin-key-back svg{ width:22px; height:22px; stroke:var(--text); fill:none; }
.field-error{ color:var(--bad); font-size:14.5px; margin-top:8px; text-align:center; }

/* ---- Reps Map (Route Sales > Reps Map). Full-bleed within .content,
   same negative-margin technique .page-hero uses to cancel .content's
   10px padding, on all four sides this time. Rep/day filters float over
   the map itself (2026-08-29) — same position:absolute-over-the-tiles
   convention the field-rep app's own .map-day-filter uses, not a row
   pushing the map down. margin-top here is just a harmless 0 fallback —
   real ownership of it is the higher-specificity ".page-hero +
   .reps-map-screen" override above, which always wins regardless of
   stylesheet order (unlike two equal-specificity rules racing). ---- */
.reps-map-screen{
  position:relative; z-index:0; height:100%; overflow:hidden;
  margin:0 -10px -10px; width:calc(100% + 20px);
}
.reps-map-filters{
  position:absolute; top:15px; left:10px; right:10px; z-index:6;
}
.reps-map-select-row{ display:flex; justify-content:space-between; gap:6px; align-items:flex-start; }
.reps-map-btn-col{ display:flex; flex-direction:column; gap:6px; }
.reps-map-close-btn{ 
  flex:0 0 auto; width:34px; height:34px; border-radius:8px; border:1px solid var(--line);
  background:#fff; color:var(--text); display:flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.18);
 }
.reps-map-close-btn svg{ width:18px; height:18px; stroke:currentColor; fill:none; }
 .reps-map-close-btn svg{ width:18px; height:18px; stroke:currentColor; fill:none; }
.reps-map-select{
  flex:1 1 0; min-width:0; font-family:inherit; font-size:13px; font-weight:600; color:var(--text);
  background:#fff; border:1px solid var(--line); border-radius:8px; padding:7px 10px;
  box-shadow:0 2px 6px rgba(0,0,0,.18);
}
.reps-map-submit-btn{
  flex:0 0 auto; width:34px; height:34px; border-radius:8px; border:none;
  background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.18);
}
.reps-map-submit-btn svg{ width:18px; height:18px; stroke:currentColor; fill:none; }
.reps-map-status{
  font-size:12.5px; color:var(--bad); background:#fff; margin-top:8px; padding:6px 10px;
  border-radius:8px; box-shadow:0 2px 6px rgba(0,0,0,.18);
}
.reps-map-fill{ position:absolute; inset:0; z-index:0; }

/* ---- Reps Map focus toggle (2026-08-30) — one button styled like a
   physical on/off slider (text labels instead of on/off): Leads on top,
   Customers on bottom, a sliding thumb behind whichever is active.
   Tapping anywhere on it flips the state — it's a single button, not two
   separately-tappable labels. Only rendered when both marker
   capabilities are held (see repsMapFocusToggleHtml()'s own comment).
   Labels read bottom-to-top (2026-08-30 revision) — .reps-map-focus-opt
   stays a plain centered box so its own layout/sizing is simple and
   predictable; the rotation lives on the inner -text span instead, so
   only the text itself turns, not the box computing its position.
   Narrower + taller than the original horizontal-text version: width
   only needs to fit the text's thickness now, height needs to fit the
   longest word's (Customers) rotated length. */
.reps-map-focus-toggle{
  position:absolute; right:14px; bottom:36px; z-index:6;
  width:26px; height:132px; border-radius:24px; background:#fff; border:none; padding:0; cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.22); display:flex; flex-direction:column; overflow:hidden;
}
.reps-map-focus-thumb{
  position:absolute; left:2px; right:2px; top:2px; height:calc(50% - 4px);
  background:var(--accent); border-radius:20px; transition:transform .2s ease-out; z-index:0;
}
.reps-map-focus-toggle.focus-customers .reps-map-focus-thumb{ transform:translateY(calc(100% + 4px)); }
.reps-map-focus-opt{
  flex:1 1 50%; display:flex; align-items:center; justify-content:center;
  position:relative; z-index:1; color:var(--muted); transition:color .2s ease-out;
}
.reps-map-focus-opt-text{
  display:inline-block; transform:rotate(-90deg); white-space:nowrap;
  font-family:inherit; font-size:10.5px; font-weight:700; letter-spacing:.02em; color:inherit;
}
.reps-map-focus-opt.active{ color:#fff; }

/* ---- Stock Requests (Route Sales > Requests) — standardized Transaction
   view (`.txn-*`, migrated 2026-09-01: Date | rep name as subject +
   batch ref/item-count/next-step as detail | Total). Opens the app's
   shared bottom sheet for the approve/issue detail — not the desktop
   reference's wide table + centered .dt-modal (rules-and-facts.md
   "Desktop-portal reference facts" — adopt the logic, rebuild the UI).
   Its own former row family (`.stock-req-row-*`) is gone, superseded;
   `.stock-refresh-btn` below is unrelated and still shared everywhere. ---- */
.stock-refresh-btn{
  flex:0 0 auto; width:32px; height:32px; border-radius:50%; border:1px solid var(--line); background:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.stock-refresh-btn svg{ width:17px; height:17px; stroke:var(--accent); fill:none; }
.stock-refresh-btn:disabled{ opacity:.5; cursor:default; }

.stock-approve-sheet{ padding-top:2px; }
.stock-approve-meta{ font-size:13px; color:var(--muted); margin:-4px 0 10px; }
/* POS-receipt table (2026-08-30 revision — was a stacked card per line,
   name on its own row above a 3-column qty/price/amount block; this is
   the standard invoice shape instead, one header row + one compact row
   per product). Item is the genuine first column now, so IT stays left-
   aligned per real-table convention — Qty joins Price/Amount as right-
   aligned numeric columns (unlike the old card layout, where Qty visually
   was the first column and stayed left for that reason). */
.stock-line-list{ display:flex; flex-direction:column; margin-bottom:6px; border-top:1px solid var(--line); }
.stock-line{ display:flex; align-items:flex-start; gap:8px; padding:10px 0; border-bottom:1px solid var(--line); }
.stock-line-name{ flex:1 1 auto; min-width:0; font-size:14px; font-weight:600; color:var(--text); overflow-wrap:break-word; }
.stock-line-num{ flex:0 0 72px; text-align:right; font-size:14px; font-weight:600; color:var(--text); }
.stock-line-head{
  padding:10px 0 8px; font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.02em;
}
.stock-line-head .stock-line-name, .stock-line-head .stock-line-num{
  font-size:inherit; font-weight:inherit; color:inherit; text-transform:inherit; letter-spacing:inherit;
}
.stock-qty-input{
  width:100%; font-family:inherit; font-size:14px; font-weight:600; color:var(--text); text-align:right;
  border:1px solid var(--line); border-radius:8px; padding:6px 6px; background:#fff;
}
.stock-qty-input:disabled{ background:var(--bg); color:var(--muted); }
.stock-totals-wrap .row{ padding:9px 0; }
.stock-note-wrap{ margin:8px 0 4px; }
.stock-note-input{
  width:100%; min-height:64px; font-family:inherit; font-size:14px; color:var(--text);
  border:1px solid var(--line); border-radius:8px; padding:9px 10px; resize:vertical;
}
.stock-view-only{ font-size:13px; color:var(--muted); text-align:center; margin-top:10px; }
.stock-approve-actions{ display:flex; gap:10px; margin-top:14px; }
.stock-action-btn{
  flex:1 1 0; font-family:inherit; font-size:15px; font-weight:700; border-radius:8px; padding:12px 0;
  cursor:pointer; border:none;
}
.stock-action-btn.approve{ background:var(--accent); color:#fff; }
.stock-action-btn:disabled{ opacity:.5; cursor:default; }
.stock-action-btn.reject{ background:#fff; color:var(--bad); border:1px solid var(--bad); }
/* Rule 5 exception (2026-08-30) — greyed but still clickable (tapping
   shows an "unauthorized" toast instead of hiding the button outright),
   so this can't use :disabled's opacity/cursor alone (that'd also block
   the click). Declared after .approve/.reject so it wins when a button
   carries both (e.g. an unauthorized Reject button stays grey, not red). */
.stock-action-btn.unauthorized{ background:var(--line); color:var(--muted); cursor:pointer; border:none; }

/* ---- Remittance Verification (Finance > Reps Remittances) — standardized
   Transaction view (`.txn-*`, migrated 2026-09-01 — a literal "list of
   remittances", one of the named examples for this archetype) + the
   shared bottom sheet for the slip photo(s)/Verify detail, same detail-
   sheet pattern as Stock Requests above (rules-and-facts.md "Desktop-
   portal reference facts" — adopt the logic, rebuild the UI mobile-
   native, not the desktop reference's wide table + centered .dt-modal).
   Reuses .stock-approve-actions/.stock-action-btn for the Verify button
   itself (identical shape, no need for a second copy). The old bordered-
   card row (`.remit-card`, its own one-off box-shadow treatment, not
   shared with anything else) is gone along with `.remit-screen`/
   `.remit-toolbar`/`.remit-list` — all superseded by `.txn-*` +
   `.list-screen`/`.list-toolbar`. ---- */
.remit-verify-meta{ font-size:13px; color:var(--muted); margin:-4px 0 6px; }
.remit-verify-notes{ font-size:13.5px; color:var(--text); margin-bottom:10px; }
.remit-slip-wrap{ display:flex; flex-direction:column; gap:10px; margin:6px 0 4px; }
.remit-slip-link{ display:block; }
.remit-slip-img{ width:100%; border-radius:8px; border:1px solid var(--line); display:block; }

/* ---- Generic list-screen chrome (`.list-screen`/`.list-toolbar`) — pure
   layout, zero domain meaning: a small top margin, and a refresh button
   flush right above the list. Shared by every list-view archetype below
   (Parties, Transactions) and anything else that needs a plain "screen
   with a refresh button" shell. ---- */
.list-screen{ margin-top:5px; }
.list-toolbar{ display:flex; justify-content:flex-end; margin-bottom:12px; }

/* ---- Status pill (`.status-pill`) — atomic colored badge, usable
   standalone (e.g. Regional Order detail sheet's header, next to the
   order number) or embedded in a row (Parties view's trailing status
   slot). Not tied to any one list-view archetype or feature. */
.status-pill{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:20px; flex-shrink:0; white-space:nowrap; background:var(--line); color:var(--muted); }
.status-pill.pending{ background:#FDF3E3; color:var(--warn-ink); }
.status-pill.approved{ background:var(--accent-soft); color:var(--accent); }
/* Real hq_orders_upcountry hq_status values (confirmed live 2026-08-31/09-01,
   see rules-and-facts.md) — used by Regional Orders' detail-sheet header
   pill only (its list row moved to plain text, see `.txn-*` below). draft
   falls through to the base grey/muted rule above (a pre-submission
   order, nothing to color-code yet). */
.status-pill.pending_approval{ background:#FDF3E3; color:var(--warn-ink); }
.status-pill.credit_approved{ background:var(--accent-soft); color:var(--accent); }
.status-pill.issued,
.status-pill.in_transit{ background:#E3EEFB; color:#1D4ED8; }
.status-pill.delivered{ background:var(--accent-soft); color:var(--accent); }
.status-pill.cancelled{ background:#FDECEC; color:var(--bad); }

/* ---- Standardized Parties view (`.party-*`, 2026-09-01 explicit spec) —
   avatar | name as subject + details as body | relevant status/info.
   A Person row and an Entity/company row are two content variants of the
   same three-part layout (a person's details in the body vs. a company's
   type + key details), not two components. Used by HR > Employees.
   Naming history — three rounds of real feedback on this exact
   component: `regorder-*` (wrong, named after Regional Orders while
   reused in Employees' markup — "why did you use classes that say
   regorder-*** in employee list?") -> `inbox-*` (wrong, named after a
   surface visual resemblance instead of the thing itself — "why inbox-*
   ... you can't get something that matches the context?") -> `record-*`
   (wrong in a different way — an abstract shape name, not a domain name;
   correctly wasn't "great" either, since `.ledger-row` proved the actual
   right pattern: name it for what it IS in this app's business terms) ->
   `party-*`, split out once Regional Orders (which never was a "party" —
   it's a transaction) got its own correctly-named `.txn-*` archetype
   instead of sharing this one just because the CSS happened to look
   identical. Lesson: visual identity between two things doesn't mean they
   share a domain concept — Regional Orders and Employees only ever
   *looked* the same, they were never the same kind of thing. ---- */
.party-list{ display:flex; flex-direction:column; }
.party-row{ display:flex; gap:12px; align-items:flex-start; background:#fff; padding:14px 4px; cursor:pointer; border-bottom:1px solid var(--line); }
.party-row:last-child{ border-bottom:none; }
/* No detail view to open yet (Employees, until its own is scoped) — same
   row shape, just not tappable, so the cursor shouldn't claim otherwise. */
.party-row.static{ cursor:default; }
.party-avatar{
  flex-shrink:0; width:38px; height:38px; border-radius:50%; color:#fff; font-weight:700; font-size:15px;
  display:flex; align-items:center; justify-content:center;
}
.party-row-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.party-row-top{ display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.party-row-subject{ font-size:14.5px; font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.party-row-excerpt{ font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ---- Regional Order detail sheet (2026-08-31 rebuild — the original
   version was flagged, correctly, as shallow: unlabeled meta lines with
   no visual hierarchy, order items as flat unaligned text instead of a
   real table, and bare unstyled native <input type="file"> controls that
   looked like nothing else in this app. Reuses .stock-line-.row/.k/.v
   (already-designed patterns elsewhere in this app) rather than
   reinventing them, and adds one genuinely new component this app never
   had before: a styled file-attach control, since this is the first
   feature that ever uploads anything. ---- */
/* Regional Order detail as an actual Sales Order document (2026-08-31
   rebuild #2 — the previous version reused this app's own mobile-UI row
   styles for what needs to read as a real accounting document instead;
   correctly flagged as not fit for purpose). Structure follows the
   user's own explicit spec + reference sample: centered company
   letterhead, a rule, centered "SALES ORDER" title + order number,
   status, then customer (left) / terms+date (right) in two columns —
   all inside one bordered "page", matching a real printed sales order's
   single-sheet look, distinct from the rest of this app's borderless
   mobile-card style (a deliberate one-off: this content's whole point is
   to look like a document, not an app screen). Company letterhead text
   is the real one already used company-wide for the field-rep app's own
   receipts (www-source/app.js, POS/remittance/stock-request slips) —
   reused verbatim, not invented. */
.regorder-document{ border:1px solid var(--line); border-radius:10px; padding:16px; margin:6px 0 16px; }
.regorder-doc-company{ text-align:center; font-weight:800; font-size:15px; margin-bottom:2px; }
.regorder-doc-line{ text-align:center; font-size:12px; color:var(--muted); line-height:1.5; }
.regorder-doc-rule{ border-top:1px solid var(--line); margin:12px 0; }
.regorder-doc-title{ text-align:center; font-weight:800; font-size:18px; letter-spacing:.5px; margin-bottom:14px; }
.regorder-doc-cols{ display:flex; gap:18px; }
.regorder-doc-col{ flex:1; min-width:0; }
.regorder-doc-col-label{ font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; }
.regorder-doc-col-line{ font-size:13.5px; color:var(--text); margin-bottom:3px; overflow-wrap:break-word; }
.regorder-doc-col-line.strong{ font-weight:700; }
/* SO no./status moved into the right (metadata) column, below Date
   (2026-08-31, explicit instruction) — status pill right-aligned to
   match the column's own .v alignment, on its own row since a pill
   doesn't fit the plain k/v text shape the other rows use. */
.regorder-doc-status-row{ display:flex; justify-content:flex-end; margin-bottom:5px; }
.regorder-doc-meta-row{ display:flex; justify-content:space-between; gap:8px; font-size:13px; margin-bottom:5px; }
.regorder-doc-meta-row .k{ color:var(--muted); }
.regorder-doc-meta-row .v{ font-weight:600; color:var(--text); text-align:right; }
/* Grand Total row — Subtotal/VAT/Total (2026-08-31, real bug: prices
   were all VAT-exclusive with no VAT line anywhere) — bold + a rule
   above it, same "final row stands apart" convention the reference
   sample's own boxed totals use, just without literally boxing each
   figure (would be a box-in-a-box inside .regorder-document). */
.regorder-doc-meta-row.total{ border-top:1px solid var(--line); padding-top:8px; margin-top:3px; }
.regorder-doc-meta-row.total .k, .regorder-doc-meta-row.total .v{ font-weight:800; font-size:15px; color:var(--text); }
.regorder-detail-notes{ font-size:13.5px; color:var(--text); background:var(--accent-soft); border-radius:8px; padding:10px 12px; margin:4px 0 10px; }
.file-attach-row{
  display:flex; align-items:center; gap:10px; padding:12px 14px; margin:8px 0;
  border:1.5px dashed var(--line); border-radius:10px; cursor:pointer; background:#fff;
}
.file-attach-row svg{ width:20px; height:20px; stroke:var(--accent); fill:none; flex-shrink:0; }
.file-attach-row-label{ font-size:14px; color:var(--muted); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-attach-row.has-file{ border-style:solid; border-color:var(--accent); }
.file-attach-row.has-file .file-attach-row-label{ color:var(--text); font-weight:600; }
/* "Already attached" view card (2026-08-31) — regionalOrderAttachmentCardHtml()'s
   PDF branch. Real bug: this class was introduced in app.js and used
   immediately, with no matching CSS ever written — rendered as a raw,
   unstyled 24x24-viewBox SVG at the browser's default 300x150 intrinsic
   size next to a default blue underlined link, not any kind of caching
   issue. Same solid-accent-border "attached" treatment as
   .file-attach-row.has-file above, since this is that same state's
   view-only counterpart (a file already on the server, not one just
   picked locally). */
.attachment-card{
  display:flex; align-items:center; gap:10px; padding:12px 14px; margin:8px 0;
  border:1.5px solid var(--accent); border-radius:10px; background:#fff; text-decoration:none;
}
.attachment-card svg{ width:20px; height:20px; stroke:var(--accent); fill:none; flex-shrink:0; }
.attachment-card-label{ font-size:14px; font-weight:600; color:var(--text); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.regorder-action-section{ border-top:1px solid var(--line); padding-top:14px; margin-top:14px; }
.regorder-action-section-title{ font-size:14px; font-weight:700; color:var(--text); margin-bottom:4px; }
.regorder-action-hint{ font-size:12.5px; color:var(--muted); margin-bottom:6px; }

/* ---- Reps Reports (Sales > Route Sales > Reports) — standardized
   Transaction view (`.txn-*`, migrated 2026-09-01: Date | customer as
   subject + receipt no as detail | Amount). Its own grid-row list
   (`.report-*`) is gone, superseded. ---- */
.reports-total-row{ font-size:14px; color:var(--muted); margin:12px 0; }
.reports-total-row strong{ color:var(--text); font-size:16px; }

/* ---- Reps Ledger (Sales > Route Sales > Ledgers, and Finance > Reps
   Ledgers). ---- */
/* ---- Standardized Ledger view (2026-09-01, explicit spec) — Date |
   Details | Debit | Credit | Balance, the canonical 5-column shape for
   any running-balance list (a rep's own goods/payments ledger today; any
   future debit/credit ledger reuses this as-is, not a new table). Debit/
   Credit/Balance are right-aligned numbers (standard accounting
   convention); Date/Details are left-aligned text. ---- */
.ledger-list{ display:flex; flex-direction:column; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:10px; overflow:hidden; margin-top:12px; }
.ledger-row{
  display:grid; grid-template-columns:0.85fr 1.3fr 0.9fr 0.9fr 1fr; gap:8px; align-items:center;
  background:#fff; padding:10px 12px; font-size:13px; font-variant-numeric:tabular-nums;
}
.ledger-row.ledger-head{ background:var(--bg); font-size:11.5px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
/* Per-column classes, not nth-child position (2026-09-01, explicit
   preference: "class names should be very adoptive to view type") — each
   cell says what it is, not just where it sits, so the markup reads on
   its own and survives a column reorder without breaking styling. */
.ledger-details{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ledger-dr, .ledger-cr, .ledger-bal{ text-align:right; }
.ledger-bal{ font-weight:700; color:var(--text); }
.ledger-bal.neg{ color:var(--bad); }

/* ---- Standardized Transaction view (2026-09-01, explicit spec) — Date |
   Details (subject = party if any, body = context-appropriate text) |
   Amount, the canonical 3-column shape for any single-figure transaction
   list: orders, invoices, payments, remittances, etc. Distinct from
   `.party-*` (no avatar, no status pill — a transaction is identified by
   date + party + amount, not by a lifecycle stage) and from `.ledger-*`
   (one running balance, not a plain list of individual transactions).
   Uses the generic `.list-screen`/`.list-toolbar` chrome, not its own. */
.txn-list{ display:flex; flex-direction:column; }
.txn-row{
  display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:start;
  background:#fff; padding:5px 4px; border-bottom:1px solid var(--line);
}
.txn-row:last-child{ border-bottom:none; }
.txn-date{ font-size:12px; color:var(--muted); white-space:nowrap; }
.txn-body{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.txn-subject{ font-size:13px; font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.txn-detail{ font-size:12px; color:var(--muted); overflow:visible; text-overflow:ellipsis; white-space:pre-wrap; }
.txn-amount{ font-weight:700; color:var(--text); text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; font-size:13px; }

/* ---- Standardized Products view (`.product-*`, 2026-09-01 explicit
   spec) — Image | product name as subject + product details as body. No
   trailing status/amount column (unlike Parties/Transactions) — a product
   catalog row is identified by its photo and name, nothing time- or
   figure-based to show alongside. Square rounded-corner thumbnail, not a
   circular avatar — a product photo, not a person/company initial.
   Not wired to a live screen yet — no Products feature has a real data
   source/screen decided; built ready for whichever one is scoped first. */
.product-list{ display:flex; flex-direction:column; }
.product-row{ display:flex; gap:12px; align-items:flex-start; background:#fff; padding:14px 4px; cursor:pointer; border-bottom:1px solid var(--line); }
.product-row:last-child{ border-bottom:none; }
.product-image{ flex-shrink:0; width:44px; height:44px; border-radius:8px; object-fit:cover; background:var(--line); }
.product-row-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.product-row-subject{ font-size:14.5px; font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.product-row-excerpt{ font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* width/top/height are also set inline in app.js's mountRepsMap() (that's
   what actually applies, inline beats stylesheet) — kept in sync here
   just so this rule isn't misleading about the real layout. */
.reps-map-fill .leaflet-container{ width:100%; top:10px; height:calc(100% - 20px); }
.map-popup{ font-size:13px; }
.map-popup-name{ font-weight:700; margin-bottom:3px; }
.map-popup-sub{ color:#6B7280; }
/* ---- Map popup actions (2026-08-31) — Call/WhatsApp/Copy/Navigate, same
   shape as the field-rep app's own .map-popup-actions. ---- */
.map-popup-actions{ display:flex; gap:14px; margin-top:8px; }
.map-popup-action{
  width:20px; height:20px; border:none; background:none; cursor:pointer;
  padding:0; display:flex; align-items:center; justify-content:center;
}
.map-popup-action svg{ width:18px; height:18px; stroke:#4B5563; fill:none; }
.map-popup-action.call svg{ stroke:#DC2626; }
.map-popup-action.whatsapp svg{ stroke:none; fill:#25D366; }
.map-popup-action.visit svg{ stroke:var(--accent); }

/* ---- Customer map markers — ported from the field-rep app's
   .cust-map-icon. Green = assigned to the currently-selected rep chip
   (blue/.other-rep = someone else's, or no rep selected), same fill-color
   split the field-rep app uses for "assigned to me" vs not. ---- */
.cust-map-icon{
  border-radius:50%; background:var(--accent);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
.cust-map-icon.other-rep{ background:#2AAFDC; }
/* Pending-location customers (2026-08-31) — a rep just added them in the
   field, location not yet confirmed; overrides other-rep/mine coloring
   regardless of assignment, since "needs review" is the more salient
   fact here. Popup/behavior otherwise identical to a normal customer. */
.cust-map-icon.pending{ background:var(--warn); }
.cust-map-icon svg{ width:16px; height:16px; stroke:#fff; fill:none; }
/* Sales-recency ring — ported from the field-rep app's own
   customerRecencyTier() styling. Always .recency-none (gray) here for now
   — see customerMapIcon()'s own comment in app.js: this app has no
   per-customer last-sale data source wired up yet to compute the real
   tier from. */
.cust-map-icon.recency-active{ box-shadow:0 0 0 2px #22C55E, 0 2px 6px rgba(0,0,0,.3); }
.cust-map-icon.recency-aging{ box-shadow:0 0 0 2px #F59E0B, 0 2px 6px rgba(0,0,0,.3); }
.cust-map-icon.recency-stale{ box-shadow:0 0 0 2px #EF4444, 0 2px 6px rgba(0,0,0,.3); }
.cust-map-icon.recency-none{ box-shadow:0 0 0 2px #9CA3AF, 0 2px 6px rgba(0,0,0,.3); }
/* Zoom-based size tiers (mapIconTierForZoom() in app.js) — container size
   only, SVG stays a fixed 16px throughout. */
.cust-map-icon.sz-10{ width:10px; height:10px; }
.cust-map-icon.sz-15{ width:15px; height:15px; }
.cust-map-icon.sz-20{ width:20px; height:20px; }
.cust-map-icon.sz-25{ width:25px; height:25px; }

/* ---- hq_leads prospect pins — ported from the field-rep app's
   .lead-map-icon, red so an unverified lead never reads as a real
   registered customer. Mortar/cross for pharmacy, plain "H" glyph for
   hospital/health-centre categories (see leadMapIcon() in app.js). Same 4
   zoom-tier sizes as customer markers. ---- */
.lead-map-icon{
  border-radius:50%; background:#EF4238;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
.lead-map-icon svg{ width:16px; height:16px; stroke:#fff; fill:none; }
.lead-icon-h{ color:#fff; font-size:11px; font-weight:700; font-family:inherit; line-height:1; }
.lead-map-icon.sz-10{ width:10px; height:10px; }
.lead-map-icon.sz-15{ width:15px; height:15px; }
.lead-map-icon.sz-20{ width:20px; height:20px; }
.lead-map-icon.sz-25{ width:25px; height:25px; }

/* ---- Selected rep's last known point — ported from the field-rep app's
   live-GPS marker (.live-loc-icon: soft accuracy-circle ring + a blinking
   center dot), parameterized by --stale-color (routeStaleColor() in
   app.js) instead of the field-rep app's fixed blue — there it always
   marks "my own live position"; here it marks whichever rep is selected,
   colored by how stale their last point is. ---- */
.live-loc-icon{ width:32px; height:32px; position:relative; }
.live-loc-icon .llp-ring{
  position:absolute; inset:0; border-radius:50%;
  background:color-mix(in srgb, var(--stale-color, #4182F0) 15%, transparent);
  border:1px solid color-mix(in srgb, var(--stale-color, #4182F0) 50%, transparent);
}
.live-loc-icon .llp-dot{
  position:absolute; top:7px; left:7px; width:18px; height:18px; border-radius:50%;
  background:var(--stale-color, #4182F0); border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.35);
  animation:llpBlink 1.6s ease-in-out infinite;
}
@keyframes llpBlink{
  0%, 60%, 100%{ opacity:1; }
  30%{ opacity:.4; }
}

.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  background:var(--text); color:#fff; padding:10px 18px; border-radius:999px;
  font-size:14.5px; z-index:20;
}
