:root {
  --bg: #08090d;
  --surface: #141820;
  --surface2: #1a1f2a;
  --text: #f3f4f6;
  --muted: #94a3b8;
  --accent: #a3e635;
  --accent2: #a3e635;
  --accent-hover: #bef264;
  --accent-dim: rgba(163, 230, 53, 0.12);
  --accent-glow: rgba(163, 230, 53, 0.25);
  --on-accent: #0a0a0a;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.45;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

html { background: var(--bg); }

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(163, 230, 53, 0.07), transparent),
    var(--bg);
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(56px + var(--safe-bottom));
}

#app:has(#dealer-nav:not(.hidden)) {
  padding-bottom: calc(110px + var(--safe-bottom));
}

#alerts-btn {
  white-space: nowrap;
}

#back-to-jobs-btn {
  margin: 0;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  white-space: nowrap;
}

#back-to-jobs-btn:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface2);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.logo { width: 40px; height: 40px; object-fit: contain; }
.brand-title { font-weight: 700; font-size: 1rem; color: var(--accent); }
.brand-sub { font-size: 0.75rem; color: var(--muted); }

#main {
  flex: 1;
  padding: 16px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

#main:has(#acct-body),
#main:has(#job-detail) {
  max-width: 960px;
}

#main:has(.home-grid),
#main:has(.dealers-layout),
#main:has(.dealer-menus),
#main:has(#bin-body),
#main:has(#schedule-body) {
  max-width: 1100px;
}

.bottom-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--surface);
}

.site-footer {
  padding: 8px 16px calc(8px + var(--safe-bottom));
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--surface2);
}

.site-footer p {
  margin: 0;
  line-height: 1.5;
}

.site-footer p + p {
  margin-top: 2px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card h2, .card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: 0.875rem; }

.price-quiet {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8125rem;
}

.proposed-work-list {
  margin: 0;
  padding-left: 1.15em;
}

.proposed-work-list li {
  margin: 0 0 4px;
}

.proposed-work-total {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  margin-bottom: 10px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea { min-height: 80px; resize: vertical; }

.password-field {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}

.grid-2 > .password-field {
  margin-bottom: 0;
}

.password-field input {
  margin-bottom: 0;
  padding-right: 4.25rem;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  min-height: 40px;
  z-index: 1;
}

.password-toggle:active {
  opacity: 0.75;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
}

.btn:not(.btn-ghost):not(.btn-success):not(.btn-danger):not(.btn-danger-outline):not(.btn-back):hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--surface2); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }
.btn-success { background: var(--success); color: #052e16; }
.btn-danger { background: var(--danger); color: #450a0a; }
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }

.btn.btn-back {
  padding: 8px 14px;
  font-size: 0.9rem;
  line-height: 1.2;
  margin-bottom: 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 600;
}

.btn.btn-back:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.job-sibling-nav {
  margin: 4px 0 14px;
  gap: 8px;
}

.job-sibling-nav .btn.btn-back {
  margin-bottom: 0;
}

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-actions .btn,
.job-form-actions .btn,
.upload-block .row .btn,
#add-line-item {
  min-height: 44px;
  min-width: 148px;
  padding: 10px 14px;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.status-actions #delete-job {
  margin-left: auto;
}

.upload-block .row .btn {
  flex: 1;
}

.dealer-list-row {
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.dealer-list-row strong {
  flex: 1;
  min-width: 0;
}

.dealer-list-row .remove-dealer-btn {
  flex-shrink: 0;
}

.dealer-card-info {
  min-width: 0;
  flex: 1;
}

.dealer-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.dealer-card-prices,
.dealer-card-contact {
  margin-top: 4px;
  font-size: 0.85rem;
}

.dealer-card-scan {
  margin-top: 8px;
}

.dealer-card-scan .row {
  flex-wrap: wrap;
  gap: 8px;
}

.dealer-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--surface2);
}

.dealer-edit-heading {
  margin: 14px 0 4px;
  font-size: 0.95rem;
}

.dealer-edit textarea {
  min-height: 72px;
}

.section-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.dealers-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: start;
}

.dealer-menus {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dealer-collapse {
  padding: 0;
}

.collapse-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.collapse-toggle:hover {
  color: var(--accent);
}

.collapse-panel {
  padding: 0 16px 16px;
  border-top: 1px solid var(--surface2);
}

.collapse-panel .list-cards {
  margin-top: 0.5rem;
}

#dealer-list-count:empty {
  display: none;
}

.field-label {
  display: block;
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.field-label input,
.field-label select,
.field-label textarea {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.field-label > label {
  display: block;
}

.phone-field {
  position: relative;
  display: block;
  margin-top: 0.35rem;
}

.field-label .phone-field input {
  margin-top: 0;
  margin-bottom: 0;
  padding-right: 3.6rem;
}

.phone-call-link {
  position: absolute;
  left: 0;
  right: 3.5rem;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow: hidden;
  white-space: nowrap;
  z-index: 1;
}

.phone-call-link[hidden],
.phone-field:not(.is-ready) .phone-call-link,
.phone-field.is-editing .phone-call-link {
  display: none !important;
  pointer-events: none;
}

.phone-edit-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  min-height: 40px;
  z-index: 2;
}

.phone-edit-btn[hidden] {
  display: none !important;
}

.phone-edit-btn:active {
  opacity: 0.75;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.form-grid.two { grid-template-columns: 1fr 1fr; }

.dealer-section {
  margin: 0.15rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--bg);
}

.dealer-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.dealer-section > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.dealer-section > summary::-webkit-details-marker {
  display: none;
}

.dealer-section > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
}

.dealer-section[open] > summary::before {
  content: "▾";
}

.dealer-section[open] > summary {
  margin-bottom: 0.45rem;
}

.dealer-section > summary + .muted {
  margin-top: 0.45rem;
}

.dealer-prices-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.dealer-price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  margin: 0;
}

.dealer-price-row span { font-size: 0.875rem; color: var(--text); }

.dealer-price-row input {
  width: 5.5rem;
  text-align: right;
  padding: 0.35rem 0.45rem;
  margin: 0;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.35rem;
}

.status-msg {
  min-height: 1.2rem;
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--accent);
}

.list-cards { display: flex; flex-direction: column; gap: 0.5rem; }

.list-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.list-card:hover {
  border-color: var(--accent);
}

.list-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
  background: var(--accent-dim);
}

.list-card-body { flex: 1; min-width: 0; }
.list-card-title { font-weight: 600; font-size: 0.9375rem; margin: 0; }
.list-card-meta { font-size: 0.8125rem; color: var(--muted); margin: 0.15rem 0 0; }
.list-card-chevron { color: var(--muted); font-size: 1.25rem; flex-shrink: 0; }

@media (max-width: 900px) {
  .dealers-layout,
  .form-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--surface2);
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.home-card:hover,
.home-card:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-dim);
  outline: none;
}

.home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
}

.home-icon svg { width: 22px; height: 22px; }

.home-card:hover .home-icon,
.home-card:focus-visible .home-icon {
  background: rgba(10, 10, 10, 0.12);
  color: var(--on-accent);
}

.home-card-body { display: flex; flex-direction: column; gap: 0.35rem; }
.home-card-body strong { font-size: 1.0625rem; font-weight: 600; }
.home-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.45; }

.home-card:hover .home-desc,
.home-card:focus-visible .home-desc {
  color: rgba(10, 10, 10, 0.68);
}

.home-metric {
  margin-top: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-dim);
}

.home-card:hover .home-metric,
.home-card:focus-visible .home-metric {
  background: rgba(10, 10, 10, 0.12);
  color: var(--on-accent);
}

.home-bin-link {
  margin: 1rem 0 0;
  text-align: right;
}

.home-bin-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-bin-btn:hover,
.home-bin-btn:focus-visible {
  color: var(--text);
  outline: none;
}

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
}

.job-list { display: flex; flex-direction: column; gap: 12px; }

.job-list .acct-dealer {
  background: var(--surface);
}

.job-list .jobs-dealer-head {
  background: rgba(163, 230, 53, 0.08);
}

.job-list .acct-dealer:has(.acct-dealer-body:not(.hidden)) .jobs-dealer-head {
  background: var(--accent-dim);
}

.job-list .acct-dealer:has(.acct-dealer-body:not(.hidden)) .acct-dealer-name {
  color: var(--accent);
}

.job-list .acct-dealer-body:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 10px 12px 18px;
  padding: 10px 10px 10px 14px;
  background: #08090d;
  border: 1px solid var(--surface2);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 10px;
}

.jobs-under-dealer {
  margin: 0 0 2px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}

.job-count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
}

.jobs-summary {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.dealer-stat-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.dealer-stat-link:hover {
  color: var(--accent-hover);
}

.dealer-added-card {
  width: min(100%, 420px);
  margin: 0;
}

.dealer-added-card h3,
.dealer-added-card .temp-pw-close {
  flex-shrink: 0;
}

.dealer-added-list {
  margin: 12px 0 16px;
  padding: 0 0 12px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  list-style: none;
}

.dealer-added-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dealer-added-list li:last-child {
  border-bottom: 0;
  padding-bottom: 16px;
}

.job-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.jobs-header-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.jobs-dealer-send {
  flex-shrink: 0;
  margin: 6px 10px 6px 0;
  min-height: 36px;
  white-space: nowrap;
}

.jobs-section {
  margin-bottom: 18px;
}

.jobs-section-sub {
  margin: 0 0 10px;
}

.jobs-search-card {
  margin-top: 8px;
}

.jobs-search-vehicle {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.jobs-search-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
}

@media (max-width: 700px) {
  .jobs-search-vehicle {
    grid-template-columns: 1fr 1fr;
  }
}

.jobs-search-clear-wrap {
  padding-bottom: 2px;
}

.jobs-search-summary {
  margin: 12px 0 8px;
}

@media (max-width: 960px) {
  .jobs-search-filters {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .jobs-search-filters {
    grid-template-columns: 1fr 1fr;
  }
}

.jobs-dealer-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.jobs-dealer-head .acct-dealer-head {
  flex: 1;
  min-width: 0;
}

.job-select {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  margin: 0;
  cursor: pointer;
}

.job-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent2);
}

.job-item-wrap .job-item {
  flex: 1;
}

.job-del-btn {
  flex-shrink: 0;
  width: 40px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.job-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.job-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.job-item-copy {
  flex: 1;
  min-width: 0;
}

.job-item-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--surface2);
}

.job-item-thumb-empty {
  display: block;
  box-sizing: border-box;
  border: 1px solid var(--border, var(--surface2));
}

.profile-pending-preview,
.sticker-pending-preview,
.worker-dl-preview {
  display: block;
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px;
  background: var(--surface2);
}

.worker-dl-preview {
  width: 220px;
  height: 140px;
  object-fit: contain;
}

.worker-dl-preview-btn {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.worker-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.worker-card-body {
  flex: 1;
  min-width: 0;
}

.worker-dl-thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--surface2);
}

.worker-dl-thumb-empty {
  display: block;
  box-sizing: border-box;
  border: 1px solid var(--border, var(--surface2));
}

.job-item-wrap.is-mine .job-item {
  border-color: var(--accent);
}

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending_approval { background: #422006; color: var(--warning); }
.status-approved { background: #052e16; color: var(--success); }
.status-in_progress { background: var(--accent-dim); color: var(--accent); }
.status-completed { background: #14532d; color: #86efac; }
.status-rejected { background: #450a0a; color: var(--danger); }
.status-draft { background: var(--surface2); color: var(--muted); }
.status-invoiced { background: #14532d; color: #86efac; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.photo-card,
#job-photos-sticker,
.upload-block,
[data-ocr] {
  scroll-margin-top: 76px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--surface2);
  background: var(--bg);
  position: relative;
}

.photo-view {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(8, 9, 13, 0.82);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.photo-taken-by {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 1;
  max-width: calc(100% - 8px);
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(8, 9, 13, 0.78);
  color: #fff;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

body:has(#photo-lightbox.open) .photo-thumb .photo-taken-by {
  display: none;
}

.photo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 16px 56px;
}

.photo-lightbox.open {
  display: flex;
}

.photo-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.photo-lightbox-frame {
  position: relative;
  max-width: 100%;
  max-height: calc(100vh - 80px);
}

.photo-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 8px;
}

.photo-lightbox-count {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.photo-lightbox-taken-by {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(8, 9, 13, 0.78);
  color: #fff;
  font-size: 8px;
  font-weight: 500;
  line-height: 1.15;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.print-photo {
  margin: 0 0 8px;
}

.print-photo figcaption {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.photo-lightbox-close,
.photo-lightbox-prev,
.photo-lightbox-next {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  z-index: 1;
}

.photo-lightbox-close {
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
}

.photo-lightbox-prev,
.photo-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.photo-lightbox-prev {
  left: 12px;
}

.photo-lightbox-next {
  right: 12px;
}

.photo-lightbox-prev:hover,
.photo-lightbox-next:hover,
.photo-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 480px) {
  .photo-lightbox {
    padding: 16px 44px;
  }

  .photo-lightbox-prev,
  .photo-lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }
}

.ready-banner {
  background: #422006;
  color: var(--warning);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 0.875rem;
}

.approved-banner {
  background: #052e16;
  color: var(--success);
}

.catalog-row {
  display: grid;
  grid-template-columns: 1fr minmax(100px, 120px) auto;
  gap: 8px;
  align-items: center;
}

.dealer-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.user-manage-row {
  border-top: 1px solid var(--surface2);
  padding: 10px 0;
}

.user-manage-row:first-child {
  border-top: none;
}

.user-manage-view {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.user-manage-info {
  flex: 1;
  min-width: 0;
}

.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.history-section-title {
  margin: 20px 0 8px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-section-title:first-of-type {
  margin-top: 12px;
}

@media (max-width: 480px) {
  .catalog-row {
    grid-template-columns: 1fr;
  }
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-video-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  background: #0c1018;
  color: #e5e7eb;
  font-size: 0.78rem;
  font-weight: 600;
}

.photo-video-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.85rem;
  padding-left: 2px;
}

.photo-lightbox video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  border-radius: 8px;
  background: #000;
}

.upload-zone {
  border: 2px dashed var(--surface2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
}

.upload-zone input { display: none; }

.upload-block {
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.upload-block-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.dealer-typeahead {
  position: relative;
}

.dealer-suggestions {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
}

.dealer-typeahead .dealer-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 8;
  margin: 4px 0 0;
}

.dealer-suggestions.hidden { display: none; }

.dealer-suggestion-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.dealer-suggestion-item:hover,
.dealer-suggestion-item.is-best {
  background: var(--surface2);
}

.line-items { margin-top: 8px; }
.line-item-row {
  display: grid;
  grid-template-columns: 1fr 100px 36px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.line-item-row input { margin-bottom: 0; }

.card > .js-save-job {
  margin-top: 10px;
}

.bottom-nav {
  display: flex;
  border-top: 1px solid var(--surface2);
  padding: 8px 12px;
}

.nav-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.nav-btn.active { background: var(--accent); color: var(--on-accent); }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(64px + var(--safe-bottom));
  background: #14532d;
  color: #ecfdf5;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 50;
  max-width: 90vw;
}

.toast.is-hold {
  background: #365314;
  color: #ecfccb;
  font-weight: 700;
  animation: vin-read-pulse 1.1s ease-in-out infinite;
}

.vin-read-status {
  margin: 6px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}

.vin-read-status:not(.hidden) {
  animation: vin-read-pulse 1.1s ease-in-out infinite;
}

@keyframes vin-read-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

#app:has(#dealer-nav:not(.hidden)) .toast {
  bottom: calc(118px + var(--safe-bottom));
}

.hidden { display: none !important; }

.temp-pw-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, calc(12px + var(--safe-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(8, 9, 13, 0.72);
}

.temp-pw-dialog.open {
  display: flex;
}

.temp-pw-card {
  width: min(100%, 420px);
  max-height: calc(100dvh - 32px - var(--safe-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
}

.temp-pw-card h3 {
  margin: 0 0 6px;
}

.temp-pw-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.temp-pw-value {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0;
  user-select: all;
}

.temp-pw-note {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.year-block-card {
  width: min(100%, 560px);
  margin: 0;
  text-align: center;
  padding: 32px 28px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  background: #2a1214;
}

.year-block-msg {
  margin: 0;
  font-size: clamp(1.45rem, 4.5vw, 2.15rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fecaca;
}

.year-block-continue {
  margin-top: 22px;
}

.approval-share-card label {
  display: block;
  margin-top: 10px;
}

.approval-share-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.chip-btn {
  border: 1px solid var(--line, rgba(255,255,255,0.16));
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip-btn.active {
  background: var(--accent-dim, rgba(163, 230, 53, 0.16));
  border-color: var(--accent, #a3e635);
}

.approval-save-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.approval-save-row input {
  width: auto;
}

.approval-share-actions {
  margin-top: 14px;
}

.review-mode .bottom-dock .bottom-nav {
  display: none;
}

.login-hero {
  text-align: center;
  padding: 24px 0 12px;
}

.login-hero h1 { margin: 0 0 8px; font-size: 1.4rem; }

.info-banner {
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #d9f99d;
  margin: 12px 0;
}

.error-banner {
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #fecaca;
  margin: 12px 0;
}

.test-banner {
  background: #422006;
  color: #fbbf24;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 560px) {
  .compare-grid { grid-template-columns: 1fr; }
}

.print-only { display: none; }

@media print {
  .top-bar, .bottom-nav, .site-footer, .btn, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  .print-only { display: block; }
}

.detail-header { margin-bottom: 12px; }
.detail-header h2 { margin: 0 0 4px; }

.copy-box {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
}

body.tech-mode .job-item {
  padding: 16px 14px;
  min-height: 76px;
}

body.tech-mode .job-item strong {
  font-size: 1.05rem;
}

body.tech-mode .status {
  font-size: 0.78rem;
  padding: 4px 10px;
}

body.tech-mode .btn {
  min-height: 48px;
}

body.tech-mode .btn-sm {
  min-height: 44px;
}

body.tech-mode .upload-block {
  padding: 14px;
}

body.tech-mode .upload-block .row {
  flex-direction: column;
  align-items: stretch;
}

body.tech-mode .upload-block .row .btn {
  width: 100%;
  min-height: 52px;
}

body.tech-mode .photo-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

body.tech-mode .photo-del {
  width: 36px;
  height: 36px;
}

body.tech-mode .status-actions .btn {
  flex: 1;
  min-width: 140px;
}

body.tech-mode .photo-card h3 {
  font-size: 1.1rem;
}

.acct-filters {
  margin-bottom: 14px;
}

.acct-region-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.acct-region-toggle {
  margin: 0;
}

.acct-region-toggle .tab {
  padding: 10px 18px;
  font-size: 0.95rem;
}

.acct-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.acct-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.acct-show-invoiced {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.acct-group-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.acct-report-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.acct-report-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.acct-report-row select {
  width: 100%;
}

.acct-report-row .btn {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .acct-report-row {
    grid-template-columns: 1fr;
  }
}

.acct-show-invoiced input {
  width: auto;
  margin: 0;
}

#acct-list {
  min-width: 0;
  max-width: 100%;
}

.acct-date-group {
  margin-bottom: 20px;
  padding: 0 0 4px;
  border: 1px solid var(--surface2);
  border-radius: 14px;
  background: #0f1117;
  overflow: hidden;
}

.acct-date-group.is-today {
  border-color: var(--accent);
  background: #12180f;
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.acct-date-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #0c0e12;
  border-bottom: 1px solid var(--surface2);
}

.acct-date-banner.acct-sales-head {
  display: grid;
  padding: 10px 16px;
}

.acct-date-group.is-today .acct-date-banner {
  background: var(--accent-dim);
  border-bottom-color: var(--accent);
}

.acct-date-heading {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.acct-date-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.acct-date-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.acct-date-total {
  color: var(--accent);
  font-size: 1rem;
}

.acct-date-group .acct-dealer {
  margin: 10px 10px 10px;
}

.acct-dealer {
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface);
  overflow: hidden;
}

.acct-dealer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
}

.acct-dealer-name {
  flex: 1;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.acct-chevron {
  color: var(--muted);
  flex-shrink: 0;
  width: 1.5rem;
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 700;
}

.acct-dealer-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--surface2);
}

.acct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

.acct-actions .btn:not(.btn-success) {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--surface2);
}

.acct-preview-wrap {
  overflow-x: hidden;
  max-width: 100%;
  margin: 0 0 10px;
  border: 1px solid var(--surface2);
  border-radius: 8px;
}

.acct-preview-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.acct-preview-table th,
.acct-preview-table td {
  padding: 8px 6px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  border-bottom: 1px solid var(--surface2);
  overflow: hidden;
}

.acct-preview-table .acct-col-date {
  width: 16%;
}

.acct-preview-table .acct-col-vehicle {
  width: 30%;
}

.acct-preview-table .acct-col-vin {
  width: 32%;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.acct-preview-table .acct-col-stock {
  width: 12%;
}

.acct-preview-table .acct-col-amount {
  width: 10%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.acct-sales-group {
  overflow-x: auto;
}

.acct-dealer-head.acct-sales-head {
  display: grid;
  padding-right: 12px;
}

.acct-sales-head {
  display: grid;
  grid-template-columns: 1.5rem 12rem 3.5rem 3.5rem 5.2rem 6.4rem 7.2rem;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  justify-content: start;
}

.acct-sales-group .acct-dealer-head,
.acct-sales-group .acct-month-head,
.acct-sales-group .acct-sales-col-labels,
.acct-sales-group .acct-sales-visit,
.acct-sales-group .acct-sales-visit-head {
  min-width: 0;
}

.acct-sales-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.acct-region-head {
  grid-template-columns: 1.5rem 12rem 3.5rem 3.5rem 3.6rem 6.4rem 7.2rem;
}

.acct-year-block {
  border-top: 1px solid var(--surface2);
}

.acct-year-head {
  padding: 10px 16px;
  background: #0c0e12;
}

.acct-year-name {
  font-weight: 800;
  font-size: 1.05rem;
}

.acct-month-pick {
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--surface2);
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 10px 16px;
}

.acct-month-pick .acct-month-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.acct-month-pick .acct-date-sub {
  margin: 0;
  font-weight: 400;
}

.acct-month-pick.is-selected {
  background: var(--accent-dim);
  box-shadow: inset 3px 0 0 var(--accent);
}

.acct-region-month-head .acct-date-sub {
  display: block;
  margin-top: 2px;
}

.acct-sales-group .acct-region-head {
  min-width: 0;
}

.acct-sales-head .acct-dealer-name,
.acct-sales-head .acct-month-name,
.acct-sales-head .acct-year-name,
.acct-sales-head .acct-banner-copy {
  min-width: 0;
  overflow-wrap: break-word;
}

.acct-sales-head .acct-dealer-name {
  flex: none;
}

.acct-visit-wrap {
  border-radius: 8px;
}

.acct-visit-wrap .acct-sales-visit {
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.acct-visit-types {
  padding: 0 0 6px;
}

.acct-type-row {
  padding: 4px 12px 4px 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.acct-type-name {
  font-weight: 600;
}

.acct-sales-cols {
  display: contents;
}

.acct-sales-num,
.acct-sales-money,
.acct-sales-col-labels span:nth-child(n+3),
.acct-sales-visit-head span:nth-child(n+3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.acct-sales-money {
  justify-self: end;
}

.acct-sales-banner-totals {
  min-width: 0;
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
}

.acct-sales-col-labels,
.acct-sales-visit-head {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 8px 16px;
}

.acct-sales-col-labels span:last-child {
  white-space: normal;
  line-height: 1.2;
  max-width: 7.2rem;
  justify-self: end;
}

.acct-month {
  margin-top: 8px;
  border: 1px solid var(--surface2);
  border-radius: 10px;
  overflow: hidden;
  background: #12141b;
}

.acct-month-head {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 10px 12px;
}

.acct-month-name {
  font-weight: 650;
}

.acct-month-body {
  padding: 0 8px 8px;
  border-top: 1px solid var(--surface2);
}

.acct-sales-visit {
  padding: 8px 12px;
  border-radius: 8px;
}

.acct-visit-wrap:nth-child(even) .acct-sales-visit {
  background: rgba(255, 255, 255, 0.03);
}

.acct-visit-date {
  font-weight: 600;
}

@media (max-width: 720px) {
  .acct-date-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

.acct-preview-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .acct-preview-table {
    font-size: 0.75rem;
  }
}

.acct-preview-table tr:last-child td {
  border-bottom: 0;
}

.acct-job {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--surface2);
}

.acct-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.acct-mode .acct-dealer-head,
body.acct-mode .acct-sales-visit,
body.acct-mode .acct-job-actions .btn {
  min-height: 44px;
}

.dup-check {
  margin-top: 12px;
}

.dup-check-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.dup-check-fill {
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: var(--accent2);
}

.dup-check.is-checking .dup-check-fill {
  animation: dup-scan 1s ease-in-out infinite;
}

.dup-check.is-done .dup-check-fill {
  width: 100%;
  background: var(--success);
}

.dup-check.is-warn .dup-check-fill {
  width: 100%;
  background: var(--danger);
}

.dup-check-msg {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

.dup-check.is-done .dup-check-msg { color: var(--success); }
.dup-check.is-warn .dup-check-msg {
  color: #fecaca;
  font-weight: 700;
}
.dup-check.is-checking .dup-check-msg { color: var(--muted); }

.dup-check-hits {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 0.85rem;
}

.dup-check-hits:empty { display: none; }

@keyframes dup-scan {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.due-actions {
  margin-top: 10px;
}

.due-actions .visit-select {
  min-width: 160px;
}

.schedule-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-plan-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.week-board-scroller {
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

#week-double-warn {
  margin: 8px 0 0;
}

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(154px, 1fr));
  gap: 8px;
  align-items: start;
  grid-auto-rows: min-content;
  min-width: 1126px;
  overflow: visible;
}

.week-day {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 220px;
  min-width: 154px;
  height: max-content;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.week-day-slots {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.week-day.is-today {
  border-color: var(--accent);
}

.week-day-head {
  font-weight: 600;
  font-size: 0.95rem;
}

.week-day-date {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.week-add-dealer {
  width: 100%;
  margin: 8px 0 0;
  font-size: 0.8rem;
}

.week-slot {
  background: var(--surface2);
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
}

.week-slot.too-soon {
  border: 1px solid var(--warning);
}

.week-slot.is-due {
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.week-slot.is-recommended {
  box-shadow: inset 3px 0 0 var(--accent);
}

.week-slot.is-double {
  border: 1px solid rgba(248, 113, 113, 0.7);
}

.week-slot-dup {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fecaca;
}

.week-slot-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.week-slot-name {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
}

.week-slot-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
}

.week-slot-remove:hover {
  color: var(--danger);
}

.days-since {
  margin: 4px 0 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.days-since.too-soon {
  color: var(--warning);
}

.days-since.due {
  color: var(--success);
}

.week-tech {
  width: 100%;
  margin: 0;
  font-size: 0.8rem;
}

.week-leftover {
  margin-top: 18px;
}

.week-leftover-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.week-leftover-area {
  margin: 12px 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.leftover-row {
  grid-template-columns: 1fr minmax(120px, 160px);
}

.week-leftover-add {
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
}

.week-cadence summary {
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 8px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 180px) minmax(150px, 180px);
  gap: 10px;
  align-items: center;
}

.schedule-region {
  margin-left: 6px;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
}

.cadence-select,
.visit-select {
  width: 100%;
  margin: 0;
}

.due-card .muted,
.schedule-row .muted {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .schedule-row {
    grid-template-columns: 1fr;
  }
}

.bin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.bin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bin-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
}

.bin-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--surface2);
}

.bin-preview-empty {
  display: inline-block;
}

.bin-info {
  flex: 1;
  min-width: 0;
}

.bin-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.bin-days-urgent {
  color: var(--danger);
  font-weight: 600;
}

.approvals-search-card {
  margin-bottom: 16px;
}

.approvals-search-card input {
  width: 100%;
  margin-top: 4px;
}

.approval-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.approval-group {
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.approval-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 12px 16px;
}

.approval-group-head strong {
  font-size: 1.05rem;
}

.approval-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--surface2);
  color: inherit;
  cursor: pointer;
}

.approval-row:hover,
.approval-row:focus-visible {
  background: var(--surface2);
}

.approval-when {
  font-weight: 600;
}

.approval-meta {
  font-size: 0.95rem;
}

@media (max-width: 700px) {
  .bin-row {
    flex-wrap: wrap;
  }
  .bin-row .user-row-actions {
    width: 100%;
  }
}
