/* StraightShot Overhead — Field App theme */
:root {
  --bg: #0a0a0a;
  --bg2: #111311;
  --panel: #161816;
  --card: #1c1f1c;
  --card2: #232723;
  --line: #2c302c;
  --text: #f2f4f2;
  --muted: #9aa39a;
  --accent: #2fe342;
  --accent-dim: #1d9e2e;
  --accent-glow: rgba(47, 227, 66, 0.18);
  --danger: #ff5252;
  --warn: #ffb02e;
  --info: #3da9ff;
  --radius: 12px;
  --head: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 15px; line-height: 1.45;
  overscroll-behavior: none;
}
h1, h2, h3, h4 { font-family: var(--head); text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--accent); color: #000; }

.kicker {
  color: var(--accent); font-family: var(--head); text-transform: uppercase;
  font-size: 12px; letter-spacing: .22em; font-weight: 600;
}

/* ---------- layout ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: #000; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
/* offline / sync banner — pinned to the very top; shifts the sticky topbar down when shown */
.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: none;
  text-align: center; font-size: 13px; font-weight: 600; padding: 6px 14px;
  background: var(--accent); color: #000;
}
.offline-bar.show { display: block; }
.offline-bar.off { background: #e0a82e; }
.offline-bar.warn { background: var(--danger, #d64545); color: #fff; cursor: pointer; }
.update-bar {
  position: fixed; left: 0; right: 0; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 120;
  margin: 0 auto; width: max-content; max-width: 92%; cursor: pointer;
  background: var(--accent); color: #000; font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
body.offbar #app { padding-top: 30px; }
body.offbar .topbar { top: 30px; }
/* mark items that haven't synced yet */
.pending-tag {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #e0a82e; border: 1px solid #e0a82e; border-radius: 6px; padding: 1px 5px; margin-left: 6px; vertical-align: middle;
}

.topbar img.logo { height: 34px; }
/* the logo art is black-on-transparent — invert lightness for dark UI, keep the green */
img.logo, .login-wrap > img, .present img[src*="logo"] { filter: invert(1) hue-rotate(180deg) saturate(1.4); }
.topbar .spacer { flex: 1; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--text); font-family: var(--head); text-transform: uppercase; font-size: 13px;
  letter-spacing: .08em; padding: 8px 12px; border-radius: 8px; font-weight: 600;
}
.nav a.active, .nav a:hover { color: var(--accent); background: var(--accent-glow); }
.userchip {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.userchip .dot { width: 10px; height: 10px; border-radius: 50%; }

main { flex: 1; padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); max-width: 1500px; width: 100%; margin: 0 auto; }
@media (min-width: 900px) { main { padding-bottom: 32px; } }

/* mobile bottom tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: #000; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  /* too many items to fit on a phone — swipe horizontally through them */
  overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a {
  /* grow to fill when few tabs; hold a tap-friendly min width and overflow (scroll) when many */
  flex: 1 0 auto; min-width: 64px; text-align: center; padding: 10px 4px 8px; color: var(--muted);
  font-family: var(--head); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--accent); }
@media (min-width: 900px) { .tabbar { display: none; } }
@media (max-width: 899px) { .nav { display: none; } }

/* ---------- game-style nav: floating MENU button + weapon wheel ----------
   z-ladder: menu button 96 (above the canvass map at 90 AND the fullscreen messages panel
   at 95 — the menu must be reachable from every screen), wheel scrim 96 / petals 97,
   hamburger scrim 97 + panel 98; all below modals (100) and toasts (200). */
.tab-menu-btn {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 96;
  width: 62px; height: 62px; padding: 0;
  border-radius: 50%; border: 2px solid var(--accent); background: #0b110b; color: var(--accent);
  font-family: var(--head); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  box-shadow: 0 0 16px rgba(47, 227, 66, .4), 0 2px 10px rgba(0, 0, 0, .6);
  -webkit-touch-callout: none; user-select: none; touch-action: none;
}
.tab-menu-btn svg { width: 22px; height: 22px; }
.tab-menu-btn:active { transform: translateX(-50%); }
@media (min-width: 900px) { .tab-menu-btn { display: none; } }
.nav-dot { position: absolute; top: 2px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid #000; }
.wheel-scrim { position: fixed; inset: 0; z-index: 96; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.wheel { position: fixed; inset: 0; z-index: 97; pointer-events: none; }
.wheel-petal {
  position: fixed; transform: translate(-50%, -50%); pointer-events: auto;
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(15, 21, 15, .88); border: 1.5px solid rgba(47, 227, 66, .45);
  color: var(--text); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
  animation: petal-pop .32s cubic-bezier(.2, 1.6, .4, 1) backwards;
}
.wheel-petal .wp-ic { display: block; }
.wheel-petal .wp-ic svg { width: 21px; height: 21px; display: block; }
.wheel-petal .wp-lb {
  font-size: 8.5px; font-family: var(--head); text-transform: uppercase; letter-spacing: .03em;
  max-width: 52px; overflow: hidden; white-space: nowrap; color: var(--muted);
}
.wheel-petal.active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(47, 227, 66, .5); }
.wheel-petal.active .wp-lb { color: var(--accent); }
.wheel-petal.hot { background: var(--accent); color: #0a0a0a; border-color: var(--accent); transform: translate(-50%, -50%) scale(1.16); }
.wheel-petal.hot .wp-lb { color: #0a0a0a; }
.wheel-petal.edit { border-style: dashed; opacity: .85; }
.wheel-petal .nav-badge { position: absolute; top: -4px; right: -4px; margin: 0; border: 2px solid var(--bg); }
@keyframes petal-pop { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
/* hamburger: complete section list, all screen sizes — nothing is ever unreachable */
.ham-btn {
  position: relative; flex: none; width: 40px; height: 40px; margin-left: 8px; padding: 0;
  border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.ham-btn svg { width: 21px; height: 21px; }
.ham-btn .nav-dot { top: -3px; right: -3px; border-color: var(--bg); }
.ham-scrim { z-index: 97; backdrop-filter: none; -webkit-backdrop-filter: none; }
.ham-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 98; width: min(300px, 85vw);
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0, 0, 0, .5);
  transform: translateX(102%); transition: transform .22s ease; overflow-y: auto;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
}
.ham-panel.open { transform: translateX(0); }
.ham-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 8px; }
.ham-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 8px; border: none; border-top: 1px solid var(--line); border-radius: 0; background: none;
  color: var(--text); font-size: 14.5px; text-decoration: none;
}
.ham-row .wp-ic svg { width: 19px; height: 19px; display: block; }
.ham-row.active { color: var(--accent); }
.ham-row:active { background: var(--card2, #171a17); }
.ham-row .nav-badge { margin-left: auto; }
.ham-edit { color: var(--muted); font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) { .wheel-petal { animation: none; } .ham-panel { transition: none; } }

/* ---------- components ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.card.hl { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim), 0 8px 30px rgba(47,227,66,.07); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); font-size: 13px; }
.big { font-size: 22px; font-weight: 700; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

button, .btn {
  font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  background: var(--card2); color: var(--text); border: 1px solid var(--line);
  padding: 11px 16px; border-radius: 10px; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, transform .05s;
}
button:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #051006; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 15px 22px; font-size: 16px; width: 100%; }
.btn-block { width: 100%; }

label.field, .field { display: block; margin-bottom: 12px; }
label.field > span, .field > span {
  display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 5px; font-family: var(--head); font-weight: 600;
}
input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font-family: var(--body); font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-dim); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); transform: scale(1.3); margin-right: 8px; }

/* rich text editor */
.rte { border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); overflow: hidden; }
.rte-bar { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); }
.rte-btn {
  width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1; cursor: pointer;
}
.rte-btn:last-child { width: auto; padding: 0 10px; font-size: 13px; }
.rte-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.rte-input { min-height: 96px; padding: 11px 12px; font-family: var(--body); font-size: 15px; outline: none; }
.rte-input:focus { box-shadow: 0 0 0 3px var(--accent-glow); }
.rte-input:empty::before { content: 'Description…'; color: var(--muted); }
.rte-input ul, .rte-render ul, .desc ul { margin: 4px 0; padding-left: 22px; }
.rte-input li, .rte-render li, .desc li { margin: 2px 0; }
.rte-render { white-space: normal; }

/* price book category groups */
.cat-group { margin-bottom: 18px; }
.cat-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--head); text-transform: uppercase; letter-spacing: .08em;
  font-size: 13px; font-weight: 600; color: var(--accent);
  padding: 6px 2px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.cat-count { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--bg2); border-radius: 10px; padding: 1px 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--head); text-transform: uppercase; font-size: 11px; font-weight: 600;
  letter-spacing: .08em; padding: 4px 9px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted);
}
.badge.s-scheduled { color: var(--info); border-color: var(--info); }
.badge.s-enroute { color: var(--warn); border-color: var(--warn); }
.badge.s-onsite { color: var(--accent); border-color: var(--accent); }
.badge.s-completed { color: #c084fc; border-color: #c084fc; }
.badge.s-invoiced { color: #ff8fab; border-color: #ff8fab; }
.badge.s-paid { color: #051006; background: var(--accent); border-color: var(--accent); }
.badge.s-canceled { color: var(--danger); border-color: var(--danger); }
.badge.s-estimate_sent { color: #00b8d4; border-color: #00b8d4; }
.badge.s-awaiting_order { color: #e6a417; border-color: #e6a417; }
.badge.s-closeout { color: #9aa0a6; border-color: #5b5f68; }
.badge.s-lost { color: #b08a8a; border-color: #7a6c6c; }
/* Orders nav count badge */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle; }
/* estimate email preview (rendered in an isolated iframe) */
.estimate-preview { width: 100%; height: 44vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* customer-message tagging: toggle chips (compose) + read-only mention pills */
.tag-chip { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.tag-chip:hover { border-color: var(--accent); }
.tag-chip.on { background: var(--accent); border-color: var(--accent); color: #04210a; font-weight: 700; }
.mention-chip { display: inline-block; background: rgba(47,227,66,.12); border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: 12px; }

/* reminders "done" checkbox */
.rem-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: none; color: #04210a; font-size: 13px; font-weight: 800; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.rem-check:hover { border-color: var(--accent); }
.rem-check.on { background: var(--accent); border-color: var(--accent); }
.badge.w-active { color: #051006; background: var(--accent); border-color: var(--accent); }
.badge.w-expired { color: var(--danger); border-color: var(--danger); }

/* toasts */
#toasts { position: fixed; bottom: calc(74px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: #000; border: 1px solid var(--accent-dim); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; max-width: 90vw;
  box-shadow: 0 6px 24px rgba(0,0,0,.6); animation: toastin .25s ease;
}
.toast.err { border-color: var(--danger); color: var(--danger); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* modal */
/* while a modal or fullscreen overlay is up, the page behind must not scroll */
html.no-scroll, body.no-scroll { overflow: hidden; }
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 680px; max-height: 92dvh; overflow-y: auto; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  animation: slideup .22s ease;
  overscroll-behavior: contain;   /* reaching the end of the modal must not scroll the page behind */
}
@media (min-width: 700px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 18px; max-height: 88dvh; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: .5; } }
.modal h2 { margin-bottom: 14px; }
.modal .modal-x {
  position: sticky; top: 0; float: right; z-index: 5;
  width: 32px; height: 32px; padding: 0; border-radius: 50%; margin: -4px -4px 0 10px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 1;
}
.modal .modal-x:hover { color: var(--text); border-color: var(--accent-dim); }

/* lists */
.list-item {
  display: flex; gap: 12px; align-items: center; padding: 13px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 9px; cursor: pointer; transition: border-color .15s;
}
.list-item:hover { border-color: var(--accent-dim); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }

/* estimate rows — stacked (text+status / action buttons) so they never squish on phones */
.est-row {
  padding: 13px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-top: 10px;
}
.est-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ---------- dispatch board — horizontal timeline ---------- */
.edit-toggle {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-family: var(--head); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; color: var(--muted);
}
.edit-toggle:has(input:checked) { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-glow); }

.tl-wrap { overflow-x: auto; }
.tl { min-width: 100%; }
.tl-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: none; }
.tl-tech {
  flex: 0 0 140px; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  position: sticky; left: 0; z-index: 6; background: var(--card);
  border-right: 1px solid var(--line); font-weight: 700; font-size: 13px;
  white-space: nowrap; overflow: hidden;
}
.tl-tech .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tl-tech-name { overflow: hidden; text-overflow: ellipsis; }
.tl-head .tl-tech { font-family: var(--head); text-transform: uppercase; font-size: 11px; letter-spacing: .07em; color: var(--muted); background: #000; }
.tl-track-wrap { flex: 1; min-width: 0; }
.tl-hours { display: flex; background: #000; }
.tl-hour {
  flex-shrink: 0; padding: 8px 6px; font-size: 11px; color: var(--muted);
  border-left: 1px solid var(--line); font-family: var(--head); letter-spacing: .05em;
}
.tl-track { position: relative; background: var(--bg2); }
.tl-track.dragover { background: var(--accent-glow); }
.tl-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(44,48,44,.65); pointer-events: none; }
.tl-bar {
  position: absolute; z-index: 3; border-radius: 7px; padding: 4px 9px; overflow: hidden;
  color: #06130a; font-size: 12px; cursor: pointer; user-select: none; touch-action: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.4); min-width: 40px;
}
.tl-bar .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bar .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .78; font-size: 11px; }
.tl-bar.done { color: var(--text); opacity: .55; }
/* technician-unavailable block: hatched grey, distinct from any job status color */
.tl-bar.unavail {
  color: #e8eaed;
  background: repeating-linear-gradient(45deg, #4b5059, #4b5059 7px, #3b3f47 7px, #3b3f47 14px);
  border: 1px dashed rgba(255,255,255,.4);
}
.tl-bar.unavail .s { opacity: .9; }
.tl-bar.editing { cursor: grab; box-shadow: 0 0 0 2px rgba(255,255,255,.35), 0 2px 8px rgba(0,0,0,.4); }
.tl-bar.dragging { opacity: .6; cursor: grabbing; z-index: 20; }
.tl-resize { position: absolute; top: 0; bottom: 0; right: 0; width: 14px; cursor: ew-resize; touch-action: none; }
.tl-resize::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); right: 4px; width: 3px; height: 20px; border-radius: 2px; background: rgba(0,0,0,.45); }

.tl-tabs { flex-wrap: wrap; }
.tl-table { font-size: 13px; }
.tl-tr {
  display: grid; grid-template-columns: 150px 90px 112px 120px 1fr 1.2fr 80px;
  gap: 8px; align-items: center; padding: 9px 8px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.tl-tr:last-child { border-bottom: none; }
.tl-tr:not(.tl-th):hover { background: var(--card2); }
.tl-th {
  cursor: default; color: var(--muted); font-family: var(--head); text-transform: uppercase;
  font-size: 10.5px; letter-spacing: .08em;
}
.tl-th .sortable { cursor: pointer; user-select: none; }
.tl-th .sortable:hover { color: var(--accent); }
.tl-tr > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-start { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.tl-start > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
@media (max-width: 760px) {
  .tl-table .tl-tr { grid-template-columns: 96px 96px 1fr 24px; }
  .tl-table .tl-tr > :nth-child(1), .tl-table .tl-tr > :nth-child(2), .tl-table .tl-tr > :nth-child(6) { display: none; }
  .tl-tech { flex-basis: 96px; }
}

/* jobs tab — compact rows (service date + time first, status color stripe) */
.jobs-table .tl-tr { grid-template-columns: 100px 150px 124px 1fr 1.2fr 130px 20px; }
.jobs-table .tl-tr.hl { background: var(--accent-glow); }
/* keep the status pill inside its column — never let a long label spill onto the customer name */
.jobs-table .badge { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .jobs-table .tl-tr { grid-template-columns: 78px 118px 1fr 20px; }
  .jobs-table .tl-tr > :nth-child(3), .jobs-table .tl-tr > :nth-child(5), .jobs-table .tl-tr > :nth-child(6) { display: none; }
}

/* ---------- pay stub (My Pay portal) ---------- */
.paystub { max-width: 660px; margin: 0 auto; }
.paystub .ps-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.paystub .ps-head img { height: 42px; width: auto; }
/* white-text logo on the dark screen card; dark-text logo when printed on white paper */
.paystub .ps-head .logo-print { display: none; }
.paystub .ps-title { font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: 15px; }
.paystub .ps-meta { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.paystub .ps-section { margin-top: 20px; }
.paystub .ps-section-h { font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.paystub table { width: 100%; border-collapse: collapse; font-size: 13px; }
.paystub th, .paystub td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.paystub th.num, .paystub td.num { text-align: right; white-space: nowrap; }
.paystub thead th { color: var(--muted); font-family: var(--head); text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; }
.paystub tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: none; }
.paystub .ps-total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--head); font-size: 20px; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--accent); }
@media print {
  .paystub { max-width: none; box-shadow: none; }
  .paystub .ps-head img { height: 40px; }
  .paystub .ps-head .logo-screen { display: none; }
  .paystub .ps-head .logo-print { display: inline; }
}

/* ---------- job workflow ---------- */
.statusflow { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.statusflow .step {
  flex-shrink: 0; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  font-family: var(--head); text-transform: uppercase; font-size: 12px; letter-spacing: .06em;
  color: var(--muted); background: var(--card); font-weight: 600;
}
.statusflow .step.done { color: var(--accent-dim); border-color: var(--accent-dim); }
.statusflow .step.now { color: #051006; background: var(--accent); border-color: var(--accent); }

/* per-field inspection photos */
.insp-field { margin-bottom: 6px; }
.field-photo-row { margin: -6px 0 12px; }
.field-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.field-photo { position: relative; }
.field-photo img, .field-photo-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
/* photo-inspection viewer: full-width captioned photos */
.insp-photo-lg { width: 100%; max-height: 340px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }

/* ---------- team messaging (texting-style chat) ---------- */
.chat-thread { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bubble { max-width: 78%; border-radius: 14px; padding: 8px 12px; font-size: 14.5px; line-height: 1.35; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #04210a; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble .meta { font-size: 10.5px; opacity: .65; margin-top: 2px; }
/* #123 job tags — readable on both bubble colors */
.bubble a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.bubble.theirs .meta { color: var(--muted); opacity: 1; }
.day-divider {
  text-align: center; color: var(--muted); font-size: 11px; margin: 12px 0 6px;
  display: flex; align-items: center; gap: 10px;
}
.day-divider::before, .day-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 4px; }
.chat-composer textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; }
.convo-dot {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #04210a; margin-right: 10px; font-size: 15px;
}

/* ---------- pipeline board (kanban) ---------- */
.pb-wrap {
  display: flex; gap: 10px; align-items: flex-start;
  overflow-x: auto; padding-bottom: 14px; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.pb-col {
  flex: 0 0 268px; min-width: 268px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  max-height: calc(100dvh - 240px); display: flex; flex-direction: column;
}
.pb-col.dragover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pb-col.collapsed { flex-basis: 54px; min-width: 54px; }
.pb-col.collapsed .pb-cards, .pb-col.collapsed .pb-totals { display: none; }
.pb-col.collapsed .pb-head-top { writing-mode: vertical-rl; padding: 10px 4px; }
.pb-head { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; flex: none; }
.pb-head-top { display: flex; align-items: center; gap: 6px; }
.pb-name { font-family: var(--head); text-transform: uppercase; font-size: 13px; letter-spacing: .05em; font-weight: 600; }
.pb-count { color: var(--muted); font-size: 12px; font-weight: 700; }
.pb-totals { font-size: 12px; color: var(--text); margin-top: 3px; font-weight: 600; }
.pb-cards { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.pb-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: pan-y;   /* vertical scroll stays native; horizontal drag is ours */
}
.pb-card:hover { border-color: var(--accent-dim); }
.pb-card.stale { border-left: 3px solid var(--warn); }
.pb-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-value { font-weight: 800; color: var(--accent); font-size: 14px; }
.pb-ghost { position: fixed; z-index: 300; pointer-events: none; opacity: .9; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.pb-flag {
  display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid var(--line); color: var(--muted); border-radius: 5px; padding: 1px 5px;
}
.pb-flag.warn { border-color: var(--warn); color: var(--warn); }
.pb-flag.danger { border-color: var(--danger); color: var(--danger); }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rpt-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px 4px 0; }
.rpt-table td { padding: 6px 10px 6px 0; border-top: 1px solid var(--line); }

/* ---------- messenger popup (floating chat button + panel, like FB Messenger) ---------- */
.msgr-fab {
  position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 94;
  width: 56px; height: 56px; border-radius: 50%; padding: 0;
  background: var(--accent); color: #04210a; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(47,227,66,.35);
}
.msgr-fab svg { width: 26px; height: 26px; display: block; }
.msgr-fab .nav-badge { position: absolute; top: -3px; right: -3px; margin: 0; border: 2px solid var(--bg); }
@media (min-width: 900px) { .msgr-fab { bottom: 24px; } }
/* reminders bell — stacked directly above the chat button, same look */
.msgr-fab.rem { bottom: calc(150px + env(safe-area-inset-bottom)); background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.msgr-fab.rem:hover { border-color: var(--accent-dim); }
@media (min-width: 900px) { .msgr-fab.rem { bottom: 90px; } }
/* canvass runs its own fullscreen map; bare pages (login / invite / reset) have no session */
body[data-route="canvass"] .msgr-fab, body[data-route="bare"] .msgr-fab,
body[data-route="canvass"] .msgr-panel, body[data-route="bare"] .msgr-panel { display: none; }

.msgr-panel {
  position: fixed; inset: 0; z-index: 95;   /* phones: fullscreen, over the tab bar */
  display: none; flex-direction: column;
  background: var(--panel);
}
.msgr-panel.open { display: flex; }
@media (min-width: 700px) {
  /* bigger screens: a floating card anchored above the chat button */
  .msgr-panel {
    inset: auto 18px calc(152px + env(safe-area-inset-bottom)) auto;
    width: 376px; height: min(600px, calc(100dvh - 180px));
    border: 1px solid var(--line); border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.55);
    animation: slideup .18s ease;
  }
}
@media (min-width: 900px) { .msgr-panel { bottom: 92px; } }
/* reminders panel anchors above ITS button on bigger screens (fullscreen on phones as-is) */
@media (min-width: 700px) { .msgr-panel.rem { bottom: calc(218px + env(safe-area-inset-bottom)); height: min(540px, calc(100dvh - 250px)); } }
@media (min-width: 900px) { .msgr-panel.rem { bottom: 158px; } }
.msgr-head {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  background: #000; border-bottom: 1px solid var(--line);
}
@media (min-width: 700px) { .msgr-head { padding-top: 10px; border-radius: 15px 15px 0 0; } }
.msgr-head h2 { flex: 1; font-size: 18px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgr-hbtn {
  flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted);
  font-size: 16px; line-height: 1;
}
.msgr-hbtn:hover { color: var(--text); border-color: var(--accent-dim); }
.msgr-body { flex: 1; overflow-y: auto; padding: 12px 14px; overscroll-behavior: contain; }
.msgr-body .list-item { margin-bottom: 0; }
.msgr-foot {
  flex: none; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg2); border-top: 1px solid var(--line);
}
@media (min-width: 700px) { .msgr-foot { padding-bottom: 10px; border-radius: 0 0 15px 15px; } }

/* ---------- canvassing map (fullscreen, over the normal layout like .present) ---------- */
.canvass { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; }
.canvass-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top)); background: #000; border-bottom: 1px solid var(--line); flex: none;
  overflow-x: auto; scrollbar-width: none;   /* safety net: swipe if the buttons ever outgrow a phone */
}
.canvass-bar::-webkit-scrollbar { display: none; }
.canvass-bar .btn-sm { flex: none; white-space: nowrap; }
.canvass-map { flex: 1; min-height: 0; }
.canvass-fab {
  position: absolute; right: 14px; bottom: calc(24px + env(safe-area-inset-bottom));
  width: 46px; height: 46px; border-radius: 50%; font-size: 20px; padding: 0;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.45); z-index: 5;
}
.canvass-fab.compass { bottom: calc(82px + env(safe-area-inset-bottom)); -webkit-touch-callout: none; user-select: none; touch-action: manipulation; }
.canvass-fab.compass.dim { opacity: .6; }   /* rotation mode off (fast raster map) */
.canvass-fab.compass.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 227, 66, .35), 0 4px 14px rgba(0,0,0,.45); }
.compass-needle { display: inline-flex; transition: transform .25s; }
.compass-needle svg { width: 24px; height: 24px; }
.canvass-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--card); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); max-height: 60%; overflow-y: auto;
  box-shadow: 0 -6px 24px rgba(0,0,0,.5);
}
.canvass-disps { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.canvass-disp {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px;
  border: 2px solid var(--line); border-radius: 10px; background: var(--card2, #171a17); font-size: 13.5px;
}
.canvass-disp .dot { width: 11px; height: 11px; }
/* door report: one column of selectable pin-type rows (tap = include in total + CSV) */
.report-row {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 11px 8px; border: none; border-top: 1px solid var(--line); border-radius: 0;
  border-left: 3px solid transparent; background: none; font-size: 14.5px; opacity: .55;
}
.report-row.on { opacity: 1; border-left-color: var(--accent); background: var(--card2, #171a17); }
.report-row .report-lbl { flex: 1; min-width: 0; }
.report-row .dot { width: 12px; height: 12px; flex: none; }
.report-count { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.report-count .dot { width: 11px; height: 11px; flex: none; }
/* inline line-icons that replaced the app's emojis — inherit text size + color */
.ic { display: inline-flex; vertical-align: -3px; }
.ic svg { width: 1.1em; height: 1.1em; }
button .ic, a .ic { margin-right: 5px; }
button .ic:only-child, a .ic:only-child { margin-right: 0; }

/* dropdown popup at the tapped house: address header + color-coded result rows */
.canvass-pop {
  position: fixed; z-index: 95; min-width: 230px; max-width: 300px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 10px 6px; box-shadow: 0 10px 30px rgba(0,0,0,.6);
  max-height: calc(100vh - 16px); overflow-y: auto;   /* expanded drip rows can outgrow small phones */
}
/* drip campaign: numbered step badge (the map marker is the same disc, SVG-baked) */
.drip-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #0a0a0a;
  font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.drip-num.lg { width: 34px; height: 34px; font-size: 18px; }
.canvass-pop-drip-toggle { border-top: 1px solid var(--line); margin-top: 4px; }
.drip-step-row { display: flex; gap: 6px; margin: 6px 0 2px; }
.drip-step-row button {
  width: 36px; height: 36px; border-radius: 50%; padding: 0; font-weight: 800; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.drip-step-row button.on { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.canvass-pop-addr { font-size: 12.5px; color: var(--muted); line-height: 1.3; padding: 2px 2px 6px; flex: 1; min-width: 0; }
.canvass-pop-x { flex: none; background: none; border: none; color: var(--muted); font-size: 15px; padding: 2px 6px; }
.canvass-pop-row {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 11px 8px; border: none; border-top: 1px solid var(--line); border-radius: 0;
  background: none; font-size: 14.5px;
}
.canvass-pop-row:active, .canvass-pop-row:hover { background: var(--card2, #171a17); }
.canvass-pop-row .dot { width: 13px; height: 13px; flex: none; }
button.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: canvass-pulse 1.4s infinite; }
@keyframes canvass-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- goofy GPS-point milestones: celebration overlay + trophy shelf ---------- */
/* z 170: above modals (100) and the image viewer (150), below toasts (200) — it can fire
   over anything and auto-dismiss without disturbing what's underneath */
.mstone-back {
  position: fixed; inset: 0; z-index: 170; background: rgba(0,0,0,.78);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  animation: mstone-in .3s ease;
}
.mstone-back.out { opacity: 0; transition: opacity .35s; }
.mstone-confetti { position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 2px; animation: mstone-fall 3s linear infinite; }
.mstone-card { text-align: center; padding: 28px 22px; max-width: 340px; animation: mstone-pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.mstone-trophy .ic svg { width: 84px; height: 84px; color: var(--accent); animation: mstone-wobble 1.2s ease-in-out infinite; }
.mstone-card h2 { font-family: var(--head); text-transform: uppercase; font-size: 26px; margin: 6px 0; line-height: 1.15; }
.mstone-count { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.mstone-reward { color: #ffd23f; font-size: 15px; margin: 12px 0 0; line-height: 1.45; }
@keyframes mstone-in { from { opacity: 0; } }
@keyframes mstone-fall { from { transform: translateY(-5vh) rotate(0); } to { transform: translateY(110vh) rotate(540deg); } }
@keyframes mstone-pop { from { transform: scale(.5); opacity: 0; } }
@keyframes mstone-wobble { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) { .mstone-confetti, .mstone-trophy .ic svg { animation: none; } }
.shelf-row { display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shelf-row:last-child { border-bottom: none; }
.shelf-cup .ic svg { width: 26px; height: 26px; color: var(--accent); }
.shelf-row.next .shelf-cup .ic svg, .shelf-row.locked .shelf-cup .ic svg { color: var(--muted); }
.shelf-row.locked { opacity: .35; }
.shelf-title { font-weight: 700; }
.shelf-reward { font-size: 12.5px; color: #ffd23f; margin-top: 2px; line-height: 1.4; }
.shelf-row.locked .shelf-reward { color: var(--muted); }
.shelf-bar { height: 5px; border-radius: 99px; background: var(--card2, #171a17); border: 1px solid var(--line); margin-top: 6px; overflow: hidden; }
.shelf-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.field-photo .rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  background: var(--danger); color: #fff; border: none; font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center;
}

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }

.rating { display: flex; gap: 6px; }
.rating button { padding: 8px 0; width: 44px; }
.rating button.on { background: var(--accent); color: #051006; border-color: var(--accent); }
.segmented { display: flex; gap: 8px; }
.segmented button { flex: 1; }
.segmented button.on { background: var(--accent); color: #051006; border-color: var(--accent); }
.segmented button.on.bad { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- estimate presentation ---------- */
.present {
  position: fixed; inset: 0; z-index: 90; background: var(--bg);
  display: flex; flex-direction: column;
  overscroll-behavior: contain;
}
.present .deck {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.present .deck::-webkit-scrollbar { display: none; }
.present .opt {
  min-width: 100%; scroll-snap-align: center; padding: 18px 22px 8px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.tierbadge {
  align-self: center; font-family: var(--head); text-transform: uppercase; font-weight: 700;
  letter-spacing: .2em; font-size: 13px; padding: 6px 18px; border-radius: 999px; margin-bottom: 10px;
  border: 1px solid var(--line); color: var(--muted);
}
.tier-good { color: var(--info); border-color: var(--info); }
.tier-better { color: var(--warn); border-color: var(--warn); }
.tier-best { color: #051006; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 24px var(--accent-glow); }
.present .opt h2 { text-align: center; font-size: 26px; margin-bottom: 4px; }
.present .opt .desc { text-align: center; color: var(--muted); margin-bottom: 16px; }
.present .lineitem { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.present .total-row { display: flex; justify-content: space-between; padding: 16px 0; font-size: 24px; font-weight: 800; }
.present .total-row .amt { color: var(--accent); }
.present .dots { display: flex; justify-content: center; gap: 8px; padding: 10px; }
.present .dots .d { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.present .dots .d.on { background: var(--accent); }
.present .foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #000; }
.swipe-hint { text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 4px; }

/* signature */
.sigpad { background: #f6f6f4; border-radius: 12px; position: relative; touch-action: none; }
.sigpad canvas { width: 100%; height: 160px; display: block; border-radius: 12px; }
.sigpad .sigline { position: absolute; left: 8%; right: 8%; bottom: 34px; border-top: 1.5px solid #999; pointer-events: none; }
.sigpad .clear-sig { position: absolute; top: 8px; right: 8px; }

.contract-body { white-space: pre-wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 14px; }

/* invoice */
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th { text-align: left; font-family: var(--head); text-transform: uppercase; font-size: 11px; letter-spacing: .1em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.inv-table td { padding: 9px 6px; border-bottom: 1px solid rgba(44,48,44,.5); font-size: 14px; }
.inv-totals { margin-left: auto; max-width: 280px; margin-top: 10px; }
.inv-totals .row { display: flex; justify-content: space-between; padding: 4px 6px; }
.inv-totals .grand { font-size: 22px; font-weight: 800; color: var(--accent); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }

/* tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: none; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); padding: 10px 13px; flex-shrink: 0; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* login */
.login-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 8px; }
.login-wrap img { max-width: 320px; width: 80%; }
.login-card { width: 100%; max-width: 380px; }
.user-pick { display: grid; gap: 8px; }
.user-pick button { justify-content: flex-start; }
.pin-dots { display: flex; gap: 12px; justify-content: center; padding: 12px; }
.pin-dots .d { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); }
.pin-dots .d.on { background: var(--accent); border-color: var(--accent); }
.pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-grid button { padding: 16px; font-size: 20px; }

/* stacked above the floating chat + reminders buttons, which hold the bottom-right corner */
.fab {
  position: fixed; right: 18px; bottom: calc(218px + env(safe-area-inset-bottom)); z-index: 40;
  width: 58px; height: 58px; border-radius: 50%; font-size: 28px; line-height: 1;
  background: var(--accent); color: #051006; border: none; box-shadow: 0 6px 24px rgba(47,227,66,.35);
}
@media (min-width: 900px) { .fab { bottom: 160px; } }

/* technician job cards (My Day) */
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-row select { flex: 1; min-width: 0; }
.daterange { flex: 2 1 220px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.daterange > span { color: var(--muted); font-size: 12px; flex: none; }
.daterange input[type="date"] { flex: 1; min-width: 0; }
.jobcard-lg h3 { text-transform: none; letter-spacing: 0; }
.date-divider {
  font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-size: 13px;
  color: var(--accent); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.jobcard-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 11px; }
.jobcard-row { display: flex; gap: 11px; align-items: flex-start; }
a.jobcard-row { color: inherit; }
.jobcard-row .ic { font-size: 15px; width: 20px; flex-shrink: 0; text-align: center; line-height: 1.3; }
.jobcard-row strong {
  display: block; font-family: var(--head); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); font-weight: 600;
}
.jobcard-row .val { font-size: 14px; color: var(--text); }
a.jobcard-row .val { color: var(--accent); }

.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty .kicker { display: block; margin-bottom: 6px; }

/* timeline */
.timeline { border-left: 2px solid var(--line); margin-left: 7px; padding-left: 16px; }
.timeline .ev { position: relative; padding-bottom: 13px; font-size: 13px; }
.timeline .ev::before { content: ''; position: absolute; left: -22.5px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--card2); border: 2px solid var(--accent-dim); }

.imgview { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.93); display: flex; align-items: center; justify-content: center; }
.imgview img { max-width: 96vw; max-height: 92dvh; object-fit: contain; }

/* ── inventory ── */
.inv-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.inv-cat-head:hover { background: var(--card2); }
.inv-arrow { color: var(--muted); font-size: 12px; transition: transform .2s; display: inline-block; }
.inv-arrow.open { transform: rotate(90deg); }
.inv-cat-name { font-weight: 700; text-transform: uppercase; letter-spacing: .5px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
@media (min-width: 560px) { .inv-grid { grid-template-columns: repeat(3, 1fr); } }
.inv-card { background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); display: flex; flex-direction: column; gap: 7px; padding: 10px; }
.inv-card.low { border-left-color: var(--danger); }
.inv-card-body { cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inv-card-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-card-cat { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-qty-row { display: flex; align-items: center; gap: 4px; }
.inv-qty-btn { background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 17px; font-weight: 600; width: 30px; height: 30px; flex-shrink: 0; cursor: pointer; line-height: 1; }
.inv-qty-btn:hover { background: var(--accent); border-color: var(--accent); color: #04210a; }
.inv-qty-input { flex: 1; min-width: 0; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-weight: 700; font-size: 15px; height: 30px; padding: 0 4px; outline: none; }
.inv-qty-input:focus { border-color: var(--accent); }
.inv-qty-save { background: var(--accent); border: none; border-radius: 6px; color: #04210a; font-size: 14px; font-weight: 900; width: 30px; height: 30px; flex-shrink: 0; cursor: pointer; line-height: 1; }
.inv-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.inv-badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.inv-badge.low { border-color: var(--danger); color: var(--danger); background: rgba(255,82,82,.1); }
.inv-card-val { color: var(--accent); font-weight: 700; font-size: 13px; }
.inv-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: none; color: #04210a; font-size: 12px; font-weight: 700; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.inv-check:hover { border-color: var(--accent); }
.inv-check.on { background: var(--accent); border-color: var(--accent); }
.list-item.inv-ordered { opacity: .55; }
.list-item.inv-ordered .title { text-decoration: line-through; }

/* pending auto-attached inspection (to-do / required) */
.list-item.insp-pending { border-left: 3px solid var(--warn); }

/* ---------- finance ---------- */
.fin-chart { padding: 4px 0; }
.fin-bar-row { display: grid; grid-template-columns: 130px 1fr 88px; gap: 10px; align-items: center; padding: 4px 0; }
.fin-bar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-bar-track { background: var(--card); border: 1px solid var(--line); border-radius: 4px; height: 14px; overflow: hidden; }
.fin-bar { background: var(--danger); opacity: .8; height: 100%; border-radius: 3px; }
.fin-bar-amt { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.fin-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.fin-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--card); }
.fin-thumb-lg { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); cursor: pointer; }
.fin-thumb-lg.fin-thumb-empty { display: flex; align-items: center; justify-content: center; background: var(--card); }
.fin-thumb-pdf { flex-direction: column; gap: 2px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--accent); text-decoration: none; cursor: pointer; }
.fin-thumb-pdf svg { width: 16px; height: 16px; }
.fin-table { font-size: 13px; }
.fin-tr { display: grid; grid-template-columns: 90px 1fr 1.3fr 1fr 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: center; }
.fin-tr:last-child { border-bottom: 0; }
.fin-tr.fin-th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.fin-tr > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .fin-bar-row { grid-template-columns: 92px 1fr 76px; }
  .fin-tr { grid-template-columns: 64px 1fr 1fr; }
  .fin-tr > span:nth-child(3), .fin-tr > span:nth-child(4) { display: none; }
}

/* print-friendly reports (Finance → Print) */
@media print {
  .topbar, .tabbar, .tabs, .filter-row, .offline-bar, .update-bar, .fab, .msgr-fab, .msgr-panel, .no-print, button,
  .wheel, .wheel-scrim, .ham-btn, .ham-panel, .tab-menu-btn { display: none !important; }
  body, main, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .card { border: 1px solid #ddd; break-inside: avoid; }
  main { padding: 0; max-width: none; }
  .muted { color: #555 !important; }
  .print-title { display: block !important; margin-bottom: 12px; }
  .fin-bar { background: #c0392b !important; }
}

/* ---------- busy state for async buttons (see busyClick in ui.js) ----------
   A save on weak cellular can take seconds; the spinner is what tells a tech in the
   field that the tap registered, so they don't hit it twice or assume it failed. */
.spin {
  display: inline-block; width: 13px; height: 13px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
button[data-busy] { opacity: .85; cursor: progress; }
/* inline progress line used by multi-step uploads (photos) */
.upload-status { display: block; margin-top: 8px; font-size: 13px; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

/* ---------- job workflow: pinned identity + one section at a time ----------
   The header and the next-step button stay put while the wheel swaps what's
   below them, so a tech can change job status from any section. */
.job-pin {
  position: sticky; top: var(--topbar-h, 60px); z-index: 20; background: var(--bg);
  padding: 6px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.job-pin h1 { font-size: 24px; margin: 0; }
.job-pin .statusflow { margin-bottom: 0; }
.job-act { margin: 10px 0 4px; }
.job-act .card.hl:empty { display: none; }   /* statuses with no primary action */
.job-section-title {
  font-family: var(--head); text-transform: uppercase; letter-spacing: .07em;
  font-size: 13px; color: var(--accent); margin: 14px 0 8px;
}
.job-body > .card:first-child { margin-top: 0; }
/* the wheel button is hidden on desktop, so the section list also appears as tabs */
.tabs.job-tabs { display: none; }
@media (min-width: 900px) {
  .tabs.job-tabs { display: flex; flex-wrap: wrap; margin-top: 12px; }
  /* same offset on desktop — the topbar is sticky at every width */
}
/* the floating button while a job is open */
.tab-menu-btn.job-mode { border-color: var(--warn); color: var(--warn); box-shadow: 0 0 16px rgba(255,176,32,.4), 0 2px 10px rgba(0,0,0,.6); }
.wheel-petal.exit { border-color: var(--warn); color: var(--warn); }
.wheel-petal.grouped { border-style: double; }
.ham-row.ham-exit { color: var(--warn); }

/* entries taken off the wheel still live in the hamburger, under their own heading */
.ham-sep {
  margin: 14px 0 2px; padding: 8px 8px 4px; border-top: 1px solid var(--line);
  font-family: var(--head); text-transform: uppercase; letter-spacing: .08em;
  font-size: 11px; color: var(--muted);
}
.ham-row.off-wheel { color: var(--muted); }
.ham-row.off-wheel .wp-ic { opacity: .7; }
