/* OneManVanFSM Field PWA — Zoho FSM–leaning mobile shell */
:root {
  --zf-primary: #1a56db;
  --zf-primary-dark: #1444b0;
  --zf-primary-soft: #e8f0fe;
  --zf-accent: #0e9f6e;
  --zf-warn: #c27803;
  --zf-danger: #e02424;
  --zf-text: #1f2a37;
  --zf-muted: #4b5563;
  --zf-border: #e5e7eb;
  --zf-surface: #ffffff;
  --zf-bg: #f0f4fa;
  --zf-nav-h: 64px;
  --zf-header-h: 4rem;
  --zf-safe-top: env(safe-area-inset-top, 0px);
  --zf-safe-bottom: env(safe-area-inset-bottom, 0px);
  --zf-radius: 12px;
  --zf-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --zf-shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.1);
  --zf-touch: 48px;
}

body.field-pwa-active,
body.office-pwa-active {
  background: var(--zf-bg) !important;
  overflow-x: hidden;
}

/* Hide desktop chrome when Field or Office mobile shell is active */
body.field-pwa-active .sidebar,
body.field-pwa-active .app-sidebar,
body.field-pwa-active .sidebar-backdrop,
body.field-pwa-active .app-topbar,
body.field-pwa-active .main-header,
body.field-pwa-active .top-header,
body.field-pwa-active .top-row,
body.field-pwa-active .page > .sidebar,
body.field-pwa-active aside.sidebar,
body.field-pwa-active .main-layout > aside,
body.field-pwa-active .layout-with-nav > .nav-panel,
body.field-pwa-active .desktop-only,
body.field-pwa-active header.header-bar,
body.field-pwa-active .navbar-desktop,
body.office-pwa-active .sidebar,
body.office-pwa-active .app-sidebar,
body.office-pwa-active .sidebar-backdrop,
body.office-pwa-active .app-topbar,
body.office-pwa-active .main-header,
body.office-pwa-active .top-header,
body.office-pwa-active .top-row,
body.office-pwa-active .page > .sidebar,
body.office-pwa-active aside.sidebar,
body.office-pwa-active .main-layout > aside,
body.office-pwa-active .layout-with-nav > .nav-panel,
body.office-pwa-active .desktop-only,
body.office-pwa-active header.header-bar,
body.office-pwa-active .navbar-desktop {
  display: none !important;
}

body.field-pwa-active .page,
body.field-pwa-active .main,
body.field-pwa-active .content,
body.field-pwa-active main,
body.field-pwa-active .main-content,
body.field-pwa-active .page-content,
body.office-pwa-active .page,
body.office-pwa-active .main,
body.office-pwa-active .content,
body.office-pwa-active main,
body.office-pwa-active .main-content,
body.office-pwa-active .page-content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

.field-pwa-root {
  min-height: 100dvh;
  background: var(--zf-bg);
  color: var(--zf-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--zf-nav-h) + var(--zf-safe-bottom) + 8px);
}

.field-pwa-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: calc(6px + var(--zf-safe-top)) 12px 0;
  background: var(--zf-bg);
}

.field-pwa-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--zf-border);
  background: #fff;
  color: var(--zf-muted);
  text-decoration: none;
}

.field-pwa-status-chip.is-online {
  color: var(--zf-accent);
  border-color: rgba(14, 159, 110, 0.28);
  background: rgba(14, 159, 110, 0.08);
}

.field-pwa-status-chip.is-offline {
  color: var(--zf-danger);
  border-color: rgba(224, 36, 36, 0.28);
  background: rgba(224, 36, 36, 0.08);
}

.field-pwa-status-chip.is-pending {
  color: #9a6700;
  border-color: rgba(194, 120, 3, 0.35);
  background: rgba(255, 236, 179, 0.45);
}

.field-pwa-status-chip.is-muted {
  color: var(--zf-muted);
}

.field-bottom-nav a {
  position: relative;
}

.field-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c27803;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.field-route-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: var(--zf-radius);
  border: 1px solid rgba(26, 86, 219, 0.18);
  background: linear-gradient(135deg, #e8f0fe, #f8fafc);
}

.field-route-bar .kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zf-primary);
  margin-bottom: 2px;
}

.field-route-bar .title {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--zf-text);
}

.field-route-bar .next {
  font-size: 0.78rem;
  color: var(--zf-muted);
  margin-top: 2px;
}

.field-route-bar .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.field-closeout {
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--zf-shadow);
}

.field-closeout-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.field-closeout-score {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--zf-primary-soft);
  color: var(--zf-primary-dark);
}

.field-closeout-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
  font-size: 0.86rem;
}

.field-closeout-item .meta {
  color: var(--zf-muted);
  font-size: 0.75rem;
}

.field-closeout-item.is-done {
  color: var(--zf-accent);
}

.field-closeout-item.is-required:not(.is-done) {
  color: #9a3412;
}

.field-closeout-item .copy {
  flex: 1;
  min-width: 0;
}

/* Card follows theme; signature ink needs a paper-white surface regardless of theme */
.field-sig-wrap {
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 12px;
  margin-bottom: 12px;
}

.field-sig-canvas {
  width: 100%;
  height: 160px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #fff;
  touch-action: none;
}

.field-sig-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.field-pwa-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--zf-surface);
  border-bottom: 1px solid var(--zf-border);
  /* Notch inset lives on the status bar above this header. */
  padding: 8px 12px;
  min-height: var(--zf-header-h, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-pwa-header h1 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.field-pwa-header .sub {
  font-size: 0.75rem;
  color: var(--zf-muted);
  margin: 0;
}

.field-pwa-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-icon-btn {
  width: var(--zf-touch);
  height: var(--zf-touch);
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--zf-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  text-decoration: none;
  cursor: pointer;
}

.field-icon-btn:hover,
.field-icon-btn:focus {
  background: var(--zf-primary-soft);
  color: var(--zf-primary);
}

.field-pwa-body {
  padding: 10px 12px 20px;
  max-width: 640px;
  margin: 0 auto;
}

.pwa-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pwa-cal-nav {
  display: inline-flex;
  border: 1px solid var(--zf-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--zf-surface);
}
.pwa-cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--zf-border);
  background: transparent;
  min-height: 36px;
  min-width: 40px;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--zf-text);
  cursor: pointer;
}
.pwa-cal-nav-btn:last-child { border-right: 0; }
.pwa-cal-nav-btn.is-current {
  background: var(--zf-primary-soft);
  color: var(--zf-primary);
}
.pwa-cal-nav-label { display: none; }
@media (min-width: 640px) {
  .pwa-cal-nav-label { display: inline; }
}

.field-day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.field-day-strip::-webkit-scrollbar { display: none; }

.field-day-chip {
  flex: 0 0 auto;
  min-width: 56px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--zf-border);
  background: var(--zf-surface);
  text-align: center;
  cursor: pointer;
  user-select: none;
}
.field-day-chip .dow {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--zf-muted);
  letter-spacing: 0.04em;
}
.field-day-chip .dom {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}
.field-day-chip.active {
  background: var(--zf-primary);
  border-color: var(--zf-primary);
  color: #fff;
}
.field-day-chip.active .dow { color: rgba(255,255,255,0.85); }

.pwa-month {
  margin: 4px 0 14px;
}
.pwa-month-dows,
.pwa-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.pwa-month-dow {
  text-align: center;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--zf-muted);
  letter-spacing: 0.04em;
  padding: 2px 0 6px;
}
.pwa-month-cell {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--zf-border);
  background: var(--zf-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  color: inherit;
  cursor: pointer;
}
.pwa-month-cell .dom {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.1;
}
.pwa-month-cell .count {
  font-size: 0.6rem;
  background: var(--zf-primary);
  color: #fff;
  border-radius: 999px;
  min-width: 1.1rem;
  padding: 0 4px;
  line-height: 1.2;
}
.pwa-month-cell.outside { opacity: 0.45; }
.pwa-month-cell.today { border-color: var(--zf-primary); }
.pwa-month-cell.selected {
  background: var(--zf-primary);
  border-color: var(--zf-primary);
  color: #fff;
}
.pwa-month-cell.selected .count {
  background: #fff;
  color: var(--zf-primary);
}

.field-summary-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.field-summary-pill {
  flex: 1;
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 10px 12px;
  box-shadow: var(--zf-shadow);
}
.field-summary-pill .label {
  font-size: 0.7rem;
  color: var(--zf-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field-summary-pill .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--zf-primary);
  line-height: 1.2;
}

.field-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--zf-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 12px 0 6px;
}

.field-appt-card {
  display: block;
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--zf-shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.field-appt-card:hover,
.field-appt-card:focus {
  border-color: #b6c8f5;
  box-shadow: var(--zf-shadow-lg);
  color: inherit;
}
.field-appt-card .row1 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.field-appt-card .time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--zf-primary);
}
.field-appt-card .title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
}
.field-appt-card .meta {
  font-size: 0.82rem;
  color: var(--zf-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.field-appt-card .meta i { margin-right: 3px; }

.field-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.field-status.scheduled { background: #e8f0fe; color: var(--zf-primary); }
.field-status.enroute { background: #fef3c7; color: #92400e; }
.field-status.onsite,
.field-status.inprogress { background: #d1fae5; color: #065f46; }
.field-status.completed { background: #e5e7eb; color: #374151; }
.field-status.other { background: #f3f4f6; color: #4b5563; }

.field-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--zf-muted);
}
.field-empty i {
  font-size: 2.5rem;
  color: #c5d0e0;
  display: block;
  margin-bottom: 10px;
}

.field-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(var(--zf-nav-h) + var(--zf-safe-bottom));
  padding-bottom: var(--zf-safe-bottom);
  background: var(--zf-surface);
  border-top: 1px solid var(--zf-border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
}
.field-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--zf-muted);
  font-size: 0.65rem;
  font-weight: 500;
  min-height: var(--zf-nav-h);
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.field-bottom-nav a i { font-size: 1.25rem; line-height: 1; }
.field-bottom-nav a.active { color: var(--zf-primary); }
.field-bottom-nav a.create-fab .fab-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--zf-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.35);
  margin-top: -18px;
}
.field-bottom-nav a.create-fab span.label {
  margin-top: 2px;
  color: var(--zf-primary);
  font-weight: 600;
}

.field-job-hero {
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 16px;
  box-shadow: var(--zf-shadow);
  margin-bottom: 12px;
}
.field-job-hero .job-num {
  font-size: 0.75rem;
  color: var(--zf-muted);
  font-weight: 600;
}
.field-job-hero h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 4px 0 8px;
}

.field-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}
.field-action-grid.field-job-primary {
  grid-template-columns: repeat(4, 1fr);
}
/* Tall tiles (Field job board) — 3 per row keeps groups together and cuts
   the vertical space a 2-column layout wasted around short labels. */
.field-action-grid .field-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  border-radius: 10px;
  border: 1px solid var(--zf-border);
  background: var(--zf-surface);
  color: var(--zf-text);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 4px;
}
/* Odd 10th button (Pay/Invoice) spans the full row instead of leaving two empty cells */
.field-action-grid .field-action-btn.span-row {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 40px;
}
/* Low-frequency actions live behind this toggle; keep it visually quieter */
.field-action-grid .field-action-more-toggle {
  min-height: 34px;
  border-style: dashed;
  color: var(--zf-muted);
  font-weight: 500;
}
/* Compact inline related-links row (replaces stacked full-width link paragraphs) */
.field-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 0.82rem;
}
.field-link-row a {
  padding: 4px 0;
}
.field-action-grid .field-action-btn i {
  font-size: 1.2rem;
  color: var(--zf-primary);
}
.field-action-grid .field-action-btn:hover {
  background: var(--zf-primary-soft);
  color: var(--zf-text);
}

/* Compact horizontal action chips on detail pages (invoice, customer, site, …) */
.field-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.field-action-row .field-action-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 4.75rem;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--zf-border);
  background: var(--zf-surface);
  color: var(--zf-text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
}
.field-action-row .field-action-btn i {
  font-size: 1rem;
  color: var(--zf-primary);
  line-height: 1;
}
.field-action-row .field-action-btn:hover,
.field-action-row .field-action-btn:focus-visible {
  background: var(--zf-primary-soft);
  color: var(--zf-text);
}
/* Fallback if a bare .field-action-btn appears outside grid/row */
.field-action-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--zf-border);
  background: var(--zf-surface);
  color: var(--zf-text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 10px;
}
.field-action-btn i {
  font-size: 1rem;
  color: var(--zf-primary);
}
.field-action-btn:hover {
  background: var(--zf-primary-soft);
  color: var(--zf-text);
}

.field-primary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--zf-touch);
  border: none;
  border-radius: 10px;
  background: var(--zf-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
  cursor: pointer;
}
.field-primary-cta:disabled { opacity: 0.6; }
.field-primary-cta.secondary {
  background: var(--zf-surface);
  color: var(--zf-primary);
  border: 1.5px solid var(--zf-primary);
  box-shadow: none;
}
.field-primary-cta.success {
  background: var(--zf-accent);
  box-shadow: 0 4px 12px rgba(14, 159, 110, 0.3);
}
.field-primary-cta.warn {
  background: var(--zf-warn);
  box-shadow: 0 4px 12px rgba(194, 120, 3, 0.3);
}

.field-info-block {
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 12px;
  margin-bottom: 8px;
}
.field-info-block h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zf-muted);
  margin: 0 0 8px;
  font-weight: 600;
}
.field-info-block p {
  margin: 0 0 6px;
  font-size: 0.9rem;
  /* U3: never inherit uppercase from section labels onto body content */
  text-transform: none;
  letter-spacing: normal;
}

/* U3: addresses / free text in hero stay sentence case */
.field-job-hero .small,
.field-job-hero p,
.field-info-block .mb-0 {
  text-transform: none;
  letter-spacing: normal;
}

.field-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 60;
  border: none;
  padding: 0;
  cursor: pointer;
}
.field-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  background: var(--zf-surface);
  border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(20px + var(--zf-safe-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  max-height: 80dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  --omv-sheet-y: 0px;
  transform: translateY(var(--omv-sheet-y));
  touch-action: pan-y;
}
.field-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}
.field-sheet-head h2 {
  margin: 0;
}
.field-sheet-close {
  border: 0;
  background: transparent;
  color: var(--zf-muted);
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
}
.field-sheet-handle {
  width: 48px;
  height: 5px;
  background: #d1d5db;
  border-radius: 3px;
  margin: 4px auto 10px;
  padding: 10px 40px;
  box-sizing: content-box;
  background-clip: content-box;
  cursor: grab;
  touch-action: none;
}
.field-sheet h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 12px;
}
.field-create-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--zf-border);
  text-decoration: none;
  color: var(--zf-text);
  font-weight: 500;
  min-height: var(--zf-touch);
}
.field-create-list a i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--zf-primary-soft);
  color: var(--zf-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.field-create-list a:last-child { border-bottom: none; }

.field-install-banner {
  background: var(--zf-primary-soft);
  border: 1px solid #c5d7fb;
  border-radius: var(--zf-radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
}
.field-install-banner button {
  border: none;
  background: var(--zf-primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}
.field-install-banner .field-install-dismiss {
  background: transparent;
  color: var(--zf-primary-dark, #1a3a7a);
  border: 1px solid rgba(26, 86, 219, 0.35);
  font-weight: 500;
}

.field-search {
  width: 100%;
  border: 1px solid var(--zf-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  margin-bottom: 12px;
  background: var(--zf-surface);
}

.field-more-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--zf-text);
  font-weight: 500;
  box-shadow: var(--zf-shadow);
}
.field-more-list a i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--zf-primary-soft);
  color: var(--zf-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.field-more-list a .chev {
  margin-left: auto;
  color: var(--zf-muted);
}

@media (min-width: 768px) {
  .field-pwa-root,
  .office-pwa-root {
    max-width: 720px;
    margin: 0 auto;
    border-left: 1px solid var(--zf-border);
    border-right: 1px solid var(--zf-border);
    box-shadow: var(--zf-shadow-lg);
    min-height: 100dvh;
  }
  .field-bottom-nav {
    max-width: 720px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--zf-border);
    border-right: 1px solid var(--zf-border);
  }
  .field-sheet {
    max-width: 720px;
    left: 50%;
    transform: translateX(-50%) translateY(var(--omv-sheet-y));
  }
  .field-pwa-body {
    max-width: 720px;
  }
  .office-action-grid,
  .field-action-grid:not(.field-job-primary) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet / desktop landscape: use more horizontal space (matrix #19) */
@media (min-width: 900px) and (orientation: landscape) {
  .field-pwa-root,
  .office-pwa-root {
    max-width: min(960px, 100%);
  }
  .field-bottom-nav {
    max-width: min(960px, 100%);
  }
  .field-sheet {
    max-width: min(720px, 92vw);
  }
  .field-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .office-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .office-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .field-day-strip {
    justify-content: flex-start;
  }
  .field-job-hero .meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.25rem 1rem;
  }
}

/* MainLayout-specific hide for field mode */
body.field-pwa-active .app-layout > .app-sidebar,
body.field-pwa-active .app-layout .sidebar-backdrop,
body.field-pwa-active .app-main > .app-header,
body.field-pwa-active .app-main > header,
body.field-pwa-active .app-header,
body.field-pwa-active .content-header,
body.office-pwa-active .app-layout > .app-sidebar,
body.office-pwa-active .app-layout .sidebar-backdrop,
body.office-pwa-active .app-main > .app-header,
body.office-pwa-active .app-main > header,
body.office-pwa-active .app-header,
body.office-pwa-active .content-header {
  display: none !important;
}
body.field-pwa-active .app-main,
body.field-pwa-active .app-content,
body.field-pwa-active .main-content-area,
body.office-pwa-active .app-main,
body.office-pwa-active .app-content,
body.office-pwa-active .main-content-area {
  margin-left: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

/* Photo grid on job detail */
.field-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.field-photo-thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--zf-border);
  background: #f3f4f6;
}
.field-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.field-photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--zf-muted);
  font-size: 1.4rem;
}

.field-clock-banner {
  background: linear-gradient(135deg, #1a56db 0%, #3b82f6 100%);
  color: #fff;
  border-radius: var(--zf-radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.field-clock-banner .small { opacity: 0.92; font-size: 0.75rem; }
.field-clock-banner a { color: #fff; }
.field-clock-banner .btn-light {
  font-weight: 600;
  font-size: 0.78rem;
  color: #123a97;
  border-color: rgba(255, 255, 255, 0.95);
}
.field-clock-banner .btn-outline-light {
  font-weight: 600;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
  box-shadow: none;
}
.field-clock-banner .btn-outline-light:hover,
.field-clock-banner .btn-outline-light:focus-visible {
  background: rgba(255, 255, 255, 0.95);
  border-color: #ffffff;
  color: #123a97;
}
.field-clock-banner .btn-light:disabled,
.field-clock-banner .btn-outline-light:disabled {
  opacity: 1;
  cursor: not-allowed;
}
.field-clock-banner .btn-light:disabled {
  background: rgba(255, 255, 255, 0.92);
  color: #4b5563;
  border-color: rgba(255, 255, 255, 0.85);
}
.field-clock-banner .btn-outline-light:disabled {
  background: rgba(255, 255, 255, 0.94);
  color: #4b5563;
  border-color: rgba(255, 255, 255, 0.88);
}

html:not(.pwa-dark) .field-pwa-root .small.text-muted,
html:not(.pwa-dark) .office-pwa-root .small.text-muted,
html:not(.pwa-dark) .field-pwa-root .text-muted,
html:not(.pwa-dark) .office-pwa-root .text-muted {
  color: #4b5563 !important;
}

html:not(.pwa-dark) .field-pwa-root .btn-outline-secondary,
html:not(.pwa-dark) .office-pwa-root .btn-outline-secondary {
  color: #1f2a37;
  border-color: #a8b5c8;
  background: #ffffff;
}

html:not(.pwa-dark) .field-pwa-root .btn-outline-secondary:hover,
html:not(.pwa-dark) .field-pwa-root .btn-outline-secondary:focus-visible,
html:not(.pwa-dark) .office-pwa-root .btn-outline-secondary:hover,
html:not(.pwa-dark) .office-pwa-root .btn-outline-secondary:focus-visible {
  color: #123a97;
  border-color: #7f95b6;
  background: #eef3fb;
}

/* Job checklist (field job sheets) */
.field-checklist-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.field-checklist-progress-bar {
  height: 100%;
  background: var(--zf-primary);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.field-checklist-section {
  margin-bottom: 12px;
}
.field-checklist-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zf-muted);
  margin-bottom: 6px;
}
.field-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--zf-border);
  min-height: var(--zf-touch);
  margin: 0;
  cursor: pointer;
  font-size: 0.92rem;
}
.field-check-item input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--zf-primary);
}
.field-check-item span.done {
  text-decoration: line-through;
  color: var(--zf-muted);
}
.field-checklist-block .field-create-list a {
  border: 1px solid var(--zf-border);
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 12px;
}

/* Estimate present mode */
.field-present-hero {
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 18px 16px;
  box-shadow: var(--zf-shadow);
  margin-bottom: 14px;
  text-align: center;
}
.field-present-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--zf-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field-present-hero h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 6px 0 8px;
  line-height: 1.25;
}
.field-present-customer {
  font-size: 1.05rem;
  font-weight: 600;
}
.field-present-site {
  font-size: 0.85rem;
  color: var(--zf-muted);
  margin-top: 2px;
}
.field-present-status { margin-top: 10px; }

.field-option-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--zf-surface);
  border: 1.5px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--zf-shadow);
  cursor: pointer;
}
.field-option-card.selected {
  border-color: var(--zf-primary);
  background: var(--zf-primary-soft);
}
.field-option-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--zf-primary);
}

.field-present-lines {
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.field-present-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--zf-border);
}
.field-present-line:last-child { border-bottom: none; }
.field-present-line .line-total {
  font-weight: 600;
  white-space: nowrap;
}

.field-present-total-card {
  background: var(--zf-primary);
  color: #fff;
  border-radius: var(--zf-radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.28);
}
.field-present-grand {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.25);
}
.field-present-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

/* Reconnect modal field offline shell */
#components-reconnect-modal.field-offline-active .components-rejoining-animation,
#components-reconnect-modal.field-offline-active .components-reconnect-first-attempt-visible,
#components-reconnect-modal.field-offline-active .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.field-offline-active .components-reconnect-failed-visible,
#components-reconnect-modal.field-offline-active .components-pause-visible,
#components-reconnect-modal.field-offline-active .components-resume-failed-visible,
#components-reconnect-modal.field-offline-active #components-reconnect-button,
#components-reconnect-modal.field-offline-active #components-resume-button {
  display: none !important;
}
.field-offline-shell {
  text-align: center;
  padding: 8px 4px 4px;
  max-width: 320px;
  margin: 0 auto;
}
.field-offline-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 8px; }
.field-offline-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1f2a37;
}
.field-offline-copy {
  font-size: 0.88rem;
  color: #6b7280;
  margin: 0 0 14px;
  line-height: 1.4;
}
.field-offline-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.field-offline-stats div {
  background: #f0f4fa;
  border-radius: 10px;
  padding: 10px 8px;
}
.field-offline-stats strong {
  display: block;
  font-size: 1.35rem;
  color: #1a56db;
  line-height: 1.2;
}
.field-offline-stats span {
  font-size: 0.7rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field-offline-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  background: #1a56db;
  color: #fff !important;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  cursor: pointer;
}
.field-offline-btn.secondary {
  background: var(--zf-surface);
  color: #1a56db !important;
  border: 1.5px solid #1a56db;
}
.field-offline-link {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}

/* Signature pad */
.field-sig-wrap {
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  padding: 12px;
  margin-bottom: 12px;
}
.field-sig-wrap h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zf-muted);
  margin: 0 0 8px;
  font-weight: 600;
}
.field-sig-canvas {
  width: 100%;
  height: 160px;
  border: 1.5px dashed #c5d0e0;
  border-radius: 10px;
  background: #fafbfc;
  touch-action: none;
  display: block;
}
.field-sig-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.field-sig-actions button {
  border: 1px solid var(--zf-border);
  background: var(--zf-surface);
  color: var(--zf-text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Jump targets for Field job action buttons (fixed header clearance) */
#field-job-checklist,
#field-job-signature,
#field-job-equipment,
#field-job-materials,
#field-job-payment {
  scroll-margin-top: 4.5rem;
}

/* Nested list window — pickers/sheets only. Do NOT use on full-page entity lists
   (creates a second scroll surface and clips the roster). Prefer .pwa-list. */
.mobile-list-window {
  max-height: min(60dvh, 28rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  margin-bottom: 0.5rem;
}
.mobile-list-window .field-appt-card {
  margin-bottom: 0.5rem;
}

/* ── Compact entity list (customers, assets, CRM catalogs) ── */
/* Single-page scroll; denser than appointment cards for long rosters */
.pwa-list {
  display: flex;
  flex-direction: column;
  margin: 0 0 0.75rem;
  background: var(--zf-surface);
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  overflow: hidden;
  box-shadow: var(--zf-shadow);
}
/* `a` rows (default) or `div` rows when a trail action (e.g. stock Adj) is needed */
a.pwa-list-row,
.pwa-list > .pwa-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  min-height: 52px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--zf-border);
  background: transparent;
  transition: background 0.12s ease;
}
a.pwa-list-row:last-child,
.pwa-list > .pwa-list-row:last-child {
  border-bottom: none;
}
a.pwa-list-row:hover,
a.pwa-list-row:focus,
.pwa-list > .pwa-list-row:hover {
  background: var(--zf-primary-soft);
  color: inherit;
}
a.pwa-list-row:active {
  background: color-mix(in srgb, var(--zf-primary-soft) 80%, var(--zf-border));
}
.pwa-list > .pwa-list-row > a.pwa-list-main {
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.pwa-list-main {
  flex: 1;
  min-width: 0;
}
.pwa-list-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-list-meta {
  font-size: 0.78rem;
  color: var(--zf-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.pwa-list-meta .sep::before {
  content: " · ";
  opacity: 0.7;
}
.pwa-list-trail {
  flex-shrink: 0;
  text-align: right;
  max-width: 38%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.pwa-list-trail .amount {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--zf-warn);
  white-space: nowrap;
}
.pwa-list-trail .hint {
  font-size: 0.72rem;
  color: var(--zf-muted);
  white-space: nowrap;
}
.pwa-list-chev {
  flex-shrink: 0;
  color: var(--zf-muted);
  font-size: 0.8rem;
  opacity: 0.55;
  margin-left: 2px;
}
.pwa-list-count {
  font-size: 0.78rem;
  color: var(--zf-muted);
  margin: 0 0 8px;
}
/* Soft footer links under lists (replaces heavy “Also” blocks when desired) */
.pwa-also {
  margin: 0.25rem 0 1rem;
  border: 1px solid var(--zf-border);
  border-radius: var(--zf-radius);
  background: var(--zf-surface);
  overflow: hidden;
}
.pwa-also > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--zf-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}
.pwa-also > summary::-webkit-details-marker { display: none; }
.pwa-also > summary::after {
  content: "▾";
  float: right;
  opacity: 0.6;
}
.pwa-also[open] > summary::after { content: "▴"; }
.pwa-also .field-more-list {
  border-top: 1px solid var(--zf-border);
  margin: 0;
}
.pwa-list-loadmore {
  margin: 0 0 0.75rem;
}

/* Long Office forms: Identity / Pricing / Specs / Stock */
.pwa-form-section {
  border-bottom: 1px solid var(--zf-border);
  margin: 0 -12px;
  padding: 0 12px;
}
.pwa-form-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 8px;
}
.pwa-form-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% + 24px);
  margin: 0 -12px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--zf-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  min-height: 44px;
}
.pwa-form-section-summary::after {
  content: "▾";
  opacity: 0.6;
  font-size: 0.85rem;
}
.pwa-form-section.is-open > .pwa-form-section-summary::after {
  content: "▴";
}
.pwa-form-section-body {
  padding: 0 0 12px;
}

/* Field job section tabs (Job / Capture / Site / Money) */
.field-job-tabs {
  margin-top: 4px;
  position: sticky;
  top: var(--zf-header-h, 4rem);
  z-index: 30;
  background: var(--zf-bg);
  padding-top: 4px;
  padding-bottom: 4px;
}
.field-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}
.office-tab:not(.active) .field-tab-count {
  background: var(--zf-primary-soft);
  color: var(--zf-primary);
}

/* ── Dark theme (Field / Office PWA) ───────────────────────── */
/* Toggled via html.pwa-dark from applyAppTheme / omvFieldPwa.applyDarkTheme */
html.pwa-dark,
html.pwa-dark body,
html.pwa-dark body.field-pwa-active,
html.pwa-dark body.office-pwa-active,
html.pwa-dark body.pwa-dark-body {
  color-scheme: dark;
  background: #111827 !important;
  color: #e5e7eb;
}
html.pwa-dark {
  --zf-primary: #5b8def;
  --zf-primary-dark: #8ab4f8;
  --zf-primary-soft: #1a2744;
  --zf-accent: #34d399;
  --zf-warn: #fbbf24;
  --zf-danger: #f87171;
  --zf-text: #e5e7eb;
  --zf-muted: #9ca3af;
  --zf-border: #374151;
  --zf-surface: #1f2937;
  --zf-bg: #111827;
  --zf-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --zf-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  /* Align shared app.css tokens so Bootstrap controls match the shell */
  --bg-color: #111827;
  --text-color: #e5e7eb;
  --text-muted-color: #9ca3af;
  --card-bg: #1f2937;
  --surface-bg: #1f2937;
  --surface-bg-muted: #243044;
  --border-color: #374151;
  --link-color: #8ab4f8;
  --primary-color: #5b8def;
}
html.pwa-dark .field-pwa-root,
html.pwa-dark .office-pwa-root {
  background: var(--zf-bg) !important;
  color: var(--zf-text) !important;
}
html.pwa-dark .field-pwa-header,
html.pwa-dark .field-bottom-nav,
html.pwa-dark .field-info-block,
html.pwa-dark .field-appt-card,
html.pwa-dark .pwa-list,
html.pwa-dark .pwa-form-section-summary {
  color: var(--zf-muted) !important;
}
html.pwa-dark .pwa-cal-nav {
  background: var(--zf-surface) !important;
  border-color: var(--zf-border) !important;
}
html.pwa-dark .pwa-cal-nav-btn {
  color: var(--zf-text) !important;
  border-color: var(--zf-border) !important;
}
html.pwa-dark .pwa-cal-nav-btn.is-current {
  background: var(--zf-primary-soft) !important;
  color: var(--zf-primary) !important;
}
html.pwa-dark .pwa-also,
html.pwa-dark .field-job-hero,
html.pwa-dark .office-kpi-card,
html.pwa-dark .field-sheet,
html.pwa-dark .field-sheet-backdrop + .field-sheet {
  background: var(--zf-surface) !important;
  color: var(--zf-text) !important;
  border-color: var(--zf-border) !important;
}
html.pwa-dark a.pwa-list-row {
  border-bottom-color: var(--zf-border) !important;
  color: var(--zf-text) !important;
}
html.pwa-dark a.pwa-list-row:hover,
html.pwa-dark a.pwa-list-row:focus {
  background: #1a2744 !important;
}
html.pwa-dark .form-control,
html.pwa-dark .form-select,
html.pwa-dark .input-group-text {
  background: #111827 !important;
  color: var(--zf-text) !important;
  border-color: var(--zf-border) !important;
}

/* U3: form fields must not inherit uppercase section styles (can affect typed values) */
body.field-pwa-active input.form-control,
body.field-pwa-active textarea.form-control,
body.field-pwa-active select.form-select,
body.office-pwa-active input.form-control,
body.office-pwa-active textarea.form-control,
body.office-pwa-active select.form-select {
  text-transform: none !important;
  letter-spacing: normal !important;
}
body.field-pwa-active .form-control,
body.field-pwa-active .form-select,
body.office-pwa-active .form-control,
body.office-pwa-active .form-select {
  min-height: 36px;
}

/* Customer/site create: match desktop ALL CAPS save (helpers.js keys off computed style). */
body.field-pwa-active input.form-control.pwa-save-caps,
body.office-pwa-active input.form-control.pwa-save-caps {
  text-transform: uppercase !important;
}

/* Phone-first: desktop god-page escapes stay in More → Computer tools. */
@media (max-width: 900px) {
  a.pwa-desktop-escape {
    display: none !important;
  }
}
html.pwa-dark .btn-light,
html.pwa-dark .btn-outline-secondary,
html.pwa-dark .btn-outline-light {
  background: #374151 !important;
  color: var(--zf-text) !important;
  border-color: var(--zf-border) !important;
}
html.pwa-dark .btn-primary {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8) !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
}
html.pwa-dark .text-muted,
html.pwa-dark .small.text-muted {
  color: var(--zf-muted) !important;
}
/* Bootstrap text-dark/text-black stay near-black — empty-state titles vanish on dark. */
html.pwa-dark .text-dark,
html.pwa-dark .text-black {
  color: var(--zf-text) !important;
}
html.pwa-dark .field-pwa-status-bar {
  background: #0b1220 !important;
}
/* Status chips are hardcoded #fff in light CSS — force dark surfaces */
html.pwa-dark .field-pwa-status-chip {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #cbd5e1 !important;
}
html.pwa-dark .field-pwa-status-chip.is-online {
  background: rgba(52, 211, 153, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #34d399 !important;
}
html.pwa-dark .field-pwa-status-chip.is-offline {
  background: rgba(248, 113, 113, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #f87171 !important;
}
html.pwa-dark .field-pwa-status-chip.is-muted,
html.pwa-dark .field-pwa-status-chip.is-pending {
  background: #1f2937 !important;
  color: #9ca3af !important;
}
html.pwa-dark .office-role-chip {
  background: #1e3a5f !important;
  color: #93c5fd !important;
  border-color: #1e40af !important;
}
html.pwa-dark .field-bottom-nav a,
html.pwa-dark .field-bottom-nav .label {
  color: var(--zf-muted) !important;
}
html.pwa-dark .field-bottom-nav a.active,
html.pwa-dark .field-bottom-nav a.active .label {
  color: var(--zf-primary) !important;
}
html.pwa-dark .field-create-list a {
  background: var(--zf-surface) !important;
  color: var(--zf-text) !important;
  border-color: var(--zf-border) !important;
}
html.pwa-dark .card,
html.pwa-dark .list-group-item,
html.pwa-dark .modal-content {
  background: var(--zf-surface) !important;
  color: var(--zf-text) !important;
  border-color: var(--zf-border) !important;
}
html.pwa-dark a:not(.btn):not(.field-pwa-status-chip) {
  color: #8ab4f8;
}
html.pwa-dark .alert-success {
  background: #064e3b;
  color: #a7f3d0;
  border-color: #065f46;
}
html.pwa-dark .alert-danger {
  background: #7f1d1d;
  color: #fecaca;
  border-color: #991b1b;
}
html.pwa-dark .alert-warning {
  background: #78350f;
  color: #fde68a;
  border-color: #92400e;
}
html.pwa-dark .badge.bg-warning-subtle {
  background-color: #78350f !important;
}
html.pwa-dark .badge.text-warning-emphasis {
  color: #fde68a !important;
}
/* Status pills use pale tints tuned for a white card — swap to muted dark
   variants so they don't read as stray white chips on the dark shell. */
html.pwa-dark .field-status.scheduled { background: #1e3a5f; color: #93c5fd; }
html.pwa-dark .field-status.enroute { background: #78350f; color: #fde68a; }
html.pwa-dark .field-status.onsite,
html.pwa-dark .field-status.inprogress { background: #064e3b; color: #6ee7b7; }
html.pwa-dark .field-status.completed { background: #374151; color: #d1d5db; }
html.pwa-dark .field-status.other { background: #374151; color: #cbd5e1; }
/* Bootstrap "light" utilities are hardcoded near-white — same fix as above */
html.pwa-dark .bg-light,
html.pwa-dark .text-bg-light {
  background-color: #374151 !important;
  color: var(--zf-text) !important;
}
/* Photo placeholder tile and checklist progress track are hardcoded light gray */
html.pwa-dark .field-photo-thumb,
html.pwa-dark .field-checklist-progress {
  background: #374151;
}

/* Explicit light mode (when pwa-dark is removed) — ensure tokens restore */
html:not(.pwa-dark) {
  color-scheme: light;
}
