:root {
  /* First Quality Fire brand kit — locked tokens (v2 logo cleanup) */
  --ink: #2F2F31;
  --ink-2: #4a4a4d;
  --paper: #FAFAF7;
  --line: #e6e4dd;
  --fire: #E0582A;
  --mute: #8a8880;
  --dark-bg: #1a1a1c;
  --on-dark: #f1efe9;
  --on-dark-2: #bdbbb3;

  /* Legacy aliases kept so existing selectors still resolve. */
  --bg: #FAFAF7;
  --card: #ffffff;
  --border: #e6e4dd;
  --border-soft: #f0ede8;
  --text: #2F2F31;
  --muted: #8a8880;
  --brand: #E0582A;
  --brand-hover: #C44A20;
  --brand-soft: #FDEBE2;
  --charcoal: #2F2F31;
  --charcoal-hover: #1a1a1c;
  --danger: #dc2626;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Oswald', 'Helvetica Neue', Arial, sans-serif;
  --green: #10b981;
  --green-bg: #d1fae5;
  --green-txt: #065f46;
  --amber: #f59e0b;
  --amber-bg: #fef3c7;
  --amber-txt: #92400e;
  --blue: #3b82f6;
  --blue-bg: #dbeafe;
  --blue-txt: #1e40af;
  --red-bg: #fee2e2;
  --red-txt: #991b1b;
  --gray-bg: #f3f4f6;
  --gray-txt: #374151;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.4;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Login ─────────────────────────────────────────────── */
#login-screen {
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

.brand {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
  text-align: center;
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 4px 0 28px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 10px 0 6px;
}

.card label:first-child { margin-top: 0; }

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
}

textarea { resize: vertical; min-height: 90px; }

.err-msg {
  color: var(--red-txt);
  font-size: 13px;
  margin: 8px 0 0;
  min-height: 18px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  margin-top: 16px;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { background: var(--brand-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:active { background: var(--gray-bg); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  -webkit-tap-highlight-color: transparent;
}

.btn-back {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.hdr-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hdr-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
}

.tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ── Job list ──────────────────────────────────────────── */
.jobs-list {
  padding: 12px;
  flex: 1;
}

.job-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
}
.job-card:active { background: var(--gray-bg); }

.job-card.urgent {
  border-left: 3px solid var(--brand);
}

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

.job-num {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pill-pending      { background: var(--amber-bg); color: var(--amber-txt); }
.pill-assigned     { background: var(--blue-bg);  color: var(--blue-txt); }
.pill-in_progress  { background: var(--blue-bg);  color: var(--blue-txt); }
.pill-needs_return { background: var(--red-bg);   color: var(--red-txt); }
.pill-completed    { background: var(--green-bg); color: var(--green-txt); }
.pill-invoiced     { background: var(--green-bg); color: var(--green-txt); }
.pill-cancelled    { background: var(--gray-bg);  color: var(--gray-txt); }

.job-cust {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.job-addr {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.job-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.job-type {
  text-transform: capitalize;
}

.loading, .empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ── Detail ────────────────────────────────────────────── */
.detail-body {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.detail-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 90px;
}

.detail-value {
  font-size: 14px;
  text-align: right;
  word-break: break-word;
  flex: 1;
}

.detail-value.wrap { white-space: pre-wrap; text-align: left; }

.call-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.section-hdr {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.btn-complete {
  background: var(--green);
}
.btn-complete:active { background: #047857; }

@media (min-width: 600px) {
  .jobs-list, .detail-body { padding: 20px; max-width: 640px; margin: 0 auto; }
}

/* Additions to tech.css for clock banner, action buttons, timeline, modals.
   Append to existing tech.css — all class names are NEW, no collisions. */

/* ── Clock banner (sticky at top of list when clocked in) ───────────── */
.clock-banner {
  background: linear-gradient(90deg, #10b981, #059669);
  color: #fff;
  padding: 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  position: sticky;
  top: 52px;
  z-index: 9;
}
.clock-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.clock-banner-inner:active { background: rgba(0,0,0,0.08); }
.clock-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.95;
}
.clock-sub {
  font-size: 13px;
  margin-top: 2px;
  opacity: 0.9;
}
.clock-time {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.job-card.clocked {
  border-left: 3px solid var(--green);
  background: #f0fdf4;
}

/* ── Big action buttons on job detail ───────────────────────────────── */
.action-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-big {
  padding: 18px 16px;
  font-size: 17px;
  font-weight: 700;
  width: 100%;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn-big.btn-green { background: var(--green); color: #fff; }
.btn-big.btn-green:active { background: #047857; }
.btn-big.btn-red { background: var(--danger); color: #fff; }
.btn-big.btn-red:active { background: #b91c1c; }

/* ── Timeline on job detail ─────────────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.timeline li:last-child { border-bottom: none; }
.tl-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 64px;
  font-size: 12px;
}
.tl-type { flex: 1; font-weight: 500; }
.gps-dot {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.gps-ok   { background: var(--green-bg); color: var(--green-txt); }
.gps-warn { background: var(--amber-bg); color: var(--amber-txt); }
.gps-off  { background: var(--red-bg);   color: var(--red-txt); }
.gps-na   { background: var(--gray-bg);  color: var(--gray-txt); }

/* ── Modals ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: modal-fade 0.15s ease-out;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-slide 0.2s ease-out;
}
@keyframes modal-slide { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal-body {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.modal-body p { margin-bottom: 8px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  margin-top: 0;
}

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 16px; max-width: 440px; }
}

/* ── Photos ──────────────────────────────────────────────────────────── */
.photo-group-hdr {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.photo-count {
  background: var(--gray-bg);
  color: var(--gray-txt);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  margin-left: 6px;
  font-weight: 600;
  letter-spacing: 0;
}
.photo-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.photo-uploading { opacity: 0.55; pointer-events: none; }
.photo-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--gray-bg);
  flex-shrink: 0;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.photo-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #B91C1C;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  font-size: 16px;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-add {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.photo-add:active { background: var(--gray-bg); }
