/* MoveClerk — mobile-first, dead simple */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1a1a1a;
  --muted: #5f6572;
  --brand: #1d4ed8;
  --brand-dark: #1e40af;
  --navy: #0c1f44;
  --danger: #dc2626;
  --line: #e5e7eb;
  --ok: #15803d;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 420px at 8% 0%, rgba(29,78,216,0.07), transparent 60%),
    radial-gradient(900px 420px at 95% 6%, rgba(96,165,250,0.09), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.notice { color: var(--ok); font-weight: 600; }
.center { text-align: center; }
/* Text-style button for secondary actions (e.g. "Forgot password?") — still
   a 48px+ touch target, like every other tap target in the app. */
.link-btn {
  background: none;
  border: 0;
  color: var(--brand);
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
  min-height: 48px;
  padding: 12px 16px;
}
/* Reset codes are uppercase letters/digits; show the field that way too. */
#forgot-code { text-transform: uppercase; }

/* Long user content (names, notes, addresses) wraps instead of breaking the layout */
.card, .modal-card, .login-card { overflow-wrap: break-word; }

/* ---------- Screens ---------- */
.screen { min-height: 100vh; min-height: 100dvh; }

/* ---------- Login ---------- */
#login-screen {
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(620px 320px at 85% 8%, rgba(96,165,250,0.22), transparent 62%),
    linear-gradient(160deg, #0c1f44 0%, #1e40af 100%);
}
/* Split panel: brand story on the left, sign-in form on the right. */
.login-shell {
  display: flex;
  width: 100%;
  max-width: 900px;
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}
.login-brand {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 44px;
  color: #fff;
  background:
    radial-gradient(480px 280px at 85% 12%, rgba(125,211,252,0.28), transparent 60%),
    radial-gradient(380px 380px at 8% 92%, rgba(29,78,216,0.55), transparent 65%),
    linear-gradient(155deg, #0a1a3a 0%, #1e40af 100%);
  position: relative;
  overflow: hidden;
}
/* Faint dot texture over the brand panel for depth. */
.login-brand::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.13) 1px, transparent 1.5px);
  background-size: 22px 22px;
  pointer-events: none;
}
.login-brand > * { position: relative; }
.login-mark {
  width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(135deg, #60a5fa 0%, #1d4ed8 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
  margin-bottom: 22px;
}
.login-logo { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 14px; }
.login-logo span { color: #93c5fd; }
.login-tagline { font-size: 24px; font-weight: 700; line-height: 1.28; margin: 0 0 26px; letter-spacing: -0.4px; }
.login-points { list-style: none; margin: 0 0 30px; padding: 0; }
.login-points li { padding: 9px 0; font-size: 16px; color: rgba(255,255,255,0.93); }
.login-points li::before { content: "✓ "; color: #7dd3fc; font-weight: 800; }
.login-trial { margin: 0; font-size: 14px; color: rgba(255,255,255,0.78); font-weight: 600; }
.login-shell .login-card {
  flex: 1;
  max-width: none;
  box-shadow: none;
  border-radius: 0;
  padding: 52px 48px;
}
/* Billion-dollar details: buttery buttons, responsive inputs. */
.btn.primary { transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(29,78,216,0.42); }
input:hover, select:hover, textarea:hover { border-color: #aebdd4; }
.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.28);
}
.login-card h1 { margin: 0 0 4px; color: var(--brand); letter-spacing: -0.5px; font-size: 32px; }
.login-card .muted { margin: 0 0 20px; }
/* Phone: brand panel becomes a slim header, form gets the full card. */
@media (max-width: 720px) {
  .login-shell { flex-direction: column; max-width: 400px; border-radius: 16px; }
  .login-brand { padding: 28px 24px; }
  .login-tagline { font-size: 18px; margin-bottom: 0; }
  .login-points, .login-trial { display: none; }
}

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
/* Required-field marker: the forms mark required labels with * (see job form). */
.req { color: #b91c1c; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  font-size: 17px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.15);
}
textarea { resize: vertical; }
::placeholder { color: #6b7280; opacity: 1; } /* readable on all mobile browsers */

/* ---------- Buttons: big touch targets ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 17px;
  font-weight: 600;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(29,78,216,0.30); }
.btn.primary:active { background: var(--brand-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.big { width: 100%; font-size: 19px; min-height: 60px; margin-top: 12px; }
.btn.wide { width: 100%; margin: 12px 0; }
.btn.icon { min-width: 48px; min-height: 48px; padding: 8px; }
.btn.small { min-height: 48px; padding: 8px 14px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; } /* a disabled button never looks tappable */

/* ---------- App shell ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0c1f44 0%, #1e40af 100%);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 2px 10px rgba(12,31,68,0.25);
}
#brand { color: #fff; }
.user-badge {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

main { max-width: 560px; margin: 0 auto; padding: 16px 16px 110px; }
.tab h2 { margin: 4px 0 12px; font-size: 26px; letter-spacing: -0.3px; }
.tab h2::after {
  content: ""; display: block; width: 44px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), #60a5fa);
  margin-top: 8px;
}
.section-title { margin-top: 28px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(12,31,68,0.07);
}
.job-card .cust { font-size: 19px; font-weight: 700; }
.job-card .addr, .job-card .notes { color: var(--muted); margin: 4px 0; }
.job-card .job-actions, .job-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.job-card .job-actions .btn, .job-actions .btn { flex: 1; min-width: 120px; }
/* One-time highlight when we land on a freshly rebooked job card. */
.job-card.flash { animation: card-flash 1.5s ease-out; }
@keyframes card-flash {
  0% { box-shadow: 0 0 0 3px var(--brand); }
  100% { box-shadow: 0 2px 10px rgba(12,31,68,0.07); }
}
.status-pill {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 8px;
  background: var(--line);
  color: var(--ink);
}
.status-pill.in_progress { background: #fef3c7; color: #92400e; }
.status-pill.en_route { background: #dbeafe; color: #1e40af; }
.status-pill.done { background: #dcfce7; color: var(--ok); }
.status-pill.cancelled { background: #fee2e2; color: #b91c1c; }

/* Backdated clock-entry badge (owner/partner lists only). Amber = needs
   review, not an error. Inline, not a tap target — plain language. */
.review-flag {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 6px;
  background: #fef3c7;
  color: #92400e;
}

/* ---------- Status sections on Jobs tab ---------- */
.status-section h3 { margin: 20px 0 8px; font-size: 19px; }
.count { color: var(--muted); font-weight: 400; font-size: 15px; }
.empty-note { color: var(--muted); padding: 8px 0; }

/* ---------- Today ---------- */
.big-actions { margin: 16px 0; }
.snapshot h3 { margin: 0 0 8px; font-size: 17px; }
.snapshot-row { display: flex; gap: 16px; flex-wrap: wrap; }
.snapshot-row div { display: flex; flex-direction: column; }
.snapshot-row strong { font-size: 30px; }
.snapshot-row span { color: var(--muted); font-size: 15px; }

/* ---------- Calendar ---------- */
.calendar { padding: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-dow { font-size: 14px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.cal-day {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 15px;
}
.cal-day.other { color: #6b7280; }
.cal-day.today { background: var(--brand); color: #fff; font-weight: 700; }
.cal-day .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-top: 2px;
}
.cal-day.today .dot { background: #fff; }

/* ---------- Crew ---------- */
.crew-group { margin-bottom: 16px; }
.crew-group h3 { margin: 0 0 8px; font-size: 18px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: none; }
.person > div:first-child { min-width: 0; } /* long names wrap instead of squeezing the buttons */
.person .pname { font-weight: 700; font-size: 18px; }
.person .pphone { color: var(--muted); font-size: 15px; }
.person .row-actions { display: flex; gap: 8px; flex: none; }
.lead-tag {
  font-size: 13px; font-weight: 700;
  background: #dbeafe; color: var(--brand-dark);
  padding: 3px 8px; border-radius: 999px; margin-left: 8px;
  vertical-align: middle;
}
.truck-card .tname { font-size: 18px; font-weight: 700; }
.truck-card .tdetails { color: var(--muted); margin: 4px 0 0; }

/* ---------- Money ---------- */
.card h3 { margin: 0 0 8px; font-size: 18px; }
.expense-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
/* Long customer names shrink and wrap instead of shoving the amount
   off-screen on a 320px phone. */
.expense-top > span:first-child { min-width: 0; }
.expense-top .expense-amount { flex: none; }
.expense-amount { font-size: 20px; font-weight: 700; }
.expense-cat {
  font-size: 14px; font-weight: 700;
  background: var(--line); color: var(--ink);
  padding: 4px 10px; border-radius: 999px;
}
.truck-cost { font-size: 18px; }

/* ---------- On the clock ---------- */
.onclock-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0; border-top: 1px solid var(--line);
}
.onclock-row:first-of-type { border-top: none; }
.onclock-row > div:first-child { min-width: 0; } /* long crew names wrap instead of squeezing the button */
.onclock-row .btn { flex: none; }

/* ---------- Assign modal checkboxes ---------- */
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; }
.check-row input { width: 24px; height: 24px; min-height: 0; flex: none; }

/* ---------- More ---------- */
.more-list { padding: 0; margin-bottom: 16px; overflow: hidden; }
.more-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; min-height: 56px;
  padding: 14px 16px;
  background: none; border: none; border-top: 1px solid var(--line);
  font-size: 18px; font-weight: 600; color: var(--ink);
  cursor: pointer; text-align: left;
}
.more-row:first-child { border-top: none; }
.more-row .chev { color: var(--muted); }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tab-btn {
  flex: 1;
  min-width: 0; /* never push the tab bar past 320px */
  min-height: 60px;
  padding: 8px 2px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tab-btn.active { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
/* Crew tab bar labels shrink so they still fit on one line at 320px
   (11px semibold is the usual tab-label size); "Notifications" is renamed
   to "Alerts" in crew mode because 13 chars can't fit a 64px slot. */
body.crew-mode .tab-btn { font-size: 11px; padding-left: 0; padding-right: 0; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 20;
}
.modal-card {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%; max-width: 560px;
  max-height: 92dvh; overflow-y: auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
.modal-card h3 { margin: 0 0 8px; font-size: 22px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 90px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 999px;
  z-index: 30;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* ---------- Bigger screens ---------- */
@media (min-width: 640px) {
  .modal { align-items: center; padding: 24px; }
  .modal-card { border-radius: 16px; }
}

/* ---------- Desktop: fill the computer screen, not a phone column ---------- */
@media (min-width: 900px) {
  main { max-width: 1060px; padding: 24px 32px 110px; }
  .tab h2 { font-size: 30px; }
  /* Card lists flow into two columns */
  #today-jobs, #jobs-board, #crew-list, #truck-list, #quote-list, #invoice-list,
  #expense-list, #payroll-list, #notif-list, #customer-list, #tenant-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    align-items: start;
  }
  /* Today tab action buttons sit side by side */
  .big-actions { display: flex; gap: 12px; }
  .big-actions .btn { flex: 1; margin-top: 0; }
  /* Full-width buttons don't need the whole 1060px */
  .btn.big.wide { max-width: 560px; }
}

/* ---------- Phase 3 ---------- */
.pname { font-weight: 700; font-size: 18px; }
.status-pill.sent { background: #dbeafe; color: #1e40af; }
.status-pill.accepted, .status-pill.paid { background: #dcfce7; color: var(--ok); }
.status-pill.declined { background: #fee2e2; color: #b91c1c; }
.pay-toggle { display: flex; gap: 10px; margin: 12px 0; }
.pay-btn { flex: 1; }
.pay-btn.active { border-color: var(--brand); color: var(--brand); }
/* Payday week navigator: ‹ [Sep 21 – Sep 27 / This week] ›. The arrows are
   .btn.icon (48px) and the center label wraps, so it fits 320px screens. */
.pay-weeknav { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 4px; gap: 8px; }
.pay-weeknav .btn.icon { flex: none; }
.pay-week-center { text-align: center; min-width: 0; }
.pay-week-center strong { font-size: 19px; }
.pay-total { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 19px; }
.calc-total {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 22px; font-weight: 700;
  margin: 20px 0 4px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.cust-btn {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: none; border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(12,31,68,0.07);
  cursor: pointer; font-size: 17px; color: var(--ink);
  min-height: 48px;
}
.cust-btn .cname { font-weight: 700; font-size: 19px; }
.cust-btn:active { transform: scale(.99); }
/* ---------- Phase 4 ---------- */
/* Bell + unread badge in the header */
.topbar-right { display: flex; align-items: center; gap: 4px; }
.bell-btn {
  position: relative;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 12px;
  color: #fff; cursor: pointer;
}
.badge {
  position: absolute; top: 4px; right: 2px;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Giant clock button on the crew "My Day" home */
.btn.giant { width: 100%; min-height: 88px; font-size: 26px; margin: 12px 0; }
.myday-hi { margin: 0 0 4px; font-size: 26px; }
.myday-sub { text-align: center; color: var(--muted); margin: 4px 0 0; font-size: 16px; }
/* Phase 5: the track-link modal's Copy/Revoke row — two big tappable buttons. */
.track-actions { display: flex; gap: 10px; margin-top: 12px; }
.track-actions .btn { flex: 1; }

/* "Needs attention" card (owner/partner Today tab) */
.attention h3 { margin: 0 0 4px; font-size: 18px; }
.attn-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; min-height: 56px;
  padding: 12px 4px;
  background: none; border: none; border-top: 1px solid var(--line);
  font-size: 17px; font-weight: 600; color: var(--ink);
  cursor: pointer; text-align: left;
}
.attn-row:first-of-type { border-top: none; }
.attn-row .chev { color: var(--muted); flex: none; margin-left: 8px; }

/* Notifications list */
.notif-head { display: flex; justify-content: flex-end; margin-bottom: 12px; }
/* A <button>: reset UA button chrome (gray border, tiny Arial-ish text) so
   it looks like every other card — same pattern as .cust-btn. */
.notif-card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  background: var(--card); border: none;
}
.notif-card.unread { background: #eff6ff; border: 1.5px solid #bfdbfe; }
.notif-title { font-size: 18px; }
.notif-card.unread .notif-title { font-weight: 700; }
.notif-time { font-size: 14px; margin-top: 4px; }

/* "Add login" button on a crew card */
.login-add { margin-top: 8px; }

/* ---------- Phase 5: job photo proof ---------- */
/* Before/After/Other picker: three big tap targets, plain words. */
.photo-label-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.photo-label-btn { flex: 1; margin-top: 0; }
.photo-label-btn.selected { border-color: var(--brand); background: #eff6ff; font-weight: 700; }
/* The "Take photo" label wraps the hidden file input and looks like a button. */
.file-btn { display: block; text-align: center; cursor: pointer; }
.photo-h { margin: 18px 0 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.photo-thumb { margin: 0; min-width: 0; }
.photo-thumb img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; display: block; cursor: pointer;
  background: var(--bg);
}
.photo-thumb figcaption { margin-top: 6px; }
.label-pill {
  display: inline-block; font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 4px;
}
.label-pill.before { background: #dbeafe; color: #1e40af; }
.label-pill.after { background: #dcfce7; color: #166534; }
.label-pill.other { background: var(--bg); color: var(--muted); }
.photo-meta { font-size: 13px; }
/* Full-size viewer: dark overlay above everything (incl. the modal). */
.photo-lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .93);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 16px; gap: 12px;
}
.photo-lightbox img { max-width: 100%; max-height: 72vh; border-radius: 8px; }
.photo-lightbox-bar { display: flex; align-items: center; gap: 16px; color: #fff; font-size: 17px; }
.photo-lightbox-bar .btn { margin-top: 0; min-width: 120px; }

/* ---------- Phase 5: offline mode ---------- */
/* The banner sits above the topbar on every tab. Amber = attention, not
 * alarm: being offline is normal in a basement, and the queued count is the
 * point. All buttons keep the 48px touch target. */
.offline-banner {
  background: #fff7e6;
  border-bottom: 2px solid #d97706;
  padding: 10px 14px;
  font-size: 15px;
  overflow-wrap: break-word;
}
.offline-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#offline-banner-text { flex: 1; min-width: 0; }
.offline-banner-btns { display: flex; gap: 8px; flex-shrink: 0; }
.offline-queue-panel {
  margin-top: 10px;
  border-top: 1px solid #e9c886;
  padding-top: 4px;
}
.q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0e2c8;
  overflow-wrap: break-word;
}
.q-row:last-child { border-bottom: none; }
.q-main { flex: 1; min-width: 0; }
.q-actions { display: flex; gap: 8px; flex-shrink: 0; }
.q-failed { color: var(--danger); font-weight: 600; }
/* Conflict review card: both versions side by side, two big stacked buttons —
   one tap each, plain language (Brian's simplicity rule). */
.q-conflict { align-items: flex-start; background: #fff8ec; border-radius: 10px; padding: 10px; }
.q-conflict-head { font-weight: 700; margin: 4px 0 6px; }
.q-diff { margin: 4px 0; }
.q-tag { font-weight: 700; }
.q-actions-col { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.q-actions-col .btn { min-height: 48px; padding: 12px 16px; }
/* Narrow phone: the side-by-side conflict card squeezes the text comparison
   down to ~60px. Stack it — full-width text on top, full-width one-tap
   buttons below — so both versions stay readable. */
@media (max-width: 480px) {
  .q-conflict { flex-direction: column; align-items: stretch; }
  .q-actions-col { width: 100%; }
  .q-actions-col .btn { width: 100%; }
}

/* ---------- Truck profit & loss (owner/partner only) ---------- */
.profit-totals .profit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0e2c8;
  font-size: 18px;
  overflow-wrap: break-word;
}
.profit-totals .profit-row:last-of-type { border-bottom: none; }
.profit-totals .profit-net { font-size: 24px; font-weight: 800; }
.pos { color: var(--ok); font-weight: 700; }    /* profit / positive — green */
.neg { color: var(--danger); font-weight: 700; } /* loss — red */
.profit-dates { display: flex; gap: 12px; margin: 8px 0 4px; }
.profit-dates > div { flex: 1; min-width: 0; }
.profit-dates input[type="date"] { width: 100%; min-height: 48px; }
.profit-job-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.profit-job-top .pname { min-width: 0; overflow-wrap: break-word; }
.profit-job-top strong { flex: none; font-size: 18px; }

/* Platform-owner Tenants admin screen (minimal, plain). */
.tenant-row { margin-bottom: 12px; }
.tenant-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill-green { background: #dcfce7; color: var(--ok); }
.pill-red { background: #fee2e2; color: var(--danger); }
.small { font-size: 13px; }
.tenant-toggle { margin-top: 10px; }

/* ---------- Billion-dollar interior (2026-09-27) ----------
   Purely visual: depth, hierarchy, and polish. No markup or JS changes,
   so nothing functional is touched. */

/* Cards: layered depth, softer corners */
.card {
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(12,31,68,0.05), 0 10px 28px rgba(12,31,68,0.08);
  border-color: #e7eaf0;
}

/* "At a glance" snapshot: real stat tiles */
.snapshot { padding: 18px; }
.snapshot h3 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.snapshot-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.snapshot-row div {
  background: linear-gradient(180deg, #f0f5ff 0%, #e8efff 100%);
  border: 1px solid #dbe6ff;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  align-items: center;
  gap: 2px;
}
.snapshot-row strong { font-size: 30px; color: var(--navy); line-height: 1.1; }
.snapshot-row span { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Job cards: stronger titles, calmer meta */
.job-card .cust { font-size: 20px; letter-spacing: -0.2px; }
.job-card .addr { font-size: 15px; }

/* Section headers: quiet eyebrow style with pill counts */
.status-section h3, .section-title {
  font-size: 15px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted);
}
.count {
  background: #eef2f7; border-radius: 999px; padding: 2px 10px;
  font-size: 13px; font-weight: 700; color: var(--muted);
}

/* Empty states: dashed placeholder cards instead of bare text */
.empty-note {
  border: 2px dashed #d5dbe5; border-radius: 12px;
  padding: 20px; text-align: center; background: rgba(255,255,255,0.6);
}

/* Top bar: hairline highlight for a finished feel */
.topbar {
  border-bottom: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 18px rgba(12,31,68,0.28);
}
#brand { font-weight: 800; letter-spacing: -0.3px; }

/* Bottom tab bar: frosted glass, soft active pill */
.tabbar {
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid #e7eaf0;
  box-shadow: 0 -6px 20px rgba(12,31,68,0.06);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab-btn { border-radius: 12px; margin: 0 2px; min-height: 56px; font-size: 15px; }
.tab-btn.active {
  color: var(--brand); box-shadow: none;
  background: rgba(29,78,216,0.1);
}

/* Buttons: richer primary, crisper secondary */
.btn.primary {
  background: linear-gradient(180deg, #2563eb 0%, var(--brand) 100%);
  box-shadow: 0 4px 14px rgba(29,78,216,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  border-color: #1a46c0;
}
.btn:not(.primary):not(.danger) { border-color: #d5dbe5; box-shadow: 0 1px 3px rgba(12,31,68,0.06); }

/* More / attention rows: brand chevrons, calm hover */
.more-row .chev, .attn-row .chev { color: var(--brand); font-weight: 800; }

/* Modal: softer, deeper */
.modal-card { box-shadow: 0 24px 70px rgba(12,31,68,0.3); border: none; }

/* Desktop: hover lift on cards, button lift */
@media (min-width: 900px) {
  .card { transition: transform .18s ease, box-shadow .18s ease; }
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(12,31,68,0.05), 0 16px 36px rgba(12,31,68,0.12);
  }
  .btn.primary:hover { filter: brightness(1.06); }
  .more-row:hover, .attn-row:hover { background: #f6f8fc; }
  .tab-btn:hover { color: var(--brand); }
}

/* ---------- Narrow phones (<=380px): keep 5 tabs + stat tiles on one row ---------- */
@media (max-width: 380px) {
  .tab-btn { font-size: 13px; }
  .snapshot-row { gap: 8px; }
  .snapshot-row div { padding: 10px 4px; }
  .snapshot-row strong { font-size: 24px; }
  .snapshot-row span { font-size: 12px; }
  main { padding: 12px 12px 110px; }
  .job-card .cust { font-size: 18px; }
}
