/* ═══════════════════════════════════════════════════════════════════
SelfEstimator — Admin Console (Modernized)
Dark glass aesthetic matching the public view.
═══════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #0b0c0f;
  --bg-2: #111318;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.085);
  --border-hi: rgba(255, 255, 255, 0.18);
  --text: #f2f3f5;
  --text-dim: #9fa5b1;
  --text-faint: #5c6270;

  /* Workshop identity: amber = primary action (tools/garage), steel-blue = secondary/info */
  --accent: #f2994a;
  --accent-2: #f7b955;
  --accent-glow: rgba(242, 153, 74, 0.32);
  --info: #4fa8e0;
  --info-2: #7cc4ee;

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Ambient background ──────────────────────────────────────────── */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  width: 650px;
  height: 650px;
  top: -260px;
  left: -180px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.10;
}

.bg-glow-2 {
  width: 750px;
  height: 750px;
  bottom: -340px;
  right: -220px;
  background: radial-gradient(circle, var(--info) 0%, transparent 70%);
  opacity: 0.08;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Shell / layout ──────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Header ──────────────────────────────────────────────────────── */
/* The blur/background live on a ::before, not on `header` itself —
   `backdrop-filter` (like `transform`/`filter`) makes an element the
   containing block for any `position:fixed` descendant, which broke
   .primary-nav's fixed-to-viewport-bottom mobile tab bar below (it was
   fixing to the header's own box instead of the viewport). */
header {
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 24, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: -1;
}

header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

header .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #17110a;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 16px var(--accent-glow);
}

header h1 {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

header h1 strong {
  color: var(--accent-2);
  font-weight: 700;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(242, 153, 74, 0.2), rgba(79, 168, 224, 0.15));
  border: 1px solid rgba(242, 153, 74, 0.3);
  color: var(--accent-2);
  border-radius: 100px;
  padding: 3px 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Review-queue count (Phase 4.3 MVP) — polled every ~30s while Workshop
   is open, shown on the Search nav button since that's the review queue. */
.nav-badge {
  display: inline-block;
  margin-left: 5px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 100px;
  background: #d9534f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}

/* Primary destination pills, sit in the header next to the brand */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  margin-left: 12px;
}

.primary-nav .nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
  margin: 0;
  padding: 7px 16px;
  border: none;
  background: transparent;
  border-radius: 100px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--text-dim);
  font-weight: 600;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}

.primary-nav .nav-btn:hover {
  color: var(--text);
}

.primary-nav .nav-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17110a;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.primary-nav .nav-btn .ic { font-size: 14px; line-height: 1; }

/* ── Notifications bell (Phase 7) — a real dropdown list, replacing the
   passive-only Search-tab badge for the review queue. Deliberately plain
   CSS (position:relative/absolute), not a new modal system — matches how
   little UI machinery this app already has for a "click to reveal a
   small panel" interaction. ── */
.notif-bell-wrap {
  position: relative;
  margin-left: 8px;
}
.notif-bell-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}
.notif-bell-btn:hover { background: var(--surface-2); color: var(--text); }
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface, #1a1d24);
  /* --surface is a deliberately near-transparent rgba(255,255,255,0.035)
     tint (see :root) — everywhere else it's used, it's paired with this
     same blur to actually read as a solid frosted-glass card against the
     dark page behind it. This dropdown was missing that pairing, so it
     rendered essentially see-through (the var(--surface, fallback) hex
     fallback never applies — the variable IS defined, just to a barely-
     visible value) — flagged directly by the user as having no
     background color at all. */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5);
  z-index: 50;
}
.notif-dropdown-head {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.notif-empty { padding: 18px 14px; font-size: 13px; color: var(--text-dim); text-align: center; }
.notif-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--surface-2); }
.notif-row-title { font-size: 13px; font-weight: 600; }
.notif-row-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.header-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Kebab menu — only shown at narrow widths, see the mobile media query below */
.header-menu-btn {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  padding: 6px 12px;
  cursor: pointer;
}
.header-menu-btn:hover { background: var(--surface-2); color: var(--text); }

.header-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.15s;
}

.header-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Live system-health dot in the header — click opens Settings > System */
.health-dot-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 10px 5px 8px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}
.health-dot-btn:hover { background: var(--surface-2); color: var(--text); }
.health-dot-btn .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.2s;
}
.health-dot-btn .dot.ok { background: var(--success); box-shadow: 0 0 6px rgba(52,211,153,0.6); }
.health-dot-btn .dot.err { background: var(--danger); box-shadow: 0 0 6px rgba(248,113,113,0.6); }

/* ── Mobile header/nav ─────────────────────────────────────────────
   Below this width the header (brand + primary-nav + header-links)
   no longer fits in one row. Primary nav becomes a fixed bottom tab
   bar (same nav-btn elements, same switchTab() JS — just repositioned
   and restyled, not duplicated) below 760px; header-links collapse
   behind the kebab button into a dropdown starting at a separate,
   wider 1150px breakpoint (below) — these two used to share the same
   760px breakpoint, which left a real dead zone roughly between 760px
   and ~1000px where header-links' own content (the account badge +
   My Profile/Change Password/Log Out, whose combined width grows with
   a longer role name like "TECHNICIAN · GENERATION") no longer fit in
   one row but the kebab collapse hadn't kicked in yet — those buttons
   silently overflowed off the right edge of the viewport with no
   scrollbar and no visible fallback, confirmed live via Playwright at
   800/900px. Split into its own breakpoint so it collapses well before
   that overflow can happen, independent of when the bottom tab bar
   itself switches on. ── */
@media (max-width: 1150px) {
  .header-menu-btn { display: flex; align-items: center; justify-content: center; }

  .header-links {
    display: none;
    position: absolute;
    top: 54px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg-2, var(--bg));
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
    padding: 8px;
    box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.6);
    z-index: 150;
    min-width: 200px;
  }
  .header-links.open { display: flex; }
  .header-links a,
  .header-links .health-dot-btn,
  .header-links .btn {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  header { gap: 8px; }

  .primary-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    width: 100%;
    margin: 0;
    gap: 2px;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: rgba(17, 19, 24, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }
  .primary-nav .nav-btn {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    font-size: 10.5px;
    justify-content: center;
  }
  .primary-nav .nav-btn .ic { font-size: 18px; }

  .content { padding-bottom: 84px; }
}

/* ── Main layout (single-column — no sidebar in the workshop shell) ── */
.main-layout {
  display: flex;
  flex: 1;
  width: 100%;
}

/* ── Content ─────────────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 60px;
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.tab-panel {
  display: none;
  animation: fadeUp 0.4s var(--ease);
}

.tab-panel.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Settings IA: sidebar of groups + a tile grid per group + drill-in ──
   Replaced the old flat pill-tab subnav (kept in git history if a future
   session ever needs to see the "before") — see CLAUDE.md's Settings
   redesign section for the reasoning. .settings-subview's own show/hide
   contract (display:none / .active{display:block}) is completely
   unchanged; setSettingsTab() in app.js still drives it exactly as
   before, only how you *get to* a subview changed. */
.settings-hybrid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 65vh;
}
.settings-hy-rail { background: var(--bg-2); border-right: 1px solid var(--border); padding: 14px 10px; overflow-y: auto; }
.settings-hy-group-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 9px; font: 600 13px var(--font-ui); color: var(--text-dim);
  background: transparent; border: none; cursor: pointer; margin-bottom: 2px;
}
.settings-hy-group-btn .n { margin-left: auto; font: 700 10px var(--font-mono); color: var(--text-faint); }
.settings-hy-group-btn:hover { background: var(--surface-2); color: var(--text); }
.settings-hy-group-btn.on { background: rgba(242,153,74,.14); color: var(--accent); }
.settings-hy-group-btn.on .n { color: var(--accent); }
.settings-hy-content { padding: 22px 26px; overflow-y: auto; }
.settings-hy-crumb {
  display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12.5px;
  margin-bottom: 16px; cursor: pointer; width: fit-content;
}
.settings-hy-crumb:hover { color: var(--accent); }
.settings-hy-group-head { margin-bottom: 4px; }
.settings-hy-group-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.settings-hy-group-desc { color: var(--text-dim); font-size: 12.5px; margin-bottom: 18px; max-width: 560px; }
.settings-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.settings-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: .15s var(--ease); text-align: left;
  color: var(--text); font-family: inherit;
}
.settings-tile:hover { border-color: var(--border-hi); background: var(--surface-2); transform: translateY(-1px); }
.settings-tile-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); display: flex;
  align-items: center; justify-content: center; font-size: 19px; margin-bottom: 12px;
}
.settings-tile-title { color: var(--text); font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.settings-tile-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
.settings-tile-badge {
  display: inline-block; margin-top: 8px; font: 700 9.5px var(--font-ui); background: var(--danger);
  color: #2a0a0a; border-radius: 999px; padding: 2px 7px;
}

.settings-subview { display: none; animation: fadeUp 0.3s var(--ease); }
.settings-subview.active { display: block; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.4);
}

.card-head {
  background: linear-gradient(135deg, rgba(242, 153, 74, 0.10), rgba(79, 168, 224, 0.05));
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 15px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
}

.card-head .ic { font-size: 16px; }

.card-head .method {
  font-size: 10px;
  font-weight: 700;
  border-radius: 5px;
  padding: 3px 9px;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.m-post {
  background: linear-gradient(135deg, var(--success), #10b981);
  color: #fff;
}

.m-get {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17110a;
}

.card-body {
  padding: 22px;
}

/* ── Forms ───────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;
}

.form-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.pct-adjust-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pct-adjust-row > label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 13px; }
.pct-adjust-controls { display: flex; gap: 8px; align-items: center; }

/* Grid stretches every cell in a row to the tallest cell's height, but a
   two-line label (e.g. "Public Kiosk — Allow Paid Parts Vendor") otherwise
   pushes just its own input down further than a neighbor with a one-line
   label. Pinning each field's content to the bottom of its cell keeps every
   input/select in a row on the same baseline regardless of label length. */
.form-grid > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.optional-tag {
  text-transform: none;
  font-weight: 400;
  color: var(--text-faint);
  letter-spacing: 0;
  margin-left: 4px;
}

input[type=text],
input[type=number],
input[type=email],
input[type=password],
input[type=date],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  color-scheme: dark;
  transition: all 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(242, 153, 74, 0.05);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

/* File inputs default to the browser's own unstyled button ("Choose
   File") which clashes with every other themed button — restyle just
   the button part via ::file-selector-button, keeping the native
   picker/filename text behavior intact. */
input[type="file"] {
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: var(--font-ui);
}
input[type="file"]::file-selector-button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 13px;
  margin-right: 10px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
input[type="file"]::file-selector-button:hover {
  border-color: var(--border-hi);
  color: var(--text);
  background: var(--surface-3);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9aab' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

select option {
  background: #1a1a24;
  color: var(--text);
}

/* ── Drop zone ───────────────────────────────────────────────────── */
.drop-zone {
  border: 1.5px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  background: rgba(255, 255, 255, 0.015);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(242, 153, 74, 0.06);
}

.drop-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone .dz-text {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 6px;
}

/* Low-resolution rejection — lives inside the dropzone itself, not a
   toast/panel elsewhere on the page, so it can't be missed or time out
   before the technician reads it. */
.dz-reject-msg {
  font-size: 12.5px;
  color: var(--warning);
  margin-top: 10px;
  padding: 9px 12px;
  background: rgba(251,191,36,0.1);
  border-radius: 8px;
  border: 1px solid rgba(251,191,36,0.3);
  text-align: left;
}

/* Parts & Materials — advisory note that AI evidence-photo crops can be
   imprecise, pointing at the existing "Replace Photo" flow. Same inline,
   can't-miss-it placement convention as .dz-reject-msg above, info tint
   (not warning) since this isn't flagging an error on this specific
   estimate — it's general guidance shown on every estimate. */
.parts-photo-note {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding: 9px 12px;
  background: rgba(79, 168, 224, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(79, 168, 224, 0.25);
  text-align: left;
  line-height: 1.5;
}

.parts-photo-note strong {
  color: var(--info-2);
}

.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.preview-item {
  position: relative;
  width: 94px;
}

.preview-item img {
  width: 94px;
  height: 72px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--border);
  display: block;
  background: #000;
}

.preview-item select {
  width: 100%;
  font-size: 10px;
  padding: 3px 5px;
  margin-top: 4px;
  border-radius: 6px;
}

.remove-img {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  border: 2px solid var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.remove-img:hover {
  transform: scale(1.1);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s var(--ease);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px -6px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 26px -6px var(--accent-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px -6px var(--accent-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #10b981);
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(52, 211, 153, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #ef4444);
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(248, 113, 113, 0.4);
}

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-hi);
  color: var(--text);
  background: var(--surface-3);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── Result stats ────────────────────────────────────────────────── */
.result-summary,
.cost-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  transition: border-color 0.15s;
}

.stat-box:hover {
  border-color: var(--border-hi);
}

.stat-box .val {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.stat-box .lbl {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.severity-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sev-none {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.sev-minor {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.sev-moderate {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.sev-severe {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.sev-total_loss {
  background: var(--danger);
  color: #fff;
}

/* ── Parts table ─────────────────────────────────────────────────── */
.parts-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

table.parts-tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.parts-tbl th {
  background: var(--surface-3);
  color: var(--text-dim);
  padding: 10px 12px;
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.parts-tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.parts-tbl tr:last-child td {
  border-bottom: none;
}

.parts-tbl tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.parts-tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chip-repair {
  background: rgba(79, 168, 224, 0.12);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

.chip-replace {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

.chip-no_work {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

.chip-inspect {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

.chip-rate-override {
  background: rgba(242, 153, 74, 0.16);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.chip-rate-default {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.chip-manual-op {
  background: rgba(167, 139, 250, 0.14);
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: capitalize;
}

/* ── Cost tables ─────────────────────────────────────────────────── */
.cost-line-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cost-line-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.cost-line-table tr:last-child td {
  border-bottom: none;
}

.cost-line-table thead th {
  background: var(--surface-3);
  color: var(--text-dim);
  padding: 10px 14px;
  font-size: 10.5px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.cost-line-table thead th.num {
  text-align: right;
}

.cost-line-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cost-line-table .subtotal td {
  background: rgba(242, 153, 74, 0.06);
  font-weight: 600;
  color: var(--text);
}

.cost-line-table .grand-total td {
  background: linear-gradient(135deg, rgba(242, 153, 74, 0.18), rgba(79, 168, 224, 0.1));
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-head);
}

.tl-banner {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  color: var(--text);
}

.tl-banner .icon {
  font-size: 18px;
  flex-shrink: 0;
}

.tl-banner strong {
  color: var(--danger);
}

/* ── Rate table ──────────────────────────────────────────────────── */
.rate-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-end;
}

/* Fix for Estimate Browser search bar - give input reasonable width */
#br-search {
  flex: 0 1 380px;
  min-width: 250px;
}

#br-state {
  flex: 0 1 200px;
  min-width: 150px;
}

/* #br-vin/#br-claim previously fell through to the generic
   ".rate-search-bar input { flex: 1 }" rule below with no min-width, and
   the bar had no flex-wrap — on a typical viewport the two fixed-width
   fields above already claim most of the row, so these two got squeezed
   down to near their content minimum and rendered more like buttons than
   text inputs. flex-wrap above lets the bar drop to a second line instead
   of crushing them once space runs out. */
#br-vin,
#br-claim {
  flex: 0 1 200px;
  min-width: 160px;
}

.rate-search-bar input {
  flex: 1;
}

#rate-table-wrap {
  overflow-x: auto;
  max-height: 560px;
  overflow-y: auto;
  border-radius: var(--radius);
}

/* Estimate Browser and Users tables are the same wide .rate-tbl pattern
   (white-space: nowrap cells) but weren't given a scrolling wrapper, so
   trailing columns — notably the row action button — were clipped off the
   right edge of the card with no way to reach them. */
#br-results-wrap,
#users-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

table.rate-tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rate-tbl th {
  background: var(--surface-3);
  color: var(--text-dim);
  padding: 10px 14px;
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}

.rate-tbl th.num,
.rate-tbl td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rate-tbl td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* Row action column (Open/Delete, Reset PW/Disable/Delete, etc.) pinned to
   the right edge of the scroll container — overflow-x:auto alone leaves the
   actions reachable only by scrolling, with zero visual hint that there's
   more to the right, so in practice they read as "missing" rather than
   "off-screen". Sticky keeps them on screen regardless of scroll position. */
.rate-tbl td.sticky-actions {
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -8px 0 12px -8px rgba(0, 0, 0, 0.4);
}
.rate-tbl tbody tr:hover td.sticky-actions {
  background: var(--surface-2);
}
.rate-tbl th.sticky-actions {
  position: sticky;
  right: 0;
  z-index: 3; /* above both the plain sticky header (z-index 2) and sticky body cells */
}

.rate-tbl tr:last-child td {
  border-bottom: none;
}

.rate-tbl tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.edit-row-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.edit-row-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

/* ── Health ──────────────────────────────────────────────────────── */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.health-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s;
}

.health-card:hover {
  border-color: var(--border-hi);
}

.health-card .hk {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.health-card .hv {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
}

.hv.ok {
  color: var(--success);
}

.hv.warn {
  color: var(--warning);
}

.hv.err {
  color: var(--danger);
}

/* ── Toast ───────────────────────────────────────────────────────── */
#toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 15, 23, 0.9);
  backdrop-filter: blur(20px);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 12.5px;
  max-width: 340px;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  animation: tIn 0.25s var(--ease);
  pointer-events: auto;
}

.toast.ok {
  border-left-color: var(--success);
}

.toast.err {
  border-left-color: var(--danger);
}

.toast.wrn {
  border-left-color: var(--warning);
}

@keyframes tIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Misc ────────────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.id-pill {
  display: inline-block;
  background: rgba(242, 153, 74, 0.12);
  color: var(--accent-2);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 100px;
  cursor: pointer;
  user-select: all;
  border: 1px solid rgba(242, 153, 74, 0.25);
}

.id-pill:hover {
  background: rgba(242, 153, 74, 0.2);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Mode toggle (Photo Analysis / Fault Codes Only) ─────────────── */
.mode-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 20px;
  max-width: 460px;
}

.mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 100px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.mode-btn:hover { color: var(--text); }

.mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17110a;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ── Quick-open-by-ID box (Search view) ──────────────────────────── */
.quick-open-box {
  display: flex;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
  align-items: flex-end;
}

.quick-open-box .field { flex: 1; }
.quick-open-box label { margin-bottom: 6px; }

/* ── Collapsible damage report (Workbench results) ───────────────── */
.collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 20px;
  overflow: hidden;
}

.collapsible-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
}

.collapsible-head .chev {
  margin-left: auto;
  transition: transform 0.2s var(--ease);
  color: var(--text-faint);
  font-size: 12px;
}

/* Direct-child combinators (not descendant) — a .collapsible can nest
   another .collapsible (e.g. "Parts Sourcing" inside "Vehicle Photos"),
   and these must only react to their OWN .open, not an ancestor's. */
.collapsible.open > .collapsible-head .chev { transform: rotate(180deg); }

.collapsible-body {
  display: none;
  padding: 4px 18px 18px;
  border-top: 1px solid var(--border);
}

.collapsible.open > .collapsible-body { display: block; }

/* ── Empty state ──────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-faint);
}

.empty-state .es-icon { font-size: 34px; margin-bottom: 10px; opacity: 0.7; }
.empty-state .es-title { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.empty-state .es-sub { font-size: 12.5px; }

/* ── Progress track (pipeline SSE) ───────────────────────────────── */
.progress-track {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 8px;
  position: relative;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.progress-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 44px;
  bottom: -4px;
  width: 2px;
  background: var(--border);
}

.progress-step.done::after {
  background: linear-gradient(to bottom, var(--success), rgba(52, 211, 153, 0.3));
}

.progress-step.active::after {
  background: linear-gradient(to bottom, var(--accent), rgba(242, 153, 74, 0.3));
}

.step-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  z-index: 1;
  transition: all 0.25s var(--ease);
}

.progress-step.done .step-icon {
  background: linear-gradient(135deg, var(--success), #10b981);
  border-color: transparent;
  color: #fff;
}

.progress-step.active .step-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  animation: pulse 1.4s ease infinite;
}

.progress-step.error .step-icon {
  background: linear-gradient(135deg, var(--danger), #ef4444);
  border-color: transparent;
  color: #fff;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(242, 153, 74, 0.5);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(242, 153, 74, 0);
  }
}

.step-body {
  flex: 1;
  padding-top: 5px;
  min-width: 0;
}

.step-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.step-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
}

.step-elapsed {
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  float: right;
}

.progress-step.done .step-label {
  color: var(--success);
}

.progress-step.active .step-label {
  color: var(--accent-2);
}

.progress-step.error .step-label {
  color: var(--danger);
}

/* ── Persistent error panel ──────────────────────────────────────── */
.error-panel {
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.error-panel-head {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(239, 68, 68, 0.12));
  color: var(--text);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.error-panel-head span:first-child {
  color: var(--danger);
}

.error-dismiss {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.error-dismiss:hover {
  background: rgba(255, 255, 255, 0.15);
}

.error-panel-msg {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.error-panel-detail {
  margin: 0 14px 14px;
  padding: 12px 14px;
  background: #0a0a12;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow-y: auto;
  user-select: all;
}

/* ── Editable estimate UI ────────────────────────────────────────── */
.muted-sm {
  font-size: 11px;
  color: var(--text-faint);
}

.num-strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.edited-banner {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 14px;
}

.edited-note {
  margin-top: 4px;
  font-style: italic;
  font-size: 11.5px;
  color: var(--warning);
}

/* Labor hours edit rows */
.labor-edit-wrap {
  margin-bottom: 10px;
}

.labor-edit-row {
  display: grid;
  grid-template-columns: 140px 1fr 130px 110px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.labor-edit-row.subtotal-row {
  border-bottom: none;
  border-top: 1.5px solid var(--border-hi);
  font-weight: 700;
  padding-top: 12px;
  margin-top: 6px;
}

.labor-edit-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.labor-edit-hours {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hr-step {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s;
}

.hr-step:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.hr-input {
  width: 68px;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  color: var(--text);
}

.hr-unit {
  font-size: 11px;
  color: var(--text-faint);
}

.labor-edit-rate {
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
}

.labor-edit-subtotal {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ADAS read-only rows */
.adas-edit-wrap {
  margin-bottom: 10px;
}

.adas-edit-row {
  display: grid;
  grid-template-columns: 1fr 220px 110px 36px;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.adas-edit-row.subtotal-row {
  border-bottom: none;
  border-top: 1.5px solid var(--border-hi);
  font-weight: 700;
  padding-top: 10px;
}

.adas-name-input,
.adas-location-input {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
}

.adas-name-input {
  font-weight: 700;
  width: 45%;
}

.adas-location-input {
  width: 45%;
  color: var(--text-dim);
}

/* Parts edit list — card-based */
.parts-edit-wrap,
.manual-lines-edit-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.part-card {
  display: grid;
  grid-template-columns: 1fr 110px 110px 100px;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: all 0.15s;
}

.part-card:hover {
  border-color: var(--border-hi);
  background: var(--surface-2);
}

.part-card.editing {
  display: block;
  background: rgba(242, 153, 74, 0.06);
  border-color: var(--accent);
}

.part-card-main {
  min-width: 0;
}

.part-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.part-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.part-card-total {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.part-card-source {
  text-align: center;
}

.part-card-thumb {
  width: 52px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-2);
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.photo-upload-row input[type="file"] {
  font-size: 11.5px;
  max-width: 180px;
}

.photo-thumb-preview {
  width: 44px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.intake-photo-thumb {
  position: relative;
  display: inline-block;
}

.intake-photo-thumb img {
  width: 84px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.intake-photo-thumb .icon-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--surface);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  line-height: 1;
  padding: 0;
}

.part-card-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: all 0.15s;
}

.icon-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.icon-btn.danger:hover {
  background: linear-gradient(135deg, var(--danger), #ef4444);
}

.ebay-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent-2);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(242, 153, 74, 0.3);
  border-radius: 100px;
  white-space: nowrap;
  background: rgba(242, 153, 74, 0.08);
  transition: all 0.15s;
}

.ebay-link-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

/* Part card — editing mode */
.part-card-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.pce-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pce-field input,
.pce-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
}

.part-card-actions {
  margin-top: 8px;
}

.chip-sourcing {
  background: rgba(167, 139, 250, 0.14);
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

.part-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.part-search-row select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
}

.part-search-row select option:disabled {
  color: var(--text-faint);
}

.parts-edit-subtotal-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  margin-top: 6px;
  background: rgba(242, 153, 74, 0.06);
  border: 1px solid rgba(242, 153, 74, 0.2);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Sticky save/discard bar */
.save-changes-bar {
  position: fixed;
  bottom: 0;
  left: 230px;
  right: 0;
  background: rgba(15, 15, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  color: var(--text);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, 0.6);
  z-index: 500;
}

.save-changes-msg {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.save-note-input {
  flex: 1;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
}

.save-note-input::placeholder {
  color: var(--text-faint);
}

.save-note-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(242, 153, 74, 0.05);
}

@media (max-width: 900px) {
  .save-changes-bar {
    left: 0;
    flex-wrap: wrap;
  }

  .part-card {
    grid-template-columns: 1fr;
  }

  .part-card-total,
  .part-card-source,
  .part-card-actions {
    text-align: left;
    justify-content: flex-start;
  }
}

/* ── OBD / Fault Code UI ─────────────────────────────────────────── */
.obd-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 44px;
  margin-bottom: 10px;
  cursor: text;
  transition: border-color 0.15s;
}

.obd-chip-wrap:focus-within {
  border-color: var(--accent);
  background: rgba(242, 153, 74, 0.04);
}

.obd-chip-wrap.obd-required {
  border-color: rgba(242, 153, 74, 0.4);
}

.obd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.obd-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.obd-chip.confirmed {
  background: linear-gradient(135deg, var(--success), #22c55e);
}

.obd-chip-confirm-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  line-height: 1;
}

.obd-chip-confirm-toggle:hover {
  color: #fff;
}

.obd-chip.confirmed .obd-chip-confirm-toggle {
  color: #fff;
}

.obd-chip-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
}

.obd-chip-remove:hover {
  color: #fff;
}

.obd-chip-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  min-width: 180px;
  flex: 1;
  font-family: var(--font-ui);
  color: var(--text);
}

.obd-chip-input::placeholder {
  color: var(--text-faint);
}

.obd-code-browser {
  margin-bottom: 14px;
}

.obd-chip-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin: -4px 0 10px;
}

/* Vision cross-reference verdicts shown on the Analyze tab */
.obd-assessment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.obd-assessment-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
}

.obd-assessment-row.confirmed {
  border-left: 3px solid var(--success);
}

.obd-assessment-row.pending {
  border-left: 3px solid var(--warning);
}

.obd-assessment-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
  min-width: 70px;
}

.obd-assessment-body {
  flex: 1;
}

.obd-assessment-reasoning {
  color: var(--text-dim);
  margin-top: 2px;
}

.code-browser-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
}

.code-suggestion {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  transition: all 0.12s;
  color: var(--text-dim);
}

.code-suggestion:hover {
  background: rgba(242, 153, 74, 0.1);
  color: var(--text);
}

.code-suggestion strong {
  font-family: var(--font-mono);
  color: var(--accent-2);
}

/* Make/Model dropdown-first pickers (Workbench Vehicle Information) —
   absolutely positioned under the field rather than the OBD picker's
   inline .code-browser-grid, since these live inside a multi-column
   .form-grid and pushing sibling fields down when the list opens would
   be disruptive there. */
.vehicle-suggest-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 2px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.vehicle-suggest-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-dim);
}

.vehicle-suggest-item:hover {
  background: rgba(242, 153, 74, 0.1);
  color: var(--text);
}

/* OBD fault line cards */
.obd-fault-edit-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.obd-fault-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.obd-fault-row.obd-fault-pending {
  border-left-color: var(--warning);
}

.obd-fault-row.obd-fault-confirmed {
  border-left-color: var(--success);
}

.obd-fault-note {
  font-size: 11.5px;
  font-style: italic;
  margin: -2px 0 10px;
  padding: 6px 10px;
  border-radius: 6px;
}

.obd-fault-note.pending {
  color: var(--warning);
  background: rgba(251, 191, 36, 0.08);
}

.obd-fault-note.confirmed {
  color: var(--success);
  background: rgba(52, 211, 153, 0.08);
}

.obd-fault-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.obd-fault-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.obd-fault-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 3px 10px;
  border-radius: 7px;
}

.obd-fault-system {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--surface-3);
  padding: 3px 9px;
  border-radius: 100px;
}

.obd-fault-confidence {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  margin-left: auto;
}

.obd-conf-high {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.obd-conf-medium {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
}

.obd-conf-low {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.obd-conf-pending_inspection {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
}

.obd-conf-manual {
  background: rgba(79, 168, 224, 0.15);
  color: var(--accent-2);
}

.obd-fault-desc {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.obd-fault-op {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.obd-fault-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.obd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.obd-field label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.obd-field-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.obd-field-total {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
  min-width: 85px;
}

/* Inline OBD section inside main estimate view */
.obd-inline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.obd-inline-row {
  display: grid;
  grid-template-columns: 160px 1fr 110px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
}

.obd-inline-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.obd-inline-total {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-head);
  color: var(--accent-2);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .sidebar {
    width: 200px;
  }

  .save-changes-bar {
    left: 200px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .save-changes-bar {
    left: 0;
  }

  .content {
    padding: 20px;
  }
}

/* Drop zone visual feedback when images are uploaded */
.dropzone.has-images {
  padding: 18px;
  text-align: left;
  cursor: default;
  background: var(--surface);
  /* Use the theme's surface color */
  border-style: solid;
  border-color: var(--border-hi);
}

.drop-zone.has-images:hover {
  border-color: var(--accent);
  background: var(--surface);
}

/* ── Login overlay ─────────────────────────────────────────────────
   Stays fully opaque so the app-shell underneath (always in the DOM,
   never itself hidden pre-auth) doesn't leak through — but nests its
   own copy of the ambient glow/grid treatment (same classes the main
   shell and Public kiosk hero use) so it isn't a flat, bare screen. ── */
#login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 20px;
  background: var(--bg);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.login-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 28px var(--accent-glow);
}

.login-brand-name {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}
.login-brand-name strong { color: var(--accent-2); font-weight: 700; }

.login-card {
  width: min(380px, 100%);
}

.login-error {
  margin-top: 10px;
  font-size: 13px;
  color: var(--danger);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
}

/* ── Landing page (eadjustor.com's default, unauthenticated view) ─────────
   Same "always in the DOM, sits above .app-shell" pattern #login-overlay
   already uses — z-index 9000, deliberately below both #login-overlay
   (9999) and .modal-overlay (9998) so a future modal opened from this
   page (there isn't one today, but nothing here should assume that
   stays true forever) would still layer correctly on top. ── */
#landing-page {
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow-y: auto;
  background: var(--bg);
}

/* Photo band wrapping nav + hero only — same "real photo behind the
   headline, confined to the hero, everything below stays on the flat
   surface" technique customer-portal-web's own landing hero already
   uses (see CLAUDE.md's "Landing hero" section), ported to this app's
   dark/orange theme instead of that one's navy. .landing-nav/.landing-hero
   keep the z-index:1 they already had — that's what lifts them, and the
   band itself, above the page-level fixed .bg-glow/.bg-grid layers (z-index
   0) sitting underneath everything. Internally the photo sits at z-index 0
   and the tint scrim at z-index 1, both *below* nav/hero's z-index 1... */
.landing-hero-band {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('marketing/hero-workshop.jpg');
  background-size: cover;
  background-position: center 38%;
  opacity: 0.5;
}

/* Directional scrim, not a flat tint — darkest at the very top (behind
   the nav bar, which has no button/pill backdrop of its own to lean on)
   and fading to fully var(--bg) by the band's bottom edge, so the seam
   into .landing-stats below (flat var(--bg), untouched) is invisible. */
.hero-photo-tint {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(11,12,15,0.78) 0%, rgba(11,12,15,0.55) 38%, rgba(11,12,15,0.82) 78%, var(--bg) 100%);
}

.landing-hero-band .landing-nav,
.landing-hero-band .landing-hero { position: relative; z-index: 1; }

.landing-eyebrow,
.landing-headline,
.landing-subhead {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.landing-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-brand { display: flex; align-items: center; gap: 12px; }

.landing-brand-name {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}
.landing-brand-name strong { color: var(--accent-2); font-weight: 700; }

.landing-nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}
.landing-nav-links a { color: inherit; text-decoration: none; transition: color 0.15s var(--ease); }
.landing-nav-links a:hover { color: var(--text); }

@media (max-width: 720px) {
  .landing-nav-links { display: none; }
}

.landing-hero {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(56px, 10vw, 110px) 24px clamp(40px, 6vw, 64px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.landing-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent-2);
}

.landing-headline {
  font-family: var(--font-head);
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--text);
  text-wrap: balance;
}

.landing-subhead {
  font-size: clamp(14.5px, 1.6vw, 16.5px);
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 620px;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.btn-lg { padding: 14px 26px; font-size: 14.5px; border-radius: var(--radius); }

.landing-stats {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}

.landing-stat-num {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-stat-label {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .landing-stats { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
}

.landing-section-title {
  font-family: var(--font-head);
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 36px;
}

.landing-features, .landing-how {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 900px) {
  .landing-feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .landing-feature-grid { grid-template-columns: 1fr; }
}

.landing-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.landing-feature-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

.landing-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: linear-gradient(135deg, rgba(242, 153, 74, 0.16), rgba(79, 168, 224, 0.1));
  margin-bottom: 12px;
}

.landing-feature-card h3 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

.landing-feature-card p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

.landing-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 760px) {
  .landing-steps { grid-template-columns: repeat(2, 1fr); }
}

.landing-step { text-align: center; }

.landing-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.landing-step h4 {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.landing-step p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 0;
}

.landing-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}

@media (max-width: 520px) {
  .landing-footer { flex-direction: column; text-align: center; }
}

/* ── Replace-photo modals (source picker + crop editor) ─────────────── */
.photo-source-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-source-btn {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.original-photo-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.original-photo-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 92px;
  padding: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.original-photo-option:hover {
  border-color: var(--accent);
}

.original-photo-option.current {
  border-color: var(--accent);
  background: rgba(242, 153, 74, 0.12);
}

.original-photo-option img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-2);
}

.original-photo-option span {
  font-size: 10px;
  text-align: center;
}

/* Soft-excluded original photo (see app.js's loadSubmittedPhotos()/
   choosePhotoSourceOriginal() — a customer removed it from AI re-analysis
   via the post-payment regenerate flow, without deleting it). Dimmed +
   tagged, never omitted or disabled — still fully clickable in both the
   read-only gallery (zoom) and the crop-source picker (still valid
   evidence for a manual crop, just not fed to the vision model). */
.original-photo-option.excluded-from-analysis img { opacity: 0.4; filter: grayscale(70%); }
.excluded-badge {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #f2994a;
  background: rgba(242, 153, 74, 0.14);
  border: 1px solid rgba(242, 153, 74, 0.35);
  border-radius: 3px;
  padding: 1px 4px;
  text-align: center;
}

.submitted-photos-block { margin-bottom: 14px; }
.submitted-photos-label { font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--muted, #999); text-transform: uppercase; letter-spacing: 0.03em; }
/* Clickable, unlike .original-photo-option's own default cursor:pointer
   crop-source use — same visual language, distinct purpose (open the
   lightbox, not pick a crop source), so no .current/selected state here. */
.submitted-photos-block .original-photo-option { cursor: zoom-in; }

.photo-lightbox-card { width: min(920px, 94vw); }
.lightbox-img-wrap {
  width: 100%;
  max-height: 75vh;
  overflow: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2, #000);
  text-align: center;
  cursor: zoom-in;
}
.lightbox-img-wrap.zoomed { cursor: zoom-out; text-align: left; }
#photo-lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  display: inline-block;
  user-select: none;
}
.lightbox-img-wrap.zoomed #photo-lightbox-img { max-height: none; }
.lightbox-controls { flex-wrap: wrap; justify-content: center; }

/* Was reusing .login-card (width: min(380px, 100%)) — its own inline
   max-width:640px override was a no-op (max-width only clamps a width
   down, never expands it past a smaller `width`), so the crop image
   rendered far smaller than the source photo regardless of resolution —
   a real problem when cropping a small part like a door handle. This
   dedicated class gives the crop editor real room to work with. */
.photo-crop-card {
  width: min(920px, 94vw);
}

.photo-crop-canvas-wrap {
  position: relative;
  width: 100%;
  max-height: 75vh;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2, #000);
  touch-action: none;
  cursor: crosshair;
}

#photo-crop-img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.photo-crop-selection {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(242, 153, 74, 0.2);
  pointer-events: none;
}
/* ── Production readiness banner (top of every Workshop tab) ── */
.readiness-banner {
  position: sticky;
  top: 0;
  z-index: 500;
  background: #7f1d1d;
  color: #fee2e2;
  padding: 10px 20px;
  font-size: 13px;
  line-height: 1.5;
  border-bottom: 2px solid var(--danger, #f87171);
}
.readiness-banner strong { color: #fff; }
.readiness-banner ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.readiness-banner li { margin-bottom: 2px; }
.readiness-banner li.warning { color: #fde68a; }

/* ── Payment incidents list ── */
.incident-row {
  border: 1px solid var(--border, #333);
  border-left: 4px solid var(--danger, #f87171);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.incident-row.resolved { border-left-color: var(--muted, #666); opacity: 0.6; }
.incident-row .incident-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.incident-row .incident-type {
  font-family: monospace;
  font-size: 12px;
  color: var(--muted, #999);
}
.incident-row .incident-message { margin: 6px 0; }
.incident-row .incident-detail {
  font-family: monospace;
  font-size: 11px;
  color: var(--muted, #999);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2, #000);
  padding: 8px;
  border-radius: 4px;
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
}

/* ══════════════════════════════════════════════════════════════════
   Dashboard (admin-only landing tab) — see routers/dashboard.py for
   the backing endpoint. Namespaced dash-* throughout to avoid any
   collision with existing .card/.stat-box/etc, which have their own
   established meaning elsewhere in this file.
   ══════════════════════════════════════════════════════════════════ */
.dash-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.dash-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.dash-kpi .lbl { font-size: 11.5px; color: var(--text-dim); font-weight: 600; letter-spacing: .02em; margin-bottom: 8px; }
.dash-kpi .val { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.dash-kpi .delta { font-size: 12px; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.dash-kpi .delta.up { color: var(--success); } .dash-kpi .delta.down { color: var(--danger); } .dash-kpi .delta.flat { color: var(--text-dim); }
.dash-kpi.warn { border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.06); }
.dash-kpi.warn .val { color: var(--warning); }

.dash-chart-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-bottom: 14px; }
.dash-row2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 14px; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.dash-card-title { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; }
.dash-card-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; font-weight: 400; }
.dash-seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.dash-seg button { font: 600 11.5px var(--font-ui); color: var(--text-dim); background: transparent; border: none; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.dash-seg button.on { background: var(--accent); color: var(--bg); }
.dash-tt { position: absolute; pointer-events: none; background: #1a1d24; border: 1px solid var(--border-hi); border-radius: 8px; padding: 7px 10px; font-size: 11.5px; box-shadow: 0 8px 24px rgba(0,0,0,.5); opacity: 0; transition: opacity .1s; z-index: 5; white-space: nowrap; }
.dash-tt b { color: var(--text); font-family: var(--font-head); }
.dash-tt .dash-tt-sub { color: var(--text-dim); }
.dash-bar-rect { transition: opacity .1s; }
.dash-bar-rect:hover { opacity: .75; cursor: pointer; }

.dash-src-wrap { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.dash-src-row { display: flex; align-items: center; gap: 10px; }
.dash-src-label { width: 130px; font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.dash-src-track { flex: 1; height: 20px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.dash-src-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.dash-src-fill span { font: 700 11px var(--font-ui); color: #0b0c0f; }
.dash-src-count { width: 46px; text-align: right; font: 600 12px var(--font-mono); color: var(--text-dim); }

.dash-activity-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.dash-activity-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-item:hover { background: var(--surface-2); border-radius: 8px; }
.dash-act-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.dash-act-icon.review { background: rgba(251,191,36,.14); color: var(--warning); }
.dash-act-icon.paid { background: rgba(52,211,153,.14); color: var(--success); }
.dash-act-icon.unpaid { background: rgba(79,168,224,.14); color: var(--info); }
.dash-act-icon.incident { background: rgba(248,113,113,.14); color: var(--danger); }
.dash-act-body { flex: 1; min-width: 0; }
.dash-act-title { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-act-meta { font-size: 11px; color: var(--text-faint); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-act-time { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.dash-empty { padding: 20px 8px; text-align: center; color: var(--text-faint); font-size: 12.5px; font-style: italic; }
