/* 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);
}
.tabbar a {
  flex: 1; 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; } }

/* ---------- 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-lost { color: #b08a8a; border-color: #7a6c6c; }
/* 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 */
.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;
}
@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; }

/* ---------- 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-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 96px 1fr 1.2fr 130px 20px; }
.jobs-table .tl-tr.hl { background: var(--accent-glow); }
.jobs-table .badge { justify-self: start; }
@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; }
}

/* ---------- 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; }
.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;
}
.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; }

.fab {
  position: fixed; right: 18px; bottom: calc(84px + 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: 28px; } }

/* technician job cards (My Day) */
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; }
.filter-row select { 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-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, .no-print, button { 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; }
}
