/* ===========================
   DuctDudes Tech App - PWA
   Mobile-first, light theme
   Brand: #386191, #146297, #6cc518
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f7fa;
  --bg-input: #f5f7fa;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --dd-blue: #386191;
  --dd-blue-deep: #146297;
  --dd-blue-light: #4a7ab0;
  --dd-blue-glow: rgba(56, 97, 145, 0.2);
  --dd-green: #6cc518;
  --dd-green-light: #7ed321;
  --dd-green-glow: rgba(108, 197, 24, 0.2);
  --dd-orange: #E76F20;
  --dd-orange-light: #f09050;
  --dd-red: #C83737;
  --dd-red-light: #e04848;
  --dd-gold: #b8860b;
  --dd-gold-light: #d4a017;
  --border: #e0e0e0;
  --border-light: #eeeeee;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

#app {
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ---- Screens ---- */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

.screen-header {
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Job detail tab bar */
.job-tab-bar {
  display: flex;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.job-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.job-tab.active {
  color: var(--dd-blue);
  border-bottom-color: var(--dd-blue);
}
.job-tab-panel {
  display: none;
}
.job-tab-panel.active {
  display: block;
}

.screen-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.screen-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.screen-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(var(--safe-bottom) + 80px);
  -webkit-overflow-scrolling: touch;
}

.screen-content.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: calc(var(--safe-bottom) + 40px);
}

/* ---- Clock In Screen ---- */
.logo-area {
  margin-bottom: 32px;
  text-align: center;
}

.logo-img {
  width: 280px;
  max-width: 80%;
  height: auto;
  margin: 0 auto 4px;
  display: block;
}

.greeting {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.tech-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--dd-green);
}

.clock-display {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.btn-clock-in {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dd-green), #5aad12);
  color: white;
  border: none;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 40px var(--dd-green-glow), 0 4px 20px rgba(0,0,0,0.1);
  transition: all 0.2s;
  margin-bottom: 16px;
}

.btn-clock-in:active {
  transform: scale(0.95);
  box-shadow: 0 0 20px var(--dd-green-glow);
}

.clock-hint {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---- Truck Inspection ---- */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.check-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.check-item.answered {
  border-color: var(--dd-green);
}

.check-item.flagged {
  border-color: var(--dd-orange);
  background: rgba(231, 111, 32, 0.08);
}

.check-question {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  padding-right: 12px;
}

.check-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.check-btn {
  width: 56px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.check-btn.yes.selected {
  background: var(--dd-green);
  border-color: var(--dd-green);
  color: white;
}

.check-btn.no.selected {
  background: var(--dd-orange);
  border-color: var(--dd-orange);
  color: white;
}

.inspection-notes label {
  font-size: 14px;
  font-weight: 600;
  color: var(--dd-orange);
  display: block;
  margin-bottom: 8px;
}

.inspection-notes textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--dd-orange);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  margin-bottom: 16px;
}

/* ---- Buttons ---- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--dd-blue), var(--dd-blue-deep));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--dd-blue-light);
  border: 2px solid var(--dd-blue);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  margin-top: 8px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--dd-blue-light);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 8px;
}

/* Invoice review: back button + title side-by-side */
#screen-invoice-review .screen-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
#screen-invoice-review .screen-header .btn-back {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* ---- Schedule Screen ---- */
.schedule-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clock-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dd-green);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.active {
  background: var(--dd-green);
  box-shadow: 0 0 8px var(--dd-green-glow);
  animation: pulse 2s infinite;
}

.status-dot.paused {
  background: #d4a017;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-nav h2 {
  margin: 0;
  font-size: 18px;
  min-width: 110px;
  text-align: center;
}

.week-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.week-nav-btn:active {
  color: var(--dd-blue);
}

.day-tabs {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  min-width: 54px;
  transition: all 0.2s;
}

.day-tab.active {
  background: var(--dd-blue);
  border-color: var(--dd-blue);
  color: white;
}

.day-tab.today {
  border-color: var(--dd-green);
}

.day-tab .tab-day {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-tab .tab-date {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

.day-tab .tab-jobs {
  font-size: 10px;
  margin-top: 2px;
}

/* ---- Job Title ---- */
.job-title-badge {
  font-size: 20px;
  font-weight: 700;
  color: var(--dd-blue);
  margin-bottom: 4px;
  line-height: 1.2;
}

.job-list-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dd-blue);
  margin: 3px 0 4px;
}

/* ---- Job Cards ---- */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* Admin internal notes card (read-only, shown in Details tab) */
.job-internal-notes-card {
  border-left: 3px solid var(--dd-blue);
  background: rgba(56,97,145,0.05);
}
.internal-notes-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dd-blue);
  margin-bottom: 8px;
}
.internal-notes-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.job-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.job-list-card:active {
  background: var(--bg-card-hover);
}

.job-list-card.in-progress {
  border-color: var(--dd-green);
  border-width: 2px;
  box-shadow: 0 0 12px var(--dd-green-glow);
}

.job-list-card.completed {
  opacity: 0.5;
}

/* Completed tasks: strikethrough the task name on top of the fade, so a
   tapped-done task in the Schedule list is unambiguously finished.
   Scoped to .task-list-card so completed regular jobs keep today's
   fade-only treatment. */
.job-list-card.task-list-card.completed .job-list-name {
  text-decoration: line-through;
}

.job-list-card.cancelled {
  opacity: 0.55;
  border-color: rgba(200, 55, 55, 0.4);
  position: relative;
  overflow: hidden;
}
.job-list-card.cancelled::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(to top right,
      transparent calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% + 1.5px),
      transparent calc(50% + 1.5px)),
    linear-gradient(to bottom right,
      transparent calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% + 1.5px),
      transparent calc(50% + 1.5px));
}
.job-list-card.cancelled .job-list-name {
  text-decoration: line-through;
  text-decoration-color: #C83737;
  text-decoration-thickness: 2px;
  color: var(--text-muted);
}
.job-list-card.cancelled .job-list-services,
.job-list-card.cancelled .job-list-address,
.job-list-card.cancelled .job-list-price,
.job-list-card.cancelled .job-est-time {
  text-decoration: line-through;
  text-decoration-color: rgba(200, 55, 55, 0.5);
}

.job-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.job-list-name {
  font-size: 16px;
  font-weight: 700;
}

.job-list-window {
  font-size: 12px;
  font-weight: 600;
  color: var(--dd-green);
  background: rgba(108, 197, 24, 0.12);
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.job-list-address {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.job-list-services {
  font-size: 13px;
  color: var(--text-muted);
}

.job-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.job-list-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.job-list-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.job-list-status.scheduled { background: rgba(56, 97, 145, 0.2); color: var(--dd-blue-light); }
.job-list-status.in-progress { background: rgba(108, 197, 24, 0.15); color: var(--dd-green); }
.job-list-status.completed { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.job-list-status.cancelled { background: rgba(200, 55, 55, 0.18); color: #C83737; font-weight: 700; }

.no-jobs {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

/* ---- Job Detail ---- */
.client-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.address-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dd-blue-light);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
}

.card-icon {
  font-size: 18px;
}

.client-contact {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.contact-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.contact-btn:active {
  background: var(--bg-card-hover);
}
/* "On My Way" gets extra flex weight so its text doesn't wrap */
.contact-btn-wide { flex: 1.6; }

.job-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.service-list {
  list-style: none;
  padding: 0;
  width: 100%;
}

/* Service row: Name | Qty | Price */
.service-list li.svc-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.service-list li.svc-row:last-child { border-bottom: none; }
.svc-name { flex: 1; color: var(--text-primary); line-height: 1.3; }
.svc-qty  { font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap; min-width: 20px; text-align: right; }
.svc-price { font-size: 12px; font-weight: 700; color: #6cc518; white-space: nowrap; min-width: 36px; text-align: right; }
.svc-delete-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
}
.svc-delete-btn:active { opacity: 1; }
.svc-total-row .svc-delete-btn { display: none; }

/* Subtotal row */
.svc-total-row {
  border-top: 2px solid var(--border) !important;
  border-bottom: none !important;
  margin-top: 2px;
  padding-top: 8px !important;
}
.svc-total-row .svc-name { font-weight: 700; color: var(--text-secondary); font-size: 12px; }
.svc-total-row .svc-price { font-size: 14px; color: var(--text-primary); }

/* Fallback for old-style li without class */
.service-list li:not(.svc-row) {
  font-size: 14px;
  padding: 4px 0;
  color: var(--text-primary);
}

.job-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- Client History ---- */
.client-history-section {
  margin-bottom: 16px;
}

.client-history-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--dd-blue);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.client-history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}

.client-history-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.client-history-services {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.client-history-total {
  font-size: 13px;
  font-weight: 600;
  color: var(--dd-blue);
  margin-bottom: 4px;
}

.client-history-notes {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 6px;
}

.client-history-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.client-history-status.status-completed {
  background: var(--green-soft);
  color: var(--dd-green);
}

.client-history-status.status-in-progress {
  background: var(--primary-soft);
  color: var(--dd-blue);
}

.client-history-status.status-scheduled {
  background: var(--bg-input);
  color: var(--text-muted);
}

/* ---- Timer ---- */
.timer-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 10px 0;
}

.timer-display {
  margin-bottom: 16px;
}

.timer-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.timer-clock {
  font-size: 42px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dd-gold);
}

.timer-clock.travel {
  color: var(--dd-orange);
}

.timer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-timer {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-timer:active { transform: scale(0.98); }

.btn-arrive { background: linear-gradient(135deg, var(--dd-green), #5aad12); color: white; }
.btn-start { background: linear-gradient(135deg, var(--dd-green), #5aad12); color: white; }
.btn-pause { background: linear-gradient(135deg, #6b7280, #4b5563); color: white; }
.btn-resume { background: linear-gradient(135deg, var(--dd-green), #5aad12); color: white; }
.btn-complete { background: linear-gradient(135deg, var(--dd-green), #5aad12); color: white; }
.btn-send-invoice { background: linear-gradient(135deg, #146297, #0d4d78); color: white; }
.btn-send-photos  { background: linear-gradient(135deg, #4a8c10, #3a6e0c); color: white; }
.btn-checklist { background: linear-gradient(135deg, #386191, #2a4f6e); color: white; }
.btn-cannot-complete { background: linear-gradient(135deg, #C83737, #a02a2a); color: white; }

/* ---- Workflow Reminders ---- */
.workflow-reminders {
  background: rgba(56, 97, 145, 0.08);
  border: 1px solid rgba(56, 97, 145, 0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin: 10px 0;
}

.workflow-reminders h4 {
  color: var(--dd-blue-light);
  margin-bottom: 8px;
}

.reminder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reminder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.reminder-item .reminder-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.reminder-item.done .reminder-check {
  background: var(--dd-green);
  border-color: var(--dd-green);
  color: white;
}

.reminder-item.done {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ---- Notes & Photos ---- */
.job-notes {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  margin-bottom: 10px;
}

.job-notes:focus {
  outline: none;
  border-color: var(--dd-blue);
}

.btn-save-notes {
  display: block;
  width: 100%;
  padding: 9px;
  margin-bottom: 14px;
  background: var(--bg-input);
  border: 1px solid var(--dd-blue);
  border-radius: var(--radius-sm);
  color: var(--dd-blue);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-save-notes:active { background: var(--dd-blue); color: #fff; }

.photo-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-photo {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn-photo:active {
  background: var(--bg-card-hover);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
  position: relative;
}
.photo-upload-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.photo-upload-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.photo-thumb.photo-error { outline: 2px solid #C83737; }
.photo-delete-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  background: rgba(200,55,55,0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Job Complete ---- */
.complete-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--dd-green), #5aad12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 16px;
  box-shadow: 0 0 30px var(--dd-green-glow);
}

.complete-summary {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 320px;
  margin: 20px 0;
  border: 1px solid var(--border);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}

.summary-item:last-child { border-bottom: none; }
.summary-item.highlight { font-weight: 700; font-size: 18px; color: var(--dd-gold); }

.summary-label { color: var(--text-secondary); }
.summary-value { font-weight: 600; color: var(--dd-gold); }

.payment-status {
  color: var(--dd-green);
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
}

.review-section {
  margin-top: 24px;
  width: 100%;
  max-width: 320px;
}

.review-prompt {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ---- Messages ---- */
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conversation-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.conversation-item:active { background: var(--bg-card-hover); }

.convo-info {
  flex: 1;
}

.convo-name {
  font-size: 15px;
  font-weight: 600;
}

.convo-preview {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.convo-time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.convo-unread {
  width: 8px;
  height: 8px;
  background: var(--dd-green);
  border-radius: 50%;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ---- Chat ---- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-bubble.sent {
  background: var(--dd-blue);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble.received {
  background: var(--bg-input);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.chat-bubble .chat-time {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  text-align: right;
}

.chat-bubble.received .chat-time {
  color: var(--text-muted);
}

.chat-day-separator {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 4px 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-day-separator::before,
.chat-day-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.chat-day-separator span {
  white-space: nowrap;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(var(--safe-bottom) + 12px);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.chat-input-area input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-primary);
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--dd-blue);
}

.btn-send {
  background: linear-gradient(135deg, var(--dd-blue), var(--dd-blue-deep));
  color: white;
  border: none;
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---- Clock Out ---- */
.day-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 320px;
  margin: 20px 0 32px;
}

.btn-clock-out {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dd-red), #a82e2e);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(200, 55, 55, 0.2);
  transition: all 0.2s;
  margin-bottom: 16px;
}

.btn-clock-out:active {
  transform: scale(0.95);
}

/* ---- Bottom Nav ---- */
.bottom-nav {
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  /* max() ensures at least 24px of bottom padding so the nav clears Android
     system gesture/button bars where env(safe-area-inset-bottom) returns 0.
     iPhones with a notch keep their full safe-area inset (typically ~34px). */
  padding: 8px 0 max(calc(var(--safe-bottom) + 8px), 24px);
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  position: relative;
  font-family: 'Poppins', sans-serif;
}

.nav-item.active {
  color: var(--dd-green);
}

.nav-icon {
  font-size: 22px;
}

.nav-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(14px);
  background: var(--dd-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Status Bar ---- */
.job-status-bar {
  display: flex;
  justify-content: flex-end;
}

.status-label {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(56, 97, 145, 0.2);
  color: var(--dd-blue-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Google Sign-In Button ---- */
.btn-google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s;
  margin-top: 32px;
}

.btn-google-signin:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ---- Service Checklist ---- */
.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.checklist-header h4 {
  margin: 0;
}

.checklist-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 10px;
  border-radius: 12px;
}

.checklist-progress.complete {
  color: #fff;
  background: var(--dd-green);
}

.checklist-phase {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dd-blue);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.checklist-phase:first-child {
  margin-top: 0;
}

.checklist-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.checklist-step:last-child {
  border-bottom: none;
}

.checklist-step.checked {
  opacity: 0.55;
}

.checklist-step.checked .step-text {
  text-decoration: line-through;
}

.step-checkbox {
  min-width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--dd-green);
  transition: all 0.15s;
  flex-shrink: 0;
  margin-top: 1px;
}

.checklist-step.checked .step-checkbox {
  background: var(--dd-green);
  border-color: var(--dd-green);
  color: #fff;
}

.step-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
}

/* ---- Resources / Employee Handbook ---- */
.resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.resource-card:active {
  background: var(--bg-card-hover);
  transform: scale(0.99);
}

.resource-card-icon {
  font-size: 28px;
  min-width: 40px;
  text-align: center;
}

.resource-card-info {
  flex: 1;
}

.resource-card-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.resource-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.resource-card-arrow {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: 300;
}

/* Resource Content Cards */
.resource-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}

.resource-content-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--dd-blue);
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.resource-content-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.resource-content-text strong {
  color: var(--text-primary);
}

/* KPI Dashboard Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  transition: all 0.15s;
}

.kpi-card:hover {
  border-color: var(--dd-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.kpi-card.kpi-warning {
  border-color: var(--yellow);
  background: rgba(255,193,7,0.05);
}

.kpi-card.kpi-alert {
  border-color: var(--red);
  background: rgba(220,53,69,0.05);
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dd-blue);
  margin-bottom: 4px;
}

.kpi-warning .kpi-value {
  color: var(--yellow);
}

.kpi-alert {
  color: var(--red);
}

.kpi-detail {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Service Detail - Action Cards */
.resource-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.resource-action-card {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--dd-blue);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.resource-action-card:active {
  background: var(--dd-blue-glow);
  transform: scale(0.97);
}

.resource-action-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.resource-action-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--dd-blue);
}

.resource-action-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Phase Summary Cards */
.resource-phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.resource-phase-card:active {
  background: var(--bg-card-hover);
}

.resource-phase-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.resource-phase-icon {
  font-size: 20px;
  min-width: 28px;
  text-align: center;
}

.resource-phase-label {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.resource-phase-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 10px;
  border-radius: 12px;
}

/* Workflow Steps (read-only view) */
.workflow-phase-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dd-blue);
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--dd-blue-glow);
}

.workflow-phase-header:first-child {
  margin-top: 0;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.workflow-step:last-child {
  border-bottom: none;
}

.workflow-step-num {
  min-width: 28px;
  height: 28px;
  background: var(--dd-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.workflow-step-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  padding-top: 3px;
}

/* Training Checklist Progress Bar */
.training-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.training-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.training-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dd-green), #5aad12);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.training-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: right;
}

/* ---- Home Dashboard ---- */
.home-header {
  position: relative;
  padding-bottom: 0;
  border-bottom: none;
  overflow: visible;
}

.home-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 2;
}

.home-header-logo {
  display: flex;
  align-items: flex-end;
}

.home-logo-header {
  height: 68px;
  width: auto;
  position: relative;
  z-index: 3;
  margin-bottom: -20px;
  margin-left: -6px;
}

.home-header-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding-bottom: 18px;
  white-space: nowrap;
}

/* Duct Banner - metallic flexible ductwork strip */
.duct-banner {
  position: relative;
  width: calc(100% + 32px);
  margin-left: -16px;
  height: 44px;
  overflow: hidden;
  z-index: 1;
}

.duct-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Clock-in state (not clocked in) */
.home-clock-section {
  text-align: center;
  padding: 32px 0 24px;
}

.home-greeting {
  margin-bottom: 16px;
}

.home-greeting-text {
  font-size: 16px;
  color: var(--text-secondary);
}

.home-tech-name {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
}

.dude-prefix {
  color: var(--text-primary);
}

.dude-name {
  color: var(--dd-blue);
}

.home-time {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* Clocked-in state */
.home-active-section {
  text-align: center;
  padding: 20px 0 8px;
}

.home-status-card {
  background: var(--bg-card);
  border: 1px solid var(--dd-green);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
}

.home-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.home-status-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--dd-green);
}

.home-status-time {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--dd-green);
}

.home-day-stats {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.home-stat {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}

.home-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--dd-gold);
}

.home-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.btn-clock-out-home {
  display: inline-block;
  padding: 12px 32px;
  background: var(--dd-red);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn-clock-out-home:active {
  transform: scale(0.97);
}

.home-clock-action-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-pause-home {
  flex: 1;
  padding: 12px 16px;
  background: #d4a017;
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pause-home:active { transform: scale(0.97); }

.btn-resume-home {
  display: block;
  width: 100%;
  padding: 14px 32px;
  background: var(--dd-green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn-resume-home:active { transform: scale(0.97); }

.home-clock-action-row .btn-clock-out-home {
  flex: 2;
  margin-top: 0;
}

/* Today's schedule preview */
.home-today-section {
  margin-top: 20px;
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.home-section-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.home-job-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 3px 10px;
  border-radius: 12px;
}

.home-job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.home-job-card:active {
  background: var(--bg-card-hover);
}

.home-job-card.in-progress {
  border-color: var(--dd-green);
  border-width: 2px;
}

.home-job-card.completed {
  opacity: 0.5;
}

/* Completed tasks: strikethrough the task name on top of the fade, mirrors
   the Schedule-list rule above. Scoped to .home-job-card.task so completed
   regular jobs keep their existing fade-only treatment. */
.home-job-card.task.completed .home-job-name {
  text-decoration: line-through;
}

.home-job-card.cancelled {
  opacity: 0.55;
  border-color: rgba(200, 55, 55, 0.4);
  position: relative;
  overflow: hidden;
}
.home-job-card.cancelled::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(to top right,
      transparent calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% + 1.5px),
      transparent calc(50% + 1.5px)),
    linear-gradient(to bottom right,
      transparent calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% - 1.5px),
      rgba(200, 55, 55, 0.55) calc(50% + 1.5px),
      transparent calc(50% + 1.5px));
}
.home-job-card.cancelled .home-job-name {
  text-decoration: line-through;
  text-decoration-color: #C83737;
  text-decoration-thickness: 2px;
  color: var(--text-muted);
}
.home-job-card.cancelled .home-job-services {
  text-decoration: line-through;
  text-decoration-color: rgba(200, 55, 55, 0.5);
}

.home-job-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.home-job-name {
  font-size: 15px;
  font-weight: 600;
}

.home-job-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--dd-green);
}

.home-job-services {
  font-size: 13px;
  color: var(--text-muted);
}

.home-no-jobs {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Quick access links */
.home-quick-links {
  margin-top: 20px;
  margin-bottom: 16px;
}

.home-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.home-link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.home-link-card:active {
  background: var(--bg-card-hover);
  transform: scale(0.97);
}

.home-link-icon {
  display: block;
  font-size: 24px;
  margin-bottom: 6px;
}

.home-link-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===========================
   FLEET CHECKLIST STYLES
   =========================== */

.fleet-truck-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
}

.fleet-truck-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.fleet-truck-label strong {
  color: var(--text-primary);
}

.fleet-section {
  margin-bottom: 16px;
}

.fleet-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 2px solid var(--dd-blue);
  margin-bottom: 4px;
}

.fleet-section-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--dd-blue);
  margin: 0;
}

.fleet-section-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 10px;
  border-radius: 12px;
}

.fleet-items-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.fleet-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fleet-item:last-child {
  border-bottom: none;
}

.fleet-item.checked {
  background: rgba(108, 197, 24, 0.08);
}

.fleet-item-check {
  flex-shrink: 0;
  margin-right: 12px;
}

.fleet-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.fleet-checkbox.checked {
  background: var(--dd-green);
  border-color: var(--dd-green);
}

.fleet-checkbox.checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.fleet-item-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fleet-item-name {
  font-size: 14px;
  color: var(--text-primary);
}

.fleet-item-qty {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 8px;
}

/* Fleet Photos */
.fleet-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
}

.fleet-photo-card {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.fleet-photo-card.has-photo {
  border-style: solid;
  border-color: var(--dd-green);
}

.fleet-photo-card:active {
  transform: scale(0.97);
}

.fleet-photo-preview {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}

.fleet-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fleet-photo-icon {
  font-size: 28px;
  opacity: 0.4;
}

.fleet-photo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Fleet Notes */
.fleet-notes-section {
  margin-bottom: 16px;
}

.fleet-notes-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.fleet-notes {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  resize: vertical;
}

/* Signature Pad */
.fleet-signature-section {
  margin: 20px 0;
}

.fleet-signature-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.fleet-signature-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.fleet-signature-wrapper {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.fleet-signature-canvas {
  width: 100%;
  height: 150px;
  display: block;
  touch-action: none;
}

.fleet-signature-clear {
  margin-top: 6px;
  font-size: 13px;
}

/* Fleet Submit */
.fleet-submit-section {
  margin: 24px 0 40px;
  text-align: center;
}

.fleet-submit-btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
}

.fleet-submit-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===========================
   SAFETY QUIZ STYLES
   =========================== */

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--dd-blue);
  transition: width 0.3s;
  border-radius: 3px;
}

.quiz-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.quiz-timer {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 12px;
}

.quiz-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
}

.quiz-category-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--dd-blue);
  background: rgba(56, 97, 145, 0.1);
  padding: 2px 10px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 10px;
}

.quiz-question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
}

.quiz-option:active {
  transform: scale(0.98);
}

.quiz-option.selected {
  border-color: var(--dd-blue);
  background: rgba(56, 97, 145, 0.08);
}

.quiz-option.correct {
  border-color: var(--dd-green);
  background: rgba(108, 197, 24, 0.1);
}

.quiz-option.incorrect {
  border-color: #e04848;
  background: rgba(224, 72, 72, 0.08);
}

.quiz-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin-right: 12px;
  flex-shrink: 0;
}

.quiz-option.selected .quiz-option-letter {
  background: var(--dd-blue);
  color: #fff;
}

.quiz-option.correct .quiz-option-letter {
  background: var(--dd-green);
  color: #fff;
}

.quiz-option.incorrect .quiz-option-letter {
  background: #e04848;
  color: #fff;
}

.quiz-nav {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.quiz-nav .btn-primary,
.quiz-nav .btn-secondary {
  flex: 1;
}

.quiz-explanation {
  margin-top: 12px;
  padding: 12px;
  background: rgba(56, 97, 145, 0.06);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: none;
}

.quiz-explanation.show {
  display: block;
}

/* Quiz Results */
.quiz-results-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.quiz-results-icon.passed { color: var(--dd-green); }
.quiz-results-icon.failed { color: #e04848; }

.quiz-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
}

.quiz-score-circle.passed { border-color: var(--dd-green); }
.quiz-score-circle.failed { border-color: #e04848; }

.quiz-score-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.quiz-score-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.quiz-results-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0;
  text-align: left;
}

.quiz-results-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.quiz-results-row:last-child {
  border-bottom: none;
}

.quiz-results-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- Utilities ---- */
.mt-16 { margin-top: 16px; }

/* ---- Media queries ---- */
@media (min-width: 480px) {
  #app {
    max-width: 430px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  /* These screens live outside #app so need their own 430px constraint */
  #screen-prices,
  #screen-invoices,
  #screen-search,
  #screen-timesheet-day,
  #screen-clients-tech {
    left: 50%;
    right: auto;
    width: 430px;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ================================
   TIMESHEET SCREEN
   ================================ */
.timesheet-loading, .timesheet-error { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }
.timesheet-error { color: var(--dd-red); }
.timesheet-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 8px; }
.timesheet-nav-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); width: 36px; height: 36px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.timesheet-nav-btn:active { background: var(--dd-blue); color: #fff; }
.timesheet-nav-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.timesheet-week-summary { display: flex; gap: 8px; padding: 0 16px; margin-bottom: 16px; }
.timesheet-summary-stat { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 10px; text-align: center; }
.timesheet-summary-value { display: block; font-size: 20px; font-weight: 700; color: var(--dd-blue); }
.timesheet-summary-value.timesheet-earnings { color: var(--dd-gold); }
.timesheet-summary-label { display: block; font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.5px; }
.timesheet-days { padding: 0 16px; }
.timesheet-day { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; overflow: hidden; }
.timesheet-day-today { border-color: var(--dd-green); border-width: 2px; }
.timesheet-day-future { opacity: 0.4; }
.timesheet-day-header { display: flex; align-items: center; padding: 12px 14px; cursor: pointer; gap: 10px; }
.timesheet-day-date { display: flex; flex-direction: column; min-width: 60px; }
.timesheet-day-name { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.timesheet-day-num { font-size: 13px; color: var(--text-primary); }
.timesheet-day-clock { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); min-width: 90px; }
.timesheet-day-separator { color: var(--text-muted); }
.timesheet-day-total { flex: 1; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.timesheet-day-hours { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.timesheet-day-earnings { font-size: 12px; color: var(--text-muted); }
.timesheet-day-earnings.has-earnings { color: var(--dd-gold); font-weight: 600; }
.timesheet-day-chevron { font-size: 10px; color: var(--text-muted); width: 16px; text-align: center; }
.timesheet-day-details { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.timesheet-time-breakdown { padding: 10px 0; }
.timesheet-time-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.timesheet-time-label { color: var(--text-secondary); }
.timesheet-time-value { font-weight: 600; color: var(--text-primary); }
.timesheet-jobs-list { padding-top: 8px; border-top: 1px solid var(--border); }
.timesheet-jobs-header { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px; }
.timesheet-job-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.timesheet-job-row:last-child { border-bottom: none; }
.timesheet-job-info { display: flex; flex-direction: column; }
.timesheet-job-client { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.timesheet-job-services { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.timesheet-service-list { margin: 4px 0 0 0; padding: 0 0 0 14px; list-style: disc; }
.timesheet-service-list li { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.job-service-bullet-list { margin: 4px 0 0 0; padding: 0 0 0 14px; list-style: disc; }
.job-service-bullet-list li { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.timesheet-job-pay { text-align: right; display: flex; flex-direction: column; }
.timesheet-job-total { font-size: 13px; color: var(--text-secondary); }
.timesheet-job-commission { font-size: 12px; font-weight: 600; color: var(--dd-gold); margin-top: 2px; }

/* ================================
   ON MY WAY ETA DROPDOWN
   ================================ */
.onmyway-wrapper { flex: 1; position: relative; }
.onmyway-wrapper .contact-btn { width: 100%; }
.onmyway-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
  min-width: 160px;
  animation: dropUp 0.15s ease-out;
}
@keyframes dropUp {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.onmyway-dropdown-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-align: center; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.3px; }
.onmyway-option, .onmyway-option-asmt { display: block; width: 100%; padding: 10px 12px; margin-bottom: 4px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 500; color: var(--text-primary); text-align: center; cursor: pointer; transition: all 0.15s; }
.onmyway-option:last-child, .onmyway-option-asmt:last-child { margin-bottom: 0; }
.onmyway-option.active, .onmyway-option-asmt.active { background: rgba(56,97,145,0.12); border-color: #386191; color: #386191; font-weight: 600; }
.onmyway-option:active, .onmyway-option-asmt:active { background: rgba(56,97,145,0.2); }

/* ===================== */
/* Quick-Reply Templates  */
/* ===================== */
.chat-templates-row {
  display: none;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  scrollbar-width: none;
}
.chat-templates-row::-webkit-scrollbar { display: none; }
.chat-templates-row.open { display: flex; }
.chat-template-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: rgba(56,97,145,0.08);
  border: 1px solid rgba(56,97,145,0.25);
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #386191;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.chat-template-chip:active {
  background: rgba(56,97,145,0.2);
  border-color: #386191;
}
.btn-templates {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.btn-templates.active {
  background: rgba(56,97,145,0.12);
  border-color: #386191;
  color: #386191;
}

/* ================================ */
/* #10 - Photo Category Selector     */
/* ================================ */
.photo-category-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.photo-cat-pill {
  flex: 1;
  padding: 7px 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.photo-cat-pill.active[data-category="before"] { background: rgba(200,55,55,0.12); border-color: #C83737; color: #C83737; }
.photo-cat-pill.active[data-category="during"] { background: rgba(56,97,145,0.12); border-color: #386191; color: #386191; }
.photo-cat-pill.active[data-category="after"]  { background: rgba(108,197,24,0.12); border-color: #6cc518; color: #4a8c10; }
.photo-sections { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.photo-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.photo-section-label.before-label { color: #C83737; }
.photo-section-label.during-label { color: #386191; }
.photo-section-label.after-label  { color: #4a8c10; }
.photo-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ================================ */
/* #11 - Fleet Flagged Item Photo    */
/* ================================ */
.fleet-flag-photo-btn {
  margin-left: 8px;
  padding: 3px 8px;
  background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.35);
  border-radius: 6px;
  font-size: 12px;
  color: #a07a0a;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  vertical-align: middle;
}
.fleet-flag-photo-btn.has-photo {
  background: rgba(108,197,24,0.1);
  border-color: rgba(108,197,24,0.35);
  color: #4a8c10;
}
.fleet-flag-photo-btn:active { opacity: 0.7; }

/* ============================================ */
/* #16 - On-Site Add-Ons, Price Book, Invoice   */
/* ============================================ */

/* --- Spinner (reused from admin) --- */
@keyframes dd-spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: #386191;
  border-radius: 50%;
  animation: dd-spin 0.7s linear infinite;
  vertical-align: middle;
}
.page-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* --- Price Book Screen --- */
.pb-category-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 14px 0 6px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pb-category-header::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: #386191;
  border-radius: 2px;
}
.pb-item {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}
.pb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.pb-item-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-height: 14px;
}
.pb-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  min-width: 14px;
  background: rgba(56,97,145,0.12);
  color: #386191;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  margin-top: 1px;
}
.pb-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.pb-price {
  font-size: 15px;
  font-weight: 700;
  color: #6cc518;
  white-space: nowrap;
}
.pb-desc-link {
  padding: 4px 12px;
  background: rgba(56,97,145,0.1);
  border: 1px solid rgba(56,97,145,0.25);
  border-radius: 12px;
  color: #386191;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.pb-desc-link:active { background: rgba(56,97,145,0.2); }

/* Price book description sheet - formatted content */
.pb-desc-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.pb-desc-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--dd-blue);
  margin: 14px 0 6px;
}
.pb-desc-list {
  margin: 0 0 4px;
  padding-left: 18px;
}
.pb-desc-list li {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* --- Add Service Button (dashed) --- */
.btn-add-service {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: 1.5px dashed #386191;
  background: transparent;
  color: #386191;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-add-service:active { background: rgba(56,97,145,0.08); }
.btn-add-service.full-width { margin-top: 0; }

/* --- Bottom Sheet Overlay --- */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: flex-end;
}
.bottom-sheet {
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}
.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bottom-sheet-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.btn-sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-input);
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bottom-sheet-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 16px 16px;
}
.bottom-sheet-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Service rows inside bottom sheet */
.sheet-category-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 12px 0 4px;
}
.sheet-service-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sheet-service-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #386191;
  flex-shrink: 0;
}
.sheet-service-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}
.sheet-service-price {
  font-size: 13px;
  color: #6cc518;
  font-weight: 600;
  white-space: nowrap;
}
.sheet-qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sheet-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sheet-qty-val {
  font-size: 14px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  color: var(--text-primary);
}

/* --- FAB New Job Button --- */
.fab-new-job {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 88px);
  right: 16px;
  padding: 10px 18px;
  background: #386191;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(56,97,145,0.35);
  z-index: 10;
  transition: all 0.15s;
}
.fab-new-job:active { transform: scale(0.96); box-shadow: 0 2px 6px rgba(56,97,145,0.3); }

/* --- New Job Form Screen --- */
.form-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.form-card label,
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: #386191;
}
textarea.form-input {
  resize: vertical;
  min-height: 72px;
}

/* Client search dropdown */
.client-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.client-result-item {
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.client-result-item:last-child { border-bottom: none; }
.client-result-item:active { background: var(--bg-input); }

.client-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(56,97,145,0.1);
  border: 1px solid rgba(56,97,145,0.3);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #386191;
  margin-top: 6px;
}
.client-selected-pill button {
  background: none;
  border: none;
  color: #386191;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* --- Invoice Review Screen --- */
.invoice-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.invoice-line-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.inv-item-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.inv-qty-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.inv-item-price {
  font-size: 14px;
  font-weight: 600;
  color: #6cc518;
  white-space: nowrap;
}
.btn-remove-line {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(200,55,55,0.12);
  color: #C83737;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-remove-line:active { background: rgba(200,55,55,0.25); }

.invoice-totals {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0;
}
.inv-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text-secondary);
}
.inv-total-row + .inv-total-row {
  border-top: 1px solid var(--border);
}
.inv-grand-total {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 2px solid var(--border) !important;
  padding-top: 8px !important;
  margin-top: 2px;
}
.inv-grand-total span:last-child { color: #386191; }

/* --- Invoice Action Row --- */
.inv-action-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.inv-action-row .inv-send-btn,
.inv-action-row .inv-address-btn {
  flex: 1;
  min-width: 0;
}

/* --- Adjust Address Sheet (invoice-review address edit) --- */
.adjust-addr-field {
  margin-bottom: 12px;
}
.adjust-addr-row {
  display: flex;
  gap: 10px;
}
.adjust-addr-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}
.adjust-addr-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-strong, #111827);
  background: #fff;
  box-sizing: border-box;
}
.adjust-addr-input:focus {
  outline: none;
  border-color: var(--dd-blue, #386191);
  box-shadow: 0 0 0 3px rgba(56, 97, 145, 0.18);
}
.adjust-addr-textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.45;
}
.adjust-addr-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* --- Send Invoice Sheet --- */
.send-inv-section {
  margin-bottom: 16px;
}
.send-inv-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 2px 0 6px;
}
.send-inv-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.send-inv-channel-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.send-inv-field {
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.send-inv-review-hint {
  padding-left: 28px;
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-top: -2px;
}
/* Recipient chip / multi-contact UI */
.recipient-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
  background: var(--surface);
  cursor: text;
}
.recipient-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(56,97,145,0.12);
  border: 1px solid rgba(56,97,145,0.28);
  border-radius: 20px;
  padding: 3px 6px 3px 10px;
  font-size: 12px;
  color: #386191;
  gap: 4px;
  max-width: 220px;
}
.recipient-chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-remove {
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #888;
  padding: 0 2px;
  flex-shrink: 0;
}
.chip-add-input {
  border: none;
  outline: none;
  font-size: 13px;
  padding: 2px 4px;
  background: transparent;
  min-width: 110px;
  flex: 1;
  color: var(--text-primary);
}
.chip-add-input::placeholder { color: var(--text-muted); }

.send-inv-photo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.send-inv-photo-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* --- Send Invoice Photo Selection Grid --- */
.send-inv-photo-section { margin-top: 10px; }
.send-inv-photos-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.send-inv-photo-cols {
  display: flex;
  gap: 10px;
}
.send-inv-photo-col { flex: 1; }
.send-inv-photo-col-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.before-label { color: #C83737; }
.after-label  { color: #4a8c10; }
.send-inv-photo-item {
  position: relative;
  display: block;
  margin-bottom: 6px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
}
.send-inv-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  transition: opacity 0.15s;
}
.send-inv-photo-chk {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.send-inv-photo-item:has(.send-inv-photo-chk:not(:checked)) .send-inv-thumb {
  opacity: 0.35;
}
.send-inv-no-photos {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0;
}

/* --- Toast Message --- */
.toast-msg {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 1;
  transition: opacity 0.4s;
}
.toast-msg.fade-out { opacity: 0; }

/* ============================
   Invoice Review - New Layout
   ============================ */

/* 3-column flex row: [Name] [Note/Description] [Qty+Price+Remove] */
.invoice-line-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.inv-item-name {
  flex: 2;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.inv-item-note {
  flex: 3;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.inv-item-note-empty { flex: 3; }
.inv-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Qty +/- controls */
.inv-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.inv-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--dd-blue);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
}
.inv-qty-btn:active { background: var(--primary-soft); }
.inv-qty-val {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Discount picker row */
.inv-discount-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
  flex-wrap: wrap;
}
.inv-discount-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.inv-discount-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.inv-disc-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.inv-disc-btn:active,
.inv-disc-btn.active {
  background: var(--dd-blue);
  border-color: var(--dd-blue);
  color: #fff;
}
.inv-disc-clear {
  font-size: 12px;
  color: #C83737;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 6px;
  white-space: nowrap;
}

/* Custom discount amount row */
.inv-custom-disc-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0 8px;
}
.inv-disc-input {
  flex: 1;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-family: Poppins, sans-serif;
  color: var(--text-primary);
  background: var(--bg-card);
}
.inv-disc-input:focus { outline: none; border-color: var(--dd-blue); }
.inv-disc-apply-btn {
  height: 38px;
  padding: 0 16px;
  background: var(--dd-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Discount row in totals */
.inv-discount-line span:last-child { color: #C83737; font-weight: 600; }

/* ===========================
   Invoices Tab - List Cards
   Task 35
   =========================== */

.inv-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 48px 24px;
}

.inv-list-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 16px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.inv-list-card:active { background: #f0f4f8; }

.inv-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.inv-card-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.inv-card-client {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.inv-card-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inv-card-date {
  font-size: 12px;
  color: var(--text-muted);
}

.inv-card-total {
  font-size: 15px;
  font-weight: 700;
  color: #6cc518;
}

/* ===========================
   Invoice Status Badges
   =========================== */

.inv-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.inv-status-badge.draft {
  background: #e8e8e8;
  color: #777;
}

.inv-status-badge.awaiting-payment {
  background: #daeaf7;
  color: #386191;
}

.inv-status-badge.paid,
.inv-status-badge.completed {
  background: #e4f7d0;
  color: #4a8a0e;
}

/* ===========================
   Invoice Date-Grouped List (v2)
   =========================== */

.inv-date-group {
  margin-bottom: 4px;
}
.inv-date-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 16px 6px;
}
.inv-date-header.inv-date-today {
  color: #386191;
}
.inv-row {
  background: var(--bg-card);
  margin: 0 16px 8px;
  border-radius: 10px;
  border-left: 4px solid #ddd;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-row-body { flex: 1; min-width: 0; }
.inv-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 18px;
  color: #C83737;
  padding: 6px;
  cursor: pointer;
  opacity: 0.7;
  -webkit-tap-highlight-color: transparent;
}
.inv-delete-btn:active { opacity: 1; }
.inv-row:active { background: #f0f4f8; }
.inv-row.inv-row-draft            { border-left-color: #bbb; }
.inv-row.inv-row-awaiting-payment { border-left-color: #386191; }
.inv-row.inv-row-completed        { border-left-color: #6cc518; }
.inv-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2px;
}
.inv-row-client {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  margin-right: 8px;
}
.inv-row-total {
  font-size: 15px;
  font-weight: 700;
  color: #6cc518;
  white-space: nowrap;
}
.inv-row-tip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 2px;
}
.inv-row-mid {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-row-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inv-row-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ===========================
   Invoice Read-only Detail Sheet
   =========================== */

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0 0 32px;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eee;
}

.bottom-sheet-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.btn-sheet-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.bottom-sheet-body { padding: 20px 20px 0; }

.inv-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.inv-detail-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.inv-detail-client {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.inv-detail-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.inv-detail-lines {
  border-top: 1px solid #eee;
  padding-top: 12px;
  margin-bottom: 12px;
}

.inv-detail-logo-bar { padding: 14px 0 10px; text-align: center; }
.inv-detail-logo { height: 40px; width: auto; display: inline-block; }

.inv-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-primary);
  padding: 5px 0;
}

.inv-detail-name { flex: 1; padding-right: 12px; }

.inv-detail-price { font-weight: 600; white-space: nowrap; }

.inv-detail-item-block { align-items: flex-start; }
.inv-detail-item-left { flex: 1; padding-right: 12px; }
.inv-detail-item-desc {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
  white-space: pre-line;
  line-height: 1.45;
}

.inv-detail-totals {
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.inv-detail-grand {
  font-size: 16px;
  font-weight: 700;
  border-top: 1px solid #eee;
  padding-top: 8px;
  margin-top: 4px;
}

.inv-detail-disc .inv-detail-price { color: #C83737; }

/* ===========================
   Home Screen - Job Status Badge
   =========================== */

.home-job-status-row { margin-top: 6px; }
.home-job-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 0.2px;
}
.home-job-badge.in-progress { background: #fff3cd; color: #856404; }
.home-job-badge.completed   { background: #d4edda; color: #155724; }
.home-job-badge.cancelled   { background: rgba(200, 55, 55, 0.18); color: #C83737; font-weight: 700; }

/* ===========================
   Search Hub Screen
   =========================== */

.search-hub {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 8px 0;
}
.search-hub-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: none;
  border-radius: 16px;
  padding: 32px 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.search-hub-btn:active { background: #f0f4f8; }
.search-hub-icon  { font-size: 40px; line-height: 1; }
.search-hub-label { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.search-hub-desc  { font-size: 13px; color: var(--text-muted); text-align: center; }

/* ===========================
   Daily Timesheet Screen
   =========================== */

.tsd-clock-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-card);
  border-radius: 14px;
  margin: 0 0 16px;
  padding: 20px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.tsd-clock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.tsd-clock-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.tsd-clock-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.tsd-clock-divider { width: 1px; height: 40px; background: var(--border); }

.tsd-stats { display: flex; gap: 10px; margin-bottom: 20px; }
.tsd-stat {
  flex: 1;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px 8px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tsd-stat-val {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #386191;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.tsd-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.tsd-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tsd-job-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tsd-job-client   { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.tsd-job-services { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tsd-job-right    { text-align: right; flex-shrink: 0; padding-left: 12px; }
.tsd-job-total    { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.tsd-job-comm     { font-size: 12px; color: #6cc518; font-weight: 600; }

.tsd-earnings-total {
  text-align: center;
  font-size: 15px;
  color: var(--text-primary);
  margin-top: 16px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}

.tsd-empty      { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }
.tsd-empty-jobs { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }

/* ---- Total tracked row ---- */
.tsd-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: 10px;
  margin-bottom: 16px;
}
.tsd-total-label { font-size: 13px; color: var(--text-muted); }
.tsd-total-val   { font-size: 20px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ---- Activity Timeline ---- */
.tsd-timeline { display: flex; flex-direction: column; gap: 8px; }

.tsd-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.tsd-entry-active {
  border-color: var(--primary);
  background: #f0f6ff;
}

.tsd-entry-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 58px;
}
.tsd-entry-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.tsd-entry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tsd-dot-travel { background: #f59e0b; }
.tsd-dot-job    { background: #6cc518; }
.tsd-dot-break  { background: #94a3b8; }

.tsd-entry-body  { flex: 1; min-width: 0; }
.tsd-entry-top   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tsd-entry-dur   { font-size: 16px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.tsd-entry-label { font-size: 13px; color: var(--text-primary); margin-top: 2px; }
.tsd-entry-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Type badges */
.tsd-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tsd-badge-travel { background: #fef3c7; color: #92400e; }
.tsd-badge-job    { background: #dcfce7; color: #166534; }
.tsd-badge-break  { background: #f1f5f9; color: #64748b; }

/* Edit button on each entry */
.tsd-entry-top-right { display: flex; align-items: center; gap: 6px; }
.tsd-edit-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.tsd-edit-btn:active { background: var(--surface); }

/* Edit sheet form */
.tsd-edit-time-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  box-sizing: border-box;
  margin-top: 6px;
}
.tsd-edit-dur-display {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0 4px;
  font-weight: 500;
}

/* Pulsing live dot for active entry */
.tsd-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: tsd-pulse-anim 1.2s ease-in-out infinite;
}
@keyframes tsd-pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}
.tsd-delete-btn {
  background: transparent;
  border: 1.5px solid #C83737;
  color: #C83737;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tsd-delete-btn:active {
  background: #C83737;
  color: #fff;
}

/* ================================
   Client Search Screen (v17)
   ================================ */

/* Search input */
.ct-search-wrap {
  padding: 12px 16px 8px;
}
.ct-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  background: #f8f9fa;
  outline: none;
  box-sizing: border-box;
}
.ct-search-input:focus {
  border-color: var(--primary);
  background: #fff;
}

/* List */
.ct-list {
  padding: 0 16px 24px;
}
.ct-hint,
.ct-empty,
.ct-empty-jobs {
  padding: 32px 0;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}
.ct-loading {
  padding: 32px 0;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}
.ct-list-item {
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.ct-list-item:active {
  background: #f0f4ff;
  border-radius: 6px;
}
.ct-list-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ct-list-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.ct-list-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Type badges (shared between list + detail) */
.ct-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ct-type-res    { background: #e8f5e9; color: #2e7d32; }
.ct-type-comm   { background: #e3f2fd; color: #1565c0; }
.ct-type-strata { background: #fff3e0; color: #e65100; }

/* Back button in screen header */
.ct-back-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--primary);
  padding: 0 12px 0 0;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

/* Client detail card */
.ct-detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 16px;
}
.ct-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.ct-detail-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.ct-detail-row {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #f0f0f0;
  align-items: flex-start;
}
.ct-detail-label {
  font-size: 12px;
  color: var(--text-light);
  min-width: 60px;
  padding-top: 1px;
  flex-shrink: 0;
}
.ct-detail-val {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  word-break: break-word;
}
.ct-link {
  color: var(--primary);
  text-decoration: none;
}

/* Job history section */
.ct-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px 4px;
}
.ct-job-list {
  padding: 0 16px 32px;
}
.ct-job-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ct-job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ct-job-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ct-job-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.ct-job-done    { background: #e8f5e9; color: #2e7d32; }
.ct-job-active  { background: #fff3e0; color: #e65100; }
.ct-job-pending { background: #f5f5f5; color: #666; }
.ct-job-services {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.ct-job-tech {
  font-size: 12px;
  color: var(--text-light);
}

/* ---- New Job: date + window two-column row ---- */
.nj-two-col {
  display: flex;
  gap: 12px;
}
.nj-field {
  flex: 1;
  min-width: 0;
}

/* ================================
   Timesheet - Jobber-style redesign (v19)
   ================================ */

/* Month label + week navigation */
.tsj-month-row {
  padding: 4px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tsj-month-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
}
.tsj-week-nav {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.tsj-week-nav:active {
  background: var(--bg-secondary);
}

/* Week strip */
.tsj-week-strip {
  display: flex;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tsj-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 36px;
}
.tsj-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.tsj-day-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.tsj-today .tsj-day-num {
  background: #2e7d32;
  color: #fff;
}
.tsj-week-day {
  cursor: pointer;
}
.tsj-week-day:hover .tsj-day-num {
  background: rgba(56, 97, 145, 0.1);
}
.tsj-today:hover .tsj-day-num {
  background: #2e7d32;
}
.tsj-selected .tsj-day-num {
  border: 2px solid #386191;
  color: #386191;
}

/* Past-day banner */
.tsj-past-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f4f8;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.tsj-today-btn {
  background: #386191;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* Tracked time + clock button header */
.tsj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tsj-header-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.tsj-header-total {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.tsj-clock-btn {
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  font-family: Poppins, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(46,125,50,0.3);
}
.tsj-clock-btn:active { opacity: 0.85; }
.tsj-clock-out {
  background: #C83737;
  box-shadow: 0 2px 6px rgba(200,55,55,0.3);
}
.tsj-clock-pause {
  background: #d4a017;
  box-shadow: 0 2px 6px rgba(212,160,23,0.3);
}
.tsj-clock-resume {
  background: #2e7d32;
  box-shadow: 0 2px 6px rgba(46,125,50,0.3);
}
.tsj-clock-btns {
  display: flex;
  gap: 8px;
}
.tsj-clock-btns .tsj-clock-btn {
  flex: 1;
}

/* Timeline */
.tsj-timeline {
  display: flex;
  flex-direction: column;
}
.tsj-entry {
  display: flex;
  gap: 12px;
}
.tsj-spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 14px;
  flex-shrink: 0;
  padding-top: 6px;
}
.tsj-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tsj-dot-travel { background: #f59e0b; }
.tsj-dot-job    { background: #2e7d32; }
.tsj-dot-break  { background: #94a3b8; }
.tsj-line {
  flex: 1;
  width: 2px;
  background: var(--border);
  margin-top: 4px;
  min-height: 16px;
}
.tsj-content {
  flex: 1;
  min-width: 0;
  padding-bottom: 16px;
}
.tsj-ts {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.tsj-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}
.tsj-card-active {
  border-color: #6cc518;
}
.tsj-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tsj-dur-label {
  font-size: 13px;
  color: var(--text-muted);
}
.tsj-dur {
  font-weight: 700;
  color: #2e7d32;
  font-variant-numeric: tabular-nums;
}
.tsj-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tsj-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.tsj-service-list {
  margin: 2px 0 0 14px;
  padding: 0;
  list-style: disc;
}
.tsj-service-list li {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   Jobber-style Notes Feed
   =========================== */
.note-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.note-input-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  line-height: 1.4;
  min-height: 140px;
}
.note-input-field:focus {
  outline: none;
  border-color: var(--dd-blue);
}
.btn-note-save {
  flex-shrink: 0;
  padding: 10px 16px;
  background: none;
  border: 1px solid var(--dd-green);
  border-radius: var(--radius-sm);
  color: var(--dd-green);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-self: flex-end;
}
.btn-note-save:active { background: var(--dd-green); color: #fff; }

.notes-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
}
.note-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.note-item:last-child { border-bottom: none; }
.note-item-header {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
}
.note-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.note-timestamp {
  font-size: 12px;
  color: var(--text-muted);
}
.note-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
}
.notes-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0 8px;
}
.notes-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
}

/* ===========================
   Toast Notification System
   =========================== */
.app-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: 320px;
  width: calc(100% - 48px);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  text-align: center;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}
.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.app-toast.toast-info    { background: #1e293b; }
.app-toast.toast-success { background: var(--dd-green); }
.app-toast.toast-warning { background: var(--dd-orange); }
.app-toast.toast-error   { background: var(--dd-red); }

/* ===========================
   Confirm Sheet (replaces confirm())
   =========================== */
.confirm-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9990;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.confirm-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 16px));
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.confirm-sheet h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.confirm-sheet p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.confirm-sheet-actions {
  display: flex;
  gap: 10px;
}
.confirm-sheet-actions button {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: opacity 0.15s;
}
.confirm-sheet-actions button:active { opacity: 0.8; }
.confirm-btn-cancel {
  background: #f1f5f9;
  color: #64748b;
}
.confirm-btn-confirm {
  background: var(--dd-blue);
  color: #fff;
}
.confirm-btn-confirm.danger {
  background: var(--dd-red);
}

/* ===========================
   Complete Screen Polish
   =========================== */
.complete-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dd-green), #5aaa12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 20px rgba(108,197,24,0.35);
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.complete-checkmark svg {
  width: 40px;
  height: 40px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-check 0.4s 0.2s ease forwards;
}
@keyframes pop-in {
  0%   { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}
.complete-earnings {
  margin: 8px 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.complete-earnings strong {
  color: var(--dd-gold-light);
  font-weight: 700;
  font-size: 15px;
}


/* Invoice: Collect Payment block */
.inv-resend-section {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg-input, #f7f9fc);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.inv-resend-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 10px;
}
.inv-resend-row { display: flex; gap: 8px; align-items: center; }
.inv-resend-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text-main);
  outline: none;
  min-width: 0;
}
.inv-resend-input:focus { border-color: var(--dd-blue); }
.inv-resend-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  background: var(--dd-blue);
  border: none;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.inv-resend-btn:active { background: #146297; }
.inv-resend-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.inv-collect-payment {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.inv-collect-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 10px;
}
.inv-pay-btn {
  display: block;
  background: var(--dd-blue);
  color: #fff;
  text-decoration: none;
  text-align: center;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  transition: background 0.15s;
}
.inv-pay-btn:active { background: #146297; }
.inv-collect-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* =============================================
   Service list pricing breakdown rows (job detail)
   ============================================= */
.svc-btn-spacer { width: 22px; flex-shrink: 0; }
.svc-subtotal-row,
.svc-gst-row,
.svc-discount-row { border-bottom: none !important; padding: 3px 0; }
.svc-subtotal-row { border-top: 2px solid var(--border) !important; padding-top: 8px !important; margin-top: 2px; }
.svc-subtotal-row .svc-name,
.svc-gst-row .svc-name { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.svc-subtotal-row .svc-price,
.svc-gst-row .svc-price { font-size: 12px; color: var(--text-secondary); }
.svc-discount-row .svc-name { font-size: 12px; color: var(--red); }
.svc-discount-row .svc-price { font-size: 12px; color: var(--red); }
.svc-grand-total-row { border-top: 2px solid var(--border) !important; border-bottom: none !important; padding-top: 8px !important; margin-top: 2px; }
.svc-grand-total-row .svc-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.svc-grand-total-row .svc-price { font-size: 15px; font-weight: 700; color: var(--text-primary); }

/* Service item 2-line layout */
.svc-item-row {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 2px;
  padding: 8px 0 !important;
}
.svc-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.svc-item-top .svc-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.svc-item-top .svc-delete-btn { margin-left: auto; flex-shrink: 0; }
.svc-item-detail {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 1px;
  margin-top: 1px;
}
.svc-line-total { color: #6cc518; font-weight: 700; font-size: 11px; }

/* --- Job service action buttons row --- */
.job-service-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.job-service-actions .btn-add-service {
  flex: 1;
  margin-top: 0;
  width: auto;
}
.btn-job-discount {
  border-color: var(--text-muted) !important;
  color: var(--text-secondary) !important;
}

/* --- Job Discount Sheet --- */
.job-disc-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.job-disc-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.job-disc-btn {
  flex: 1;
  min-width: 64px;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.job-disc-btn.active {
  border-color: #386191;
  background: rgba(56,97,145,0.1);
  color: #386191;
}
.job-disc-btn:active { opacity: 0.7; }
.job-disc-custom-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

/* =============================================
   Tech App — Detailed Invoice Read-only View
   ============================================= */
.inv-tech-doc { padding: 0 0 32px; }
.inv-tech-logo-bar { text-align: center; padding: 20px 16px 12px; border-bottom: 1px solid var(--border-color); }
.inv-tech-logo { height: 36px; width: auto; }
.inv-tech-status-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.inv-tech-inv-num { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.inv-tech-client-block { padding: 0 16px 16px; border-bottom: 1px solid var(--border-color); }
.inv-tech-client-name { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0 0 2px; }
.inv-tech-for-services { font-size: 12px; color: var(--text-secondary); margin: 0 0 12px; }
.inv-tech-meta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.inv-tech-meta-col { flex: 1 1 120px; }
.inv-tech-meta-col h4 { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 4px; }
.inv-tech-meta-col p { font-size: 12px; color: var(--text-primary); line-height: 1.5; margin: 0; }
.inv-tech-items-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 0; }
.inv-tech-items-table thead tr { background: #f3f6fa; }
.inv-tech-items-table th { padding: 10px 12px; font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid var(--border-color); text-align: left; }
.inv-tech-items-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); vertical-align: top; color: var(--text-primary); }
.inv-tech-cell-right { text-align: right !important; white-space: nowrap; }
.inv-tech-item-date { font-size: 10px; color: var(--text-secondary); margin-bottom: 2px; }
.inv-tech-item-name { font-weight: 600; font-size: 13px; }
.inv-tech-item-desc { font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.45; }
.inv-tech-totals-wrap { display: flex; justify-content: flex-end; padding: 8px 12px 16px; }
.inv-tech-totals-table { width: 100%; max-width: 280px; font-size: 13px; border-collapse: collapse; }
.inv-tech-totals-table td { padding: 5px 8px; color: var(--text-primary); }
.inv-tech-totals-table td:last-child { text-align: right; font-weight: 600; }
.inv-tech-total-bold td { font-size: 15px; font-weight: 800; border-top: 2px solid var(--border-color); padding-top: 8px; }
.inv-tech-paid-row td { color: #2a8a2a; }
.inv-tech-bal-row td { color: #c83737; font-weight: 700; font-size: 14px; }

/* Stripe collect payment button (disabled until Stripe credentials provided) */
.inv-stripe-btn { display: block; width: 100%; padding: 14px; background: var(--brand-blue, #386191); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; text-align: center; cursor: not-allowed; opacity: .55; margin-bottom: 6px; }
.inv-stripe-btn:not([disabled]) { cursor: pointer; opacity: 1; }
.inv-stripe-hint { font-size: 11px; color: var(--text-secondary); text-align: center; margin: 0 0 14px; }

/* Invoice disclaimer */
.inv-tech-disclaimer { margin: 24px 0 8px; padding: 16px 20px; border-top: 1px solid #e0e6ed; }
.inv-tech-disclaimer-title { font-size: 13px; font-weight: 700; color: #1a1f2e; margin: 0 0 6px; }
.inv-tech-disclaimer-text { font-size: 12px; color: #555; margin: 0; line-height: 1.6; }

/* ===================================
   After Service Checklist Overlay
   =================================== */
.checklist-sheet {
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.checklist-sheet .bottom-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 0;
}
.checklist-section-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #386191;
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e6ed;
}
.checklist-section-heading:first-child {
  margin-top: 0;
}
.checklist-question-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f3f7;
}
.checklist-question-text {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
  flex: 1;
}
.checklist-answer-select {
  flex-shrink: 0;
  width: 96px;
  padding: 6px 22px 6px 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cdd4df;
  border-radius: 8px;
  background-color: #f7f9fc;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%235a6577' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: #1a1f2e;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}
.checklist-answer-select.is-empty     { color: #8a93a3; }
.checklist-answer-select.answered-yes { border-color: #6cc518; background-color: #f0fae6; color: #3d7a0a; }
.checklist-answer-select.answered-no  { border-color: #C83737; background-color: #fdf0f0; color: #a02020; }

.checklist-footer {
  padding: 14px 16px 20px;
  border-top: 1px solid #e0e6ed;
  background: #fff;
}
.checklist-declaration {
  margin-bottom: 14px;
}
.checklist-declaration-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.checklist-declaration-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #386191;
}
.checklist-declaration-label span {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
}
.checklist-save-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
}
.checklist-saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #3d7a0a;
  background: #f0fae6;
  border: 1px solid #6cc518;
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: 8px;
}

/* Assessment cards in schedule */
.asmt-list-card { border-left: 3px solid #7b5ea7; }
.job-list-status.asmt-status { background: rgba(123,94,167,0.1); color: #7b5ea7; font-weight: 700; border-radius: 12px; padding: 2px 10px; }

/* Add Service overlay — service group headers */
.service-group-header {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #386191;
  background: rgba(56, 97, 145, 0.09);
  border: 1px solid rgba(56, 97, 145, 0.18);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 14px 0 6px;
}
.service-group-header:first-child { margin-top: 4px; }

/* Add Service overlay — service item rows */
.job-service-item {
  border-bottom: 1px solid var(--border);
}
.job-service-item:last-child { border-bottom: none; }
.job-service-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}
.job-service-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #386191;
  flex-shrink: 0;
}
.service-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.3;
}
.service-price {
  font-size: 13px;
  font-weight: 700;
  color: #6cc518;
  white-space: nowrap;
}
.service-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 8px 28px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-input {
  width: 44px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Value Add-on — save button */
.btn-addon-save {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 10px;
  padding: 11px 0;
  background: var(--surface);
  border: 2px dashed rgba(56, 97, 145, 0.4);
  border-radius: 12px;
  color: #386191;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-addon-save:active { opacity: 0.7; }

/* ==============================
   Referral Book
   ============================== */
.referral-intro {
  padding: 14px 16px 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.referral-category {
  margin: 0 12px 14px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  background: var(--surface);
  border: 1px solid var(--border);
}
.referral-cat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--cat-color) 10%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--cat-color) 20%, transparent);
}
.referral-cat-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.referral-cat-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.referral-cat-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}
.referral-companies {
  padding: 8px 0;
}
.referral-company-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.referral-company-card:last-child { border-bottom: none; }
.referral-company-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.referral-company-notes {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.referral-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56,97,145,0.1);
  border: 1px solid rgba(56,97,145,0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #386191;
  text-decoration: none;
  margin-top: 2px;
}
.referral-phone-btn:active { opacity: 0.7; }
.referral-empty-msg {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* Job number — schedule card footer */
.job-list-job-number {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  margin-left: auto;
  margin-right: 8px;
}

/* Job number — job detail client card */
.job-number-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

/* Estimated time — home + schedule job cards */
.job-est-time {
  font-size: 12px;
  color: #999;
  margin-top: 5px;
}

/* ============================== */
/* Create Invoice Sheet           */
/* ============================== */
.ci-new-btn {
  background: var(--dd-blue, #386191);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: Poppins, sans-serif;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.ci-new-btn:active { opacity: 0.85; }
.ci-sheet-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #e8edf3;
}
.ci-sheet-back {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--dd-blue, #386191);
  cursor: pointer;
  padding: 4px 8px 4px 0;
  line-height: 1;
}
.ci-sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #1a1f2e);
  margin: 0;
}
.ci-sheet-body { padding: 16px; padding-bottom: 40px; }
.ci-section {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.ci-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted, #8a9bb0);
  margin-bottom: 12px;
}
.ci-tab-row { display: flex; gap: 8px; margin-bottom: 12px; }
.ci-tab {
  flex: 1;
  padding: 8px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  background: #f5f7fa;
  color: var(--text-secondary, #5a6a7a);
  font-size: 13px;
  font-weight: 600;
  font-family: Poppins, sans-serif;
  cursor: pointer;
}
.ci-tab-active {
  background: var(--dd-blue, #386191);
  color: #fff;
  border-color: var(--dd-blue, #386191);
}
.ci-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #5a6a7a);
  margin: 10px 0 4px;
}
.ci-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 14px;
  font-family: Poppins, sans-serif;
  color: var(--text-primary, #1a1f2e);
  background: #f9fbfd;
  box-sizing: border-box;
  outline: none;
}
.ci-input:focus { border-color: var(--dd-blue, #386191); background: #fff; }
.ci-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 2px; }
.ci-dropdown {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1.5px solid #d0d7e2;
  border-radius: 10px;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.ci-client-result {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1a1f2e);
  cursor: pointer;
  border-bottom: 1px solid #f0f4f8;
}
.ci-client-result:last-child { border-bottom: none; }
.ci-client-result:active { background: #f0f4f8; }
.ci-client-contact { font-size: 12px; font-weight: 400; color: var(--text-muted, #8a9bb0); }
.ci-selected-client {
  margin-top: 10px;
  background: #eef6ff;
  border: 1.5px solid #b8d4f0;
  border-radius: 10px;
  padding: 10px 14px;
}
.ci-selected-name { font-size: 14px; font-weight: 700; color: var(--dd-blue, #386191); }
.ci-selected-contact { font-size: 12px; color: var(--text-secondary, #5a6a7a); margin-top: 2px; }
.ci-selected-clear {
  margin-top: 6px;
  background: none;
  border: none;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  padding: 0;
  font-family: Poppins, sans-serif;
}
.ci-sugg-group {
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted, #8a9bb0);
  background: #f9fbfd;
}
.ci-sugg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f4f8;
}
.ci-sugg-item:last-child { border-bottom: none; }
.ci-sugg-item:active { background: #f0f4f8; }
.ci-sugg-name { font-size: 13px; font-weight: 600; color: var(--text-primary, #1a1f2e); }
.ci-sugg-price { font-size: 13px; font-weight: 700; color: var(--dd-blue, #386191); }
.ci-empty-lines {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #8a9bb0);
  font-style: italic;
}
.ci-line-item {
  background: #f9fbfd;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.ci-line-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ci-line-name { font-size: 13px; font-weight: 700; color: var(--text-primary, #1a1f2e); flex: 1; }
.ci-line-remove {
  background: none;
  border: none;
  color: #bbb;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 0 8px;
  line-height: 1;
  flex-shrink: 0;
}
.ci-line-remove:active { color: var(--dd-red, #C83737); }
.ci-line-desc { font-size: 12px; color: var(--text-secondary, #5a6a7a); margin-bottom: 8px; line-height: 1.5; }
.ci-line-desc p.ci-desc-para { margin: 0 0 3px; }
.ci-line-desc ul.ci-desc-list { margin: 2px 0 4px 16px; padding: 0; }
.ci-line-desc ul.ci-desc-list li { margin-bottom: 2px; }
.ci-desc-gap { height: 6px; }
.ci-line-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ci-qty-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.ci-qty-btn {
  background: #f5f7fa;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--dd-blue, #386191);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ci-qty-btn:active { background: #e0e8f0; }
.ci-qty-val { min-width: 28px; text-align: center; font-size: 14px; font-weight: 700; color: var(--text-primary, #1a1f2e); }
.ci-price-wrap { display: flex; align-items: center; gap: 4px; flex: 1; }
.ci-price-label { font-size: 12px; color: var(--text-muted, #8a9bb0); white-space: nowrap; }
.ci-price-input {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 14px;
  font-family: Poppins, sans-serif;
  font-weight: 600;
  color: var(--text-primary, #1a1f2e);
  background: #fff;
  min-width: 0;
  max-width: 100px;
}
.ci-price-input:focus { border-color: var(--dd-blue, #386191); outline: none; }
.ci-line-total { font-size: 14px; font-weight: 700; color: var(--text-primary, #1a1f2e); margin-left: auto; }
.ci-totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f4f8;
  font-size: 14px;
  color: var(--text-secondary, #5a6a7a);
}
.ci-totals-row:last-child { border-bottom: none; }
.ci-total-bold { font-size: 16px; font-weight: 700; color: var(--text-primary, #1a1f2e); padding-top: 10px; }
.ci-discount-wrap { display: flex; align-items: center; gap: 6px; }
.ci-discount-input {
  width: 80px;
  padding: 6px 10px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 14px;
  font-family: Poppins, sans-serif;
  text-align: right;
  background: #f9fbfd;
}
.ci-discount-input:focus { border-color: var(--dd-blue, #386191); outline: none; }
.ci-disc-toggle {
  padding: 6px 12px;
  border: 1.5px solid var(--dd-blue, #386191);
  border-radius: 8px;
  background: #fff;
  color: var(--dd-blue, #386191);
  font-size: 13px;
  font-weight: 700;
  font-family: Poppins, sans-serif;
  cursor: pointer;
}
.ci-gst-remove-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: #aaa;
  cursor: pointer;
  font-family: Poppins, sans-serif;
  padding: 0 0 0 6px;
  text-decoration: underline;
}
.ci-save-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--dd-blue, #386191);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: Poppins, sans-serif;
  cursor: pointer;
  margin-top: 8px;
  letter-spacing: 0.2px;
}
.ci-save-btn:active { opacity: 0.85; }
.ci-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================
   After-Service Report (Invoice Review sections 2 + 3)
   ============================================ */
.inv-section-divider {
  height: 1px;
  background: var(--border);
  margin: 26px 0 20px;
}

.inv-subsection-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--dd-blue-deep);
  margin: 0 0 6px;
}

.inv-subsection-intro {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.55;
}

.inv-report-meters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meter-row {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.meter-label {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.meter-level-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.meter-level-text.active-light    { color: #6cc518; }
.meter-level-text.active-moderate { color: #d4a017; }
.meter-level-text.active-heavy    { color: #C83737; }

.meter-cells {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.meter-cell {
  background: #e5e7eb;
  color: #9ca3af;
  border: none;
  padding: 10px 4px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.meter-cell:active { transform: scale(0.97); }

.meter-cell.active-light    { background: #6cc518; color: #fff; box-shadow: 0 2px 6px rgba(108, 197, 24, 0.4); }
.meter-cell.active-moderate { background: #d4a017; color: #fff; box-shadow: 0 2px 6px rgba(212, 160, 23, 0.4); }
.meter-cell.active-heavy    { background: #C83737; color: #fff; box-shadow: 0 2px 6px rgba(200, 55, 55, 0.4); }

.inv-send-report-btn {
  background: linear-gradient(135deg, #146297, #0d4d78);
  color: #fff;
}
.inv-send-photos-btn {
  background: linear-gradient(135deg, #4a8c10, #3a6e0c);
  color: #fff;
}

/* "Finish & Back to Home" button at the bottom of the Invoice Review
   screen — distinct from the action buttons above. Solid brand-blue
   pill, big tap target, full width, with a generous bottom margin so
   it clears the bottom-nav and safe-area inset. */
.btn-finish-home {
  margin-top: 14px;
  margin-bottom: calc(var(--safe-bottom, 0px) + 24px);
  padding: 16px 20px;
  background: #386191;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.2px;
  box-shadow: 0 3px 10px rgba(56, 97, 145, 0.3);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-finish-home:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(56, 97, 145, 0.3);
}

/* Photo / video lightbox — full-screen overlay shown when a tech taps
   any photo thumbnail. Used for showing photos large to the client
   on-site. Backdrop tap closes; close button is top-right. */
.photo-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-lightbox-overlay[style*="flex"] {
  display: flex;
}
.photo-lightbox-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox-media {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  transform-origin: center center;
  touch-action: none;
  user-select: none;
  will-change: transform;
}
.photo-lightbox-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 18px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.photo-lightbox-close:active {
  background: rgba(255, 255, 255, 0.3);
}
/* Make existing photo thumbs visibly tappable. */
.photo-thumb { cursor: pointer; }

/* Job notes — inline edit affordances. The pencil button lives in
   the note header next to the timestamp; tapping it swaps the note
   content for a textarea + Save/Cancel actions in-place. */
.note-item-header { position: relative; }
.note-edit-btn {
  background: transparent;
  border: none;
  color: #6b7785;
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px;
  margin-left: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.note-edit-btn:hover,
.note-edit-btn:active {
  background: rgba(56, 97, 145, 0.1);
  color: #386191;
}
.note-edited-tag {
  color: #9aa3ad;
  font-style: italic;
  font-size: 11px;
  margin-left: 4px;
}
.note-edit-area {
  margin-top: 4px;
}
.note-edit-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d0d7e2;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #1a1f2e;
  resize: vertical;
  min-height: 64px;
  background: #fff;
}
.note-edit-textarea:focus {
  outline: none;
  border-color: #386191;
  box-shadow: 0 0 0 3px rgba(56, 97, 145, 0.15);
}
.note-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}
.note-edit-actions .btn-secondary,
.note-edit-actions .btn-primary {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

/* ============================================
   Checklist Tab — menu cards + inline detail
   (Added 2026-04-30 for FEATURE 010 update)
   ============================================ */

.checklist-menu-hint {
  font-size: 13px;
  color: var(--text-muted, #7587a0);
  margin: 0 0 14px;
}

.checklist-menu-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #e5ebf2;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.05s ease;
  font-family: inherit;
}
.checklist-menu-card:last-child { margin-bottom: 0; }
.checklist-menu-card:hover  { border-color: #386191; }
.checklist-menu-card:active { transform: scale(0.99); }

.checklist-menu-card-main { flex: 1; min-width: 0; }
.checklist-menu-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f3247;
}
.checklist-menu-card-sub {
  font-size: 12px;
  color: #7587a0;
  margin: 4px 0 8px;
}
.checklist-menu-card-chevron {
  flex: 0 0 auto;
  margin-left: 12px;
  font-size: 22px;
  color: #a8b5c5;
}

.checklist-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.checklist-status-pill.not-started { background: #eef1f5; color: #7587a0; }
.checklist-status-pill.in-progress { background: rgba(212,160,23,0.15); color: #d4a017; }
.checklist-status-pill.saved       { background: rgba(108,197,24,0.15); color: #6cc518; }

.checklist-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 0;
  margin: 0 0 8px;
  font: inherit;
  font-size: 14px;
  color: #386191;
  cursor: pointer;
}
.checklist-back-btn:hover { text-decoration: underline; }

/* Tab bar overflow safety — 5 tabs may need horizontal scroll on narrow screens */
.job-tab-bar { overflow-x: auto; }
.job-tab-bar::-webkit-scrollbar { display: none; }

/* ============================================
   Photo & Video Permission Checklist
   (Added 2026-04-30 for FEATURE 010 update)
   ============================================ */

.photoperm-progress {
  font-size: 12px;
  font-weight: 600;
  color: #7587a0;
  background: #eef1f5;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
  display: inline-block;
}

.photoperm-intro {
  font-size: 16px;
  font-weight: 700;
  color: #1f3247;
  margin: 6px 0 8px;
}

.photoperm-body {
  font-size: 13px;
  color: #4a5868;
  line-height: 1.55;
  margin: 0 0 18px;
}

.photoperm-section-label {
  font-size: 13px;
  font-weight: 600;
  color: #7587a0;
  margin-bottom: 8px;
}

.photoperm-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eef1f5;
  font-size: 14px;
  color: #1f3247;
  cursor: pointer;
}
.photoperm-checkbox-row:last-of-type { border-bottom: none; margin-bottom: 18px; }

.photoperm-checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: #6cc518;
  border: 2px solid #6cc518;
  border-radius: 4px;
  cursor: pointer;
}

.photoperm-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a5868;
  margin: 14px 0 6px;
}

.photoperm-required {
  font-size: 11px;
  color: #7587a0;
  margin: 4px 0 0;
}

.photoperm-input,
.photoperm-textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: #1f3247;
  background: #fff;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  box-sizing: border-box;
}
.photoperm-input:focus,
.photoperm-textarea:focus { outline: none; border-color: #386191; }

.photoperm-textarea { resize: vertical; min-height: 64px; }

.photoperm-sig-wrap {
  position: relative;
  border: 2px dashed #e5ebf2;
  border-radius: 10px;
  height: 160px;
  margin-top: 4px;
  background: #fff;
  overflow: hidden;
}
.photoperm-sig-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.photoperm-sig-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #386191;
  background: rgba(255,255,255,0.9);
  border: 1px solid #d6dee8;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.photoperm-sig-clear:hover { background: #fff; border-color: #386191; }

/* ============================================
   Note Attachments
   (Added 2026-04-30 for FEATURE 010 update)
   ============================================ */

.note-input-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-note-attach {
  background: #fff;
  border: 1px solid #d6dee8;
  color: #386191;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-note-attach:hover { border-color: #386191; }

.note-staged-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.note-staged-attachments:empty { display: none; }

.note-staged-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 28px 6px 8px;
  background: #f4f6fa;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  font-size: 12px;
  color: #1f3247;
  max-width: 100%;
}
.note-staged-chip-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
}
.note-staged-chip-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex: 0 0 auto;
}
.note-staged-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-staged-chip-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(31,50,71,0.85);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
}
.note-staged-chip-remove:hover { background: #1f3247; }

/* Attachments rendered inside a saved note in the feed */
.note-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.note-attachment-thumb {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid #e5ebf2;
  overflow: hidden;
  position: relative;
  background: #f4f6fa;
  cursor: pointer;
}
.note-attachment-thumb img,
.note-attachment-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.note-attachment-thumb .video-play-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  pointer-events: none;
}

.note-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f4f6fa;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  text-decoration: none;
  color: #1f3247;
  font-size: 13px;
  max-width: 100%;
}
.note-attachment-file:hover { border-color: #386191; }
.note-attachment-icon { font-size: 18px; }
.note-attachment-name {
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-attachment-size {
  font-size: 11px;
  color: #7587a0;
}

/* Edit-mode markers — greyed-out attachment chip pending removal */
.note-attachments.edit-mode .note-attachment-thumb,
.note-attachments.edit-mode .note-attachment-file {
  position: relative;
}
.note-attachments.edit-mode .note-attachment-remove-mark {
  opacity: 0.4;
}
.note-attachment-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(200,55,55,0.9);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}
.note-attachment-remove-btn:hover { background: #C83737; }
.note-attachment-restore-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(108,197,24,0.9);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}
.note-attachment-restore-btn:hover { background: #6cc518; }

/* Edit-mode Attach button next to the note's text */
.note-edit-attach-btn {
  background: #fff;
  border: 1px solid #d6dee8;
  color: #386191;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
}
.note-edit-attach-btn:hover { border-color: #386191; }

/* ---- Chat composer overflow fix (multi-button row) ---- */
/* Without these, on ~360px viewports the [lightning][input][Send] flex row
   overflows the right edge — input's default min-width:auto (placeholder
   width) + Send's natural width + paddings sum past viewport, pushing Send
   off-screen. min-width:0 lets the input shrink first; flex-shrink:0 keeps
   Send at full size and visible. */
#screen-chat .chat-input-area input { min-width: 0; }
#screen-chat .btn-send { flex-shrink: 0; }

/* ===== Multi-day job — Day N/M pill (Task 11) ===== */
.day-pill {
  display: inline-block;
  background: #386191;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* iOS auto-zoom fix (added May 5 2026 for Amir's iPhone) — iOS Safari
   auto-zooms the page whenever a text input/textarea with declared
   font-size < 16px receives focus. Bumping these inputs to 16px keeps
   layout identical on Android/desktop while eliminating the iOS
   zoom-and-reflow glitch that shifted form fields around mid-edit.
   This rule is appended last so source order beats the original 14px
   declarations without modifying them. */
.form-input,
textarea.form-input,
.note-input-field,
.ci-input,
.inv-resend-input,
.inv-disc-input,
.ct-search-input,
.chip-add-input,
.chat-input-area input,
.inspection-notes textarea {
  font-size: 16px;
}

/* ============================================================
 * Home screen — Account section (Sign Out button)
 * Added May 12 2026. Sits below Quick Access. Subtle red border
 * styling so it's visually de-emphasized vs. the primary nav
 * cards but still clearly an actionable danger button.
 * ============================================================ */
.home-account-section {
  margin-top: 24px;
  margin-bottom: 16px;
}

.home-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 1.5px solid #C83737;
  border-radius: 12px;
  color: #C83737;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.home-signout-btn:active {
  background: rgba(200, 55, 55, 0.08);
  transform: scale(0.99);
}

.home-signout-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  transform: rotate(180deg);
}

.home-signout-label {
  line-height: 1;
}

/* ============================== */
/* Tap-to-Edit Line Item (Jun 1 2026) */
/* ============================== */

.svc-edit-hint {
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  color: #8a96a6;
  margin-left: 8px;
  letter-spacing: 0;
}

.svc-item-editable {
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.svc-item-editable:active {
  background-color: #f4f8ff;
}

.li-edit-label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.li-edit-input {
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  font-size: 16px; /* 16px to avoid iOS zoom-on-focus */
  color: #1a2233;
  background: #fff;
}
.li-edit-input:focus {
  outline: none;
  border-color: #386191;
  box-shadow: 0 0 0 3px rgba(56, 97, 145, 0.15);
}
.li-edit-input.invalid {
  border-color: #C83737;
  box-shadow: 0 0 0 3px rgba(200, 55, 55, 0.12);
}

.li-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.li-edit-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 12px 14px;
  background: #f4f8ff;
  border-radius: 8px;
  font-size: 14px;
  color: #386191;
  font-weight: 600;
}
.li-edit-preview strong {
  font-size: 18px;
  color: #146297;
}

/* ===========================================================
   Receipts screen + 7-tab bottom-nav (added 2026-06-07)

   The 7-tab overrides use the .bottom-nav prefix so they win
   on specificity over the original 6-tab .nav-item / .nav-label /
   .nav-icon rules without editing them (additive-only per
   CLAUDE.md). All Receipts-screen styles are namespaced under
   .rcpt-* or #screen-receipts.
   =========================================================== */

/* 7-tab bottom-nav overrides — make all labels fit comfortably
   on iPhone SE (375px / 53.5px per tab) when 7 tabs are present. */
.bottom-nav .nav-item { padding: 5px 2px; }
.bottom-nav .nav-label { font-size: 9px; letter-spacing: 0.25px; }
.bottom-nav .nav-icon { font-size: 20px; }

/* ---------- Receipts screen ---------- */
#screen-receipts {
  background: #f5f7fa;
}
#screen-receipts .screen-content {
  padding: 16px;
  padding-bottom: 80px;
}
.rcpt-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.rcpt-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

/* Capture zone */
.rcpt-capture-zone {
  border: 2px dashed #386191;
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  background: #f5f9fc;
  transition: background 0.15s;
}
.rcpt-capture-zone:active { background: #e8f0f7; }
.rcpt-capture-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.rcpt-capture-label { font-size: 14px; font-weight: 600; color: #386191; }

.rcpt-btn-gallery {
  margin-top: 10px;
  width: 100%;
  background: #fff;
  color: #386191;
  border: 1.5px solid #386191;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.rcpt-btn-gallery:active { background: #f5f9fc; }

.rcpt-preview-container {
  display: none;
  margin-top: 12px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.rcpt-preview-container.active { display: block; }
.rcpt-preview-container img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}
.rcpt-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
  padding: 0;
}

/* Form */
.rcpt-form-group { margin-top: 12px; }
.rcpt-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.rcpt-form-group input,
.rcpt-form-group select,
.rcpt-form-group textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #1a1a2e;
  background: #fff;
  box-sizing: border-box;
}
.rcpt-form-group textarea { min-height: 60px; resize: vertical; }
.rcpt-form-row { display: flex; gap: 10px; }
.rcpt-form-row .rcpt-form-group { flex: 1; }

.rcpt-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
}
.rcpt-btn-primary {
  background: #386191;
  color: #fff;
}
.rcpt-btn-primary:disabled { background: #b8c5d4; cursor: not-allowed; }
.rcpt-btn-outline {
  background: #fff;
  color: #386191;
  border: 1.5px solid #386191;
}

/* Success / error banners */
.rcpt-success-message,
.rcpt-error-message {
  display: none;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.rcpt-success-message.active { display: block; background: #e8f7d8; color: #4a7d18; }
.rcpt-error-message.active { display: block; background: #fce8e8; color: #C83737; }

/* OCR status banner */
.rcpt-ocr-banner {
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rcpt-ocr-reading { background: #e8f0f7; color: #386191; }
.rcpt-ocr-success { background: #e8f7d8; color: #4a7d18; }
.rcpt-ocr-manual { background: #fff4d8; color: #8a6d18; }
.rcpt-ocr-quality-warning { background: #fff4d8; color: #8a6d18; }
.rcpt-ocr-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #386191;
  border-top-color: transparent;
  border-radius: 50%;
  animation: rcpt-spin 0.8s linear infinite;
}
@keyframes rcpt-spin { to { transform: rotate(360deg); } }

/* Recent list */
.rcpt-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7280;
  font-size: 14px;
  padding: 12px 0;
}
.rcpt-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #386191;
  border-top-color: transparent;
  border-radius: 50%;
  animation: rcpt-spin 0.8s linear infinite;
}
.rcpt-empty-state {
  text-align: center;
  padding: 24px 0;
  color: #6b7280;
}
.rcpt-empty-icon { font-size: 28px; margin-bottom: 6px; }
.rcpt-receipt-list { list-style: none; padding: 0; margin: 0; }
.rcpt-receipt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f4;
  cursor: pointer;
}
.rcpt-receipt-item:last-child { border-bottom: none; }
.rcpt-receipt-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.rcpt-receipt-info { flex: 1; min-width: 0; }
.rcpt-receipt-vendor {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rcpt-receipt-meta { font-size: 12px; color: #6b7280; }
.rcpt-receipt-amount { font-size: 14px; font-weight: 700; color: #1a1a2e; }
.rcpt-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  vertical-align: 1px;
}
.rcpt-badge-pending { background: #fff4d8; color: #8a6d18; }
.rcpt-badge-approved { background: #e8f7d8; color: #4a7d18; }
.rcpt-badge-rejected { background: #fce8e8; color: #C83737; }
.rcpt-badge-archived { background: #e5e7eb; color: #6b7280; }

/* Monthly totals table */
.rcpt-monthly-totals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.rcpt-monthly-totals-table th,
.rcpt-monthly-totals-table td {
  padding: 6px 0;
  text-align: left;
}
.rcpt-monthly-totals-table th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.rcpt-monthly-amount { text-align: right !important; font-variant-numeric: tabular-nums; }
.rcpt-monthly-total-row td {
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
  font-weight: 700;
  color: #1a1a2e;
}

/* Edit modal */
.rcpt-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.rcpt-modal-overlay.active { display: flex; }
.rcpt-modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  padding: 20px;
  position: relative;
  margin-bottom: 24px;
}
.rcpt-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
}
.rcpt-modal-image {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  margin-bottom: 12px;
  display: block;
}
.rcpt-modal-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}
.rcpt-modal-actions .rcpt-btn { margin-top: 0; }

/* ===================================================================
   Admin internal-notes attachments (added Jun 12 2026).
   Rendered inside #jobInternalNotesCard. Photos/videos use the global
   .photo-thumb class so the existing lightbox auto-binds; this stanza
   only styles the doc-chip variant + the grid wrapper.
   =================================================================== */
.internal-attachments-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.internal-attachment-thumb {
  position: relative; width: 64px; height: 64px;
  border-radius: 8px; overflow: hidden; background: #e5edf7;
  cursor: pointer;
}
.internal-attachment-thumb img,
.internal-attachment-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.internal-attachment-thumb .thumb-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #fff; font-size: 22px; text-shadow: 0 0 4px rgba(0,0,0,0.7);
  pointer-events: none;
}
.internal-attachment-doc {
  display: flex; align-items: center; gap: 6px;
  background: #f4f8ff; border: 1px solid #dbe7f5; border-radius: 8px;
  padding: 6px 10px; font-size: 13px; color: #1a3a5c;
  text-decoration: none; max-width: 200px;
}
.internal-attachment-doc:hover { border-color: #386191; }
.internal-attachment-doc .doc-icon { font-size: 18px; }
.internal-attachment-doc .doc-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- Dryer Vent property-type toggle (Service Report) ------------------- */
.inv-report-proptype-row {
  padding: 10px 12px 12px;
  border-top: 1px dashed #e5e7eb;
  margin-top: 10px;
}
.inv-report-proptype-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: none;
  margin-bottom: 8px;
}
.inv-report-proptype-pills {
  display: flex;
  gap: 10px;
}
.inv-report-proptype-pill {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #d1d9e2;
  border-radius: 8px;
  background: #f8fafc;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.inv-report-proptype-pill:active {
  transform: scale(0.98);
}
.inv-report-proptype-pill.selected {
  background: #386191;
  color: #ffffff;
  border-color: #386191;
}

.inv-report-warning-banner {
  margin: 12px 12px 0;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1px solid #f5d47a;
  border-left: 4px solid #d4a017;
  border-radius: 8px;
  color: #8a6b0c;
  font-size: 13px;
  line-height: 1.5;
  font-family: 'Poppins', sans-serif;
}

/* Value Add-on pill badge - rendered next to service name in job details service list
   and in the read-only Value Add-on tab. */
.svc-addon-badge {
  display: inline-block;
  background: #6cc518;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  letter-spacing: 0.3px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  line-height: 1.2;
}

/* Value Add-on prompt modal */
#addonPromptOverlay.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 16px;
}
#addonPromptOverlay.modal-overlay.is-visible { display: flex; }
.addon-prompt-card {
  background: #ffffff;
  border-radius: 12px;
  max-width: 320px;
  width: 100%;
  padding: 24px 20px 20px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.addon-prompt-skip {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  border-radius: 50%;
}
.addon-prompt-skip:hover { background: #f5f5f5; color: #333; }
.addon-prompt-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #111; }
.addon-prompt-item { margin: 0 0 18px; font-size: 14px; color: #666; }
.addon-prompt-actions { display: flex; flex-direction: column; gap: 10px; }
.addon-prompt-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.addon-prompt-yes { background: #6cc518; color: #ffffff; }
.addon-prompt-yes:hover { background: #5aad14; }
.addon-prompt-no { background: #e0e0e0; color: #111; }
.addon-prompt-no:hover { background: #d0d0d0; }

/* ============================================================
   Site Instructions card - tech job detail (read-only).
   Sibling to #jobInternalNotesCard. Client + property sections
   each hidden individually when empty; whole card hidden when
   both empty.
   ============================================================ */
.job-site-instructions-card {
  border-left: 3px solid var(--dd-green);
  background: rgba(108,197,24,0.05);
}
.site-instructions-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dd-blue);
  margin-bottom: 10px;
}
.ts-section { margin-bottom: 14px; }
.ts-section:last-child { margin-bottom: 0; }
.ts-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.ts-section-text {
  font-size: 14px;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 6px;
}
.ts-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ts-attachments-grid:empty { display: none; }
.addon-prompt-counter { margin: 12px 0 0; font-size: 12px; color: #999; text-align: center; }
