:root {
  --bg: #f6f9fc;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.97);
  --surface-strong: #ffffff;
  --stroke: rgba(15, 23, 42, 0.08);
  --ink: #102033;
  --muted: #5a6b80;
  --accent: #1768e5;
  --accent-soft: rgba(23, 104, 229, 0.12);
  --warm: #d97706;
  --warm-soft: rgba(217, 119, 6, 0.12);
  --danger: #c2415a;
  --danger-soft: rgba(194, 65, 90, 0.12);
  --success: #2f8f5b;
  --success-soft: rgba(47, 143, 91, 0.12);

  /* Multi-layer shadow system */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow: 0 2px 6px rgba(15, 23, 42, 0.06), 0 10px 24px rgba(15, 23, 42, 0.07), 0 24px 52px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.08), 0 18px 48px rgba(15, 23, 42, 0.1), 0 44px 80px rgba(15, 23, 42, 0.07);
  --shadow-accent: 0 2px 8px rgba(23, 104, 229, 0.18), 0 8px 28px rgba(23, 104, 229, 0.18), 0 20px 48px rgba(23, 104, 229, 0.1);
  --shadow-success: 0 2px 8px rgba(47, 143, 91, 0.18), 0 8px 28px rgba(47, 143, 91, 0.16);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --inset-card: inset 0 1px 0 rgba(255, 255, 255, 0.88), inset 0 -1px 0 rgba(15, 23, 42, 0.04);
  --radius: 22px;
  --radius-lg: 30px;
  --ui-gap: 10px;
  --accent-gradient-start: #1e7af0;
  --accent-gradient-end: #1456c7;
  --theme-radial-1: rgba(23, 104, 229, 0.11);
  --theme-radial-2: rgba(67, 141, 255, 0.09);
  --theme-radial-3: rgba(23, 104, 229, 0.04);
  --theme-grid: rgba(23, 104, 229, 0.022);
  --theme-soft-bg: rgba(23, 104, 229, 0.08);
  --theme-soft-bg-strong: rgba(23, 104, 229, 0.12);
  --theme-soft-border: rgba(23, 104, 229, 0.2);
  --theme-soft-text: #31517d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse at 15% 0%, var(--theme-radial-1) 0%, transparent 38%),
    radial-gradient(ellipse at 85% 0%, var(--theme-radial-2) 0%, transparent 32%),
    radial-gradient(ellipse at 50% 60%, var(--theme-radial-3) 0%, transparent 50%),
    linear-gradient(180deg, #f8faff 0%, var(--bg) 100%);
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body[data-shell-mode="desktop"] {
  background:
    radial-gradient(ellipse at 10% 0%, rgba(14, 116, 144, 0.13) 0%, transparent 30%),
    radial-gradient(ellipse at 90% 0%, rgba(23, 104, 229, 0.11) 0%, transparent 34%),
    radial-gradient(ellipse at 50% 70%, rgba(67, 141, 255, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #f7fbff 0%, #edf4fb 100%);
}

/* Noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  z-index: 0;
}

/* Subtle grid pattern */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--theme-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--theme-grid) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 82%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ── Universal pressed state: all buttons → transparent white on click ── */
button:active:not([disabled]),
.bundle-button:active,
.quick-service-button:active,
.report-row-button:active,
.plan-card:active {
  transform: translateY(0) scale(0.98) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: var(--ink) !important;
  border-color: rgba(47, 54, 64, 0.18) !important;
  box-shadow: 0 1px 3px rgba(30, 40, 60, 0.1) !important;
  filter: none !important;
  transition: transform 80ms ease, background 80ms ease, box-shadow 80ms ease !important;
}

.shell {
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 22px 0 48px;
  position: relative;
  z-index: 1;
}

/* ── Brand Banner ─────────────────────────────────── */
.app-brand-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 20px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.07);
  background:
    radial-gradient(ellipse at top right, rgba(23, 104, 229, 0.16), transparent 36%),
    radial-gradient(ellipse at bottom left, rgba(67, 141, 255, 0.06), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(240, 248, 255, 0.98));
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--shadow), var(--inset-card);
}

.app-brand-copy,
.app-brand-meta {
  display: grid;
  gap: 9px;
}

.app-brand-copy h1 {
  margin: 0;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.app-brand-copy p,
.app-brand-meta {
  color: var(--muted);
}

.app-brand-meta {
  justify-items: end;
  text-align: right;
}

.app-brand-meta strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.app-header-logout-button {
  margin-top: 4px;
}

.app-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-header-theme-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  font-size: 1rem;
}

.theme-menu-card {
  margin-top: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm), var(--inset-top);
  width: 280px;
}

.theme-menu-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.theme-modal-card {
  width: min(420px, calc(100vw - 28px));
}

.theme-modal-card .theme-menu-grid {
  margin-top: 2px;
}

.theme-choice-button {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.theme-choice-button.is-active {
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 55%, #111 45%);
}

/* Theme all interactive buttons to selected user palette */
.primary-button,
.text-button,
.upload-button,
.talk-tab.is-active,
.tab-button.is-active,
.btn-ready,
.btn-urgent,
.clock-action-button,
.recommendation-decision-button,
.quick-service-button,
.bundle-button,
.report-row-button,
.customer-contact-sync-button,
.walkthrough-mileage-confirm-button {
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 60%, #111 40%);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 38%, transparent), 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.text-button:hover,
.primary-button:hover,
.upload-button:hover,
.btn-ready:hover,
.btn-urgent:hover,
.clock-action-button:hover,
.recommendation-decision-button:hover,
.quick-service-button:hover,
.bundle-button:hover,
.report-row-button:hover {
  border-color: color-mix(in srgb, var(--accent) 72%, #111 28%);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 42%, transparent), 0 10px 28px color-mix(in srgb, var(--accent) 26%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.text-button[disabled],
.upload-button[disabled],
.btn-ready[disabled],
.btn-urgent[disabled],
.clock-action-button[disabled],
.recommendation-decision-button[disabled] {
  opacity: 0.5;
}

/* Theme light accent surfaces (formerly blue-tinted) */
.pill.subtle,
.panel-chip,
.dashboard-ro-link-pill,
.reason-item-price-pill,
.appointment-reason-editor-panel .panel-chip,
.queue-item.is-selected,
.recommendation-card.is-active,
.appointment-intake-search,
.appointment-intake-search-friendly,
.details-card,
.inline-status,
.communication-thread article,
.communication-alert-card,
.message-card,
.ro-chip {
  border-color: var(--theme-soft-border) !important;
}

.pill.subtle,
.panel-chip,
.dashboard-ro-link-pill,
.appointment-intake-search,
.appointment-intake-search-friendly,
.reason-item-price-pill {
  background: var(--theme-soft-bg) !important;
  color: var(--theme-soft-text) !important;
}

/* Communication specific theme tinting */
.communication-alert-card,
.communication-thread article,
.message-card,
.communication-message.is-outgoing,
.communication-notification.is-unread {
  background: var(--theme-soft-bg-strong) !important;
  border-color: var(--theme-soft-border) !important;
}

/* ── Desktop Status Bar ───────────────────────────── */
.desktop-status-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(0, 1.9fr);
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.07);
  background:
    radial-gradient(ellipse at top left, rgba(14, 116, 144, 0.07), transparent 38%),
    radial-gradient(ellipse at bottom right, rgba(23, 104, 229, 0.06), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(245, 251, 255, 0.97));
  box-shadow: var(--shadow), var(--inset-card);
}

.desktop-status-intro,
.desktop-status-metrics {
  display: grid;
  gap: 14px;
}

.desktop-status-intro strong {
  font-size: 1.4rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.01em;
}

.desktop-status-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.desktop-metric-card {
  display: grid;
  gap: 9px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm), var(--inset-top);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.desktop-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--inset-top);
}

.desktop-metric-card span,
.desktop-metric-card small {
  color: var(--muted);
}

.desktop-metric-card strong {
  font-size: 1.35rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.02em;
}

.desktop-metric-card--signal.is-live {
  background: rgba(47, 143, 91, 0.09);
  border-color: rgba(47, 143, 91, 0.2);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.desktop-metric-card--signal.is-warm {
  background: rgba(217, 119, 6, 0.09);
  border-color: rgba(217, 119, 6, 0.2);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.desktop-metric-card--signal.is-muted {
  background: rgba(23, 104, 229, 0.07);
  border-color: rgba(23, 104, 229, 0.17);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 20px;
  padding: 24px 28px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at top right, rgba(23, 104, 229, 0.14), transparent 38%),
    radial-gradient(ellipse at bottom left, rgba(67, 141, 255, 0.06), transparent 44%),
    linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(244, 250, 255, 0.98));
  box-shadow: var(--shadow), var(--inset-card);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -100px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 104, 229, 0.2), transparent 68%);
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  left: -60px;
  bottom: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67, 141, 255, 0.1), transparent 68%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 8px 0 14px;
  font-family: "Bahnschrift", "Franklin Gothic Medium", "Trebuchet MS", sans-serif;
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 16ch;
}

.hero p,
.panel p,
.customer-hero p,
.recommendation-card small,
.queue-item small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  display: inline-block;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

/* ── Summary Grid ─────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.summary-card,
.panel,
.customer-hero {
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow: var(--shadow), var(--inset-card);
}

.summary-card {
  padding: 24px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--inset-top);
}

.summary-card strong {
  display: block;
  margin: 10px 0;
  font-size: 2rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.03em;
}

/* ── Workspace ────────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--ui-gap);
  margin-top: var(--ui-gap);
  align-items: start;
}

.appointments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ui-gap);
  margin-top: var(--ui-gap);
  align-items: start;
}

.appointments-layout.is-open {
  grid-template-columns: 320px minmax(0, 1fr);
}

.panel,
.customer-hero {
  padding: 20px 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: var(--ui-gap);
}

.panel-head h2,
.customer-hero h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.015em;
}

.panel-chip,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(23, 104, 229, 0.12);
  border: 1px solid rgba(23, 104, 229, 0.2);
  color: #1768e5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.panel-chip,
.pill.subtle {
  background: rgba(23, 104, 229, 0.07);
  border-color: rgba(23, 104, 229, 0.14);
  color: #31517d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.danger {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.28);
  color: #991b1b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.queue-list,
.center-column {
  display: grid;
  gap: 10px;
}

.appointments-main {
  min-width: 0;
}

/* ── Queue & Recommendation Cards ────────────────── */
.queue-item,
.recommendation-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(47, 54, 64, 0.08);
  border-radius: 20px;
  padding: 18px 20px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm), var(--inset-top);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.queue-item:hover,
.recommendation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(31, 42, 50, 0.1), 0 2px 8px rgba(31, 42, 50, 0.06);
}

.queue-item.is-selected,
.recommendation-card.is-active {
  border-color: rgba(23, 104, 229, 0.45);
  box-shadow: var(--shadow-accent);
  background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(242, 248, 255, 0.98));
}

.appointments-rail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

/* ── Appointment Search ───────────────────────────── */
.appointment-intake-search {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(23, 104, 229, 0.05);
  border: 1px solid rgba(23, 104, 229, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.appointment-intake-search-friendly {
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(23, 104, 229, 0.07), rgba(23, 104, 229, 0.03));
}

.appointment-intake-search-friendly .primary-button {
  border: 1px solid rgba(23, 104, 229, 0.45);
  background: linear-gradient(145deg, #2e7ceb, #1b5fcb);
  color: #fff;
  box-shadow: 0 3px 10px rgba(23, 104, 229, 0.24);
}

.appointment-intake-search-friendly .primary-button:hover {
  filter: brightness(1.04);
}

.dashboard-workorders-rail {
  display: grid;
  gap: 16px;
}

.dashboard-workorders-intro {
  margin-bottom: 0;
}

.dashboard-ro-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
}

.dashboard-ro-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

body[data-theme="gray"] { --accent: #5f6b78; --accent-gradient-start: #7a8795; --accent-gradient-end: #5f6b78; --theme-radial-1: rgba(95, 107, 120, 0.11); --theme-radial-2: rgba(140, 153, 168, 0.09); --theme-radial-3: rgba(95, 107, 120, 0.05); --theme-grid: rgba(95, 107, 120, 0.02); --theme-soft-bg: rgba(95,107,120,0.08); --theme-soft-bg-strong: rgba(95,107,120,0.13); --theme-soft-border: rgba(95,107,120,0.22); --theme-soft-text: #4f5d6b; }
body[data-theme="black"] { --accent: #2f3640; --accent-gradient-start: #4a5563; --accent-gradient-end: #2f3640; --theme-radial-1: rgba(47, 54, 64, 0.13); --theme-radial-2: rgba(98, 108, 122, 0.08); --theme-radial-3: rgba(47, 54, 64, 0.05); --theme-grid: rgba(47, 54, 64, 0.02); --theme-soft-bg: rgba(47,54,64,0.08); --theme-soft-bg-strong: rgba(47,54,64,0.14); --theme-soft-border: rgba(47,54,64,0.24); --theme-soft-text: #3c4552; }
body[data-theme="purple"] { --accent: #6e5bb8; --accent-gradient-start: #8774cd; --accent-gradient-end: #6e5bb8; --theme-radial-1: rgba(110, 91, 184, 0.12); --theme-radial-2: rgba(146, 125, 212, 0.09); --theme-radial-3: rgba(110, 91, 184, 0.05); --theme-grid: rgba(110, 91, 184, 0.022); --theme-soft-bg: rgba(110,91,184,0.08); --theme-soft-bg-strong: rgba(110,91,184,0.13); --theme-soft-border: rgba(110,91,184,0.23); --theme-soft-text: #5b4ca0; }
body[data-theme="green"] { --accent: #2f8f5b; --accent-gradient-start: #45a972; --accent-gradient-end: #2f8f5b; --theme-radial-1: rgba(47, 143, 91, 0.11); --theme-radial-2: rgba(82, 171, 122, 0.08); --theme-radial-3: rgba(47, 143, 91, 0.05); --theme-grid: rgba(47, 143, 91, 0.022); --theme-soft-bg: rgba(47,143,91,0.08); --theme-soft-bg-strong: rgba(47,143,91,0.13); --theme-soft-border: rgba(47,143,91,0.23); --theme-soft-text: #2a7c4f; }
body[data-theme="red"] { --accent: #b84f5a; --accent-gradient-start: #cf6772; --accent-gradient-end: #b84f5a; --theme-radial-1: rgba(184, 79, 90, 0.11); --theme-radial-2: rgba(211, 110, 122, 0.09); --theme-radial-3: rgba(184, 79, 90, 0.05); --theme-grid: rgba(184, 79, 90, 0.022); --theme-soft-bg: rgba(184,79,90,0.08); --theme-soft-bg-strong: rgba(184,79,90,0.13); --theme-soft-border: rgba(184,79,90,0.23); --theme-soft-text: #9f4450; }
body[data-theme="pink"] { --accent: #b85d95; --accent-gradient-start: #cd78ab; --accent-gradient-end: #b85d95; --theme-radial-1: rgba(184, 93, 149, 0.11); --theme-radial-2: rgba(210, 125, 175, 0.09); --theme-radial-3: rgba(184, 93, 149, 0.05); --theme-grid: rgba(184, 93, 149, 0.022); --theme-soft-bg: rgba(184,93,149,0.08); --theme-soft-bg-strong: rgba(184,93,149,0.13); --theme-soft-border: rgba(184,93,149,0.23); --theme-soft-text: #9f4f81; }

.dashboard-ro-link-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.dashboard-ro-link-pill {
  font-size: 0.72rem;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
}

.dashboard-ro-item-shell {
  display: grid;
  gap: 8px;
}

.dashboard-ro-item-actions {
  display: flex;
  justify-content: flex-end;
}

.dashboard-ro-edit-button {
  min-height: 32px;
  padding: 6px 12px;
}

.appointment-search-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.appointment-search-head strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
}

.search-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.search-input-row-friendly {
  align-items: center;
}

.friendly-search-label {
  display: grid;
  gap: 8px;
}

.search-input-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(23, 104, 229, 0.16);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 4px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-input-shell:focus-within {
  border-color: rgba(23, 104, 229, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 2px 8px rgba(15, 23, 42, 0.04), 0 0 0 3px rgba(23, 104, 229, 0.12);
}

.search-input-shell.is-iconless {
  grid-template-columns: minmax(0, 1fr);
}

.search-input-shell input {
  width: 100%;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
}

.search-input-shell input:focus {
  outline: none;
}

.search-input-shell input::placeholder {
  color: var(--muted);
}

.tech-ro-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 405px;
}

.tech-ro-search-row.is-open {
  grid-template-columns: 1fr;
  max-width: none;
}

.tech-ro-input {
  width: 100%;
  min-height: 44px;
}

.tech-ro-search-button {
  min-height: 44px;
  padding: 0 12px;
  font-size: 1.02rem;
}

.appointment-intake-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.form-error {
  margin: 0;
  color: #b33a3a;
  font-weight: 600;
}

.appointments-rail-list {
  display: grid;
  gap: 12px;
  max-height: min(72vh, 760px);
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding-right: 6px;
}

.appointment-rail-item {
  padding: 14px 16px;
}

.queue-item strong,
.recommendation-card strong,
.bundle-card strong {
  display: block;
  margin: 9px 0 6px;
  font-size: 1rem;
}

.queue-topline,
.recommendation-topline,
.recommendation-metrics,
.queue-metrics,
.bundle-metrics,
.talk-close {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.queue-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--warm);
}

.queue-metrics,
.recommendation-metrics,
.bundle-metrics {
  margin: 12px 0 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.card-grid,
.bundle-grid,
.conversation-sections,
.scenario-grid {
  display: grid;
  gap: 14px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.bundle-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── Bundle & Detail Cards ────────────────────────── */
.bundle-card,
.talk-card,
.details-card {
  border-radius: 20px;
  background: var(--surface-strong);
  border: 1px solid rgba(47, 54, 64, 0.08);
  padding: 18px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.details-card.is-disabled {
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(47, 54, 64, 0.04);
}

.bundle-card p,
.details-card p {
  margin: 10px 0;
}

.bundle-time-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.bundle-support-copy {
  display: block;
  line-height: 1.62;
  color: var(--ink);
}

.bundle-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.bundle-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(31, 42, 50, 0.09), var(--inset-top);
}

.bundle-button.is-active {
  border-color: rgba(23, 104, 229, 0.45);
  box-shadow: var(--shadow-accent);
  background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(242, 248, 255, 0.98));
}

/* ── Customer Hero ────────────────────────────────── */
.customer-hero {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 10px;
}

.customer-hero-vehicle-line {
  margin: 4px 0 0;
  font-size: 0.96rem;
  color: var(--muted);
}

.hero-score {
  min-width: 128px;
  padding: 16px 18px;
  border-radius: 18px;
  color: var(--ink);
  align-self: start;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.hero-score span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.hero-score strong {
  display: block;
  margin-top: 4px;
  font-size: 2.3rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.03em;
}

.hero-tags,
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
}

.hero-tags {
  margin-top: -4px;
}

.hero-notes > div {
  flex: 1 1 240px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(248, 252, 255, 0.97);
  border: 1px solid rgba(47, 54, 64, 0.07);
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.appointment-reason-items {
  display: grid;
  gap: 8px;
}

.appointment-reason-list {
  list-style: disc;
  margin: 8px 0 0 20px;
  padding: 0;
}

.appointment-reason-list li {
  margin: 4px 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink);
}

.reason-source {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: #666;
}

.reason-unsync-notice {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: #ff9800;
  font-weight: 500;
}

.appointment-reason-editor-panel {
  margin-top: 16px;
}

.appointment-reason-editor-content {
  display: grid;
  gap: 12px;
}

.editor-reason-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.editor-reason-list .reason-item {
  margin: 6px 0;
  font-size: 0.95rem;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(23, 104, 229, 0.12);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(242, 248, 255, 0.94));
}

.editor-reason-list .reason-item .reason-item-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reason-item-label-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reason-item-opt-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(23, 104, 229, 0.26);
  background: rgba(23, 104, 229, 0.08);
  color: #0f4bab;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex: 0 0 auto;
}

.reason-item-price-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  min-height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(23, 104, 229, 0.22);
  background: rgba(23, 104, 229, 0.08);
  color: #1768e5;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

input.reason-item-price-pill {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  padding: 0 8px;
  text-align: right;
  justify-self: end;
}

.reason-editor-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(23, 104, 229, 0.14);
  background: rgba(247, 251, 255, 0.95);
}

.reason-editor-input-row input {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  padding: 0 12px;
}

.reason-new-item-price-input {
  text-align: center;
}

.recon-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.recon-stage-card-approval {
  grid-column: 1 / -1;
}

.reason-editor-input {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(248, 252, 255, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(23, 104, 229, 0.1);
}

.reason-editor-input .textarea-field {
  margin: 0;
}

.reason-editor-input input {
  min-height: 40px;
}

.editor-reason-list .reason-item button,
.service-item-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 4px 8px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(194, 65, 90, 0.3);
  background: rgba(194, 65, 90, 0.08);
  color: var(--danger);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 160ms ease;
}

.editor-reason-list .reason-item button:hover,
.service-item-delete:hover {
  background: rgba(194, 65, 90, 0.16);
  border-color: rgba(194, 65, 90, 0.5);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(194, 65, 90, 0.2);
}

.editor-reason-list .reason-item button:active,
.service-item-delete:active {
  transform: scale(0.95);
}

.reason-editor-actions {
  display: flex;
  gap: 8px;
}

.sync-to-dms-button {
  background: linear-gradient(145deg, #4caf50, #45a049);
  border-color: rgba(76, 175, 80, 0.3);
}

.add-service-item-button {
  padding: 8px 16px;
  min-height: 40px;
  font-size: 0.9rem;
  border-radius: 10px;
  white-space: nowrap;
}

.hero-assignment-grid {
  margin-top: 12px;
}

.field-grid.appointment-transfer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-assignment-card .panel-actions {
  margin-top: 8px;
}

.hero-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.hero-action-row > button {
  min-height: 46px;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  padding-inline: 18px;
  justify-content: center;
}

.transfer-submit-button {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}

/* ── Conversation / Talk ──────────────────────────── */
.conversation-panel {
  position: sticky;
  top: 16px;
}

.talk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.talk-tab,
.text-button {
  border-radius: 10px;
  border: 1.5px solid rgba(47, 54, 64, 0.12);
  background: white;
  padding: 8px 14px;
  color: var(--muted);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 3px 8px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.talk-tab.is-active {
  color: white;
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  border-color: color-mix(in srgb, var(--accent) 60%, #111 40%);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 38%, transparent), 0 6px 16px color-mix(in srgb, var(--accent) 26%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.text-button:hover,
.talk-tab:hover {
  border-color: rgba(23, 104, 229, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(23, 104, 229, 0.1), 0 4px 14px rgba(15, 23, 42, 0.07);
}

.talk-script {
  font-size: 1rem;
  line-height: 1.72;
  margin: 0 0 18px;
}

.signal-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.signal-list li + li {
  margin-top: 9px;
}

.assistant-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.62;
}

.assistant-list li + li {
  margin-top: 9px;
}

.queue-contact {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.queue-owner {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.queue-source {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.8rem;
}

/* ── Scenario Grid ────────────────────────────────── */
.scenario-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.scenario-grid label {
  display: grid;
  gap: 8px;
  color: var(--ink);
}

.scenario-grid span {
  font-size: 0.86rem;
  color: var(--muted);
}

.scenario-grid input,
.scenario-grid select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(47, 54, 64, 0.11);
  background: rgba(250, 252, 255, 1);
  padding: 10px 13px;
  color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.scenario-grid input:focus,
.scenario-grid select:focus {
  outline: none;
  border-color: rgba(23, 104, 229, 0.38);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05), 0 0 0 3px rgba(23, 104, 229, 0.1);
}

.scenario-grid input[type="range"] {
  padding: 0;
  box-shadow: none;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid rgba(47, 54, 64, 0.11);
  background: rgba(250, 252, 255, 1);
  padding: 13px;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
}

.checkbox-field input {
  width: auto;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

/* ── Lookup Toolbar ───────────────────────────────── */
.lookup-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.compact-field {
  display: grid;
  gap: 8px;
  flex: 1 1 260px;
}

.compact-field span,
.integration-metrics,
.source-filter-tag {
  font-size: 0.86rem;
}

.compact-field span {
  color: var(--muted);
}

.compact-field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(47, 54, 64, 0.11);
  background: rgba(250, 252, 255, 1);
  padding: 10px 13px;
  color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
}

/* ── Integration Cards ────────────────────────────── */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.integration-card {
  display: grid;
  gap: 13px;
  border-radius: 20px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: rgba(248, 251, 255, 0.96);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm), var(--inset-top);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.integration-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--inset-top);
}

.integration-card-pills,
.integration-live-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.integration-live-banner {
  display: grid;
  gap: 13px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(23, 104, 229, 0.12);
  background: rgba(23, 104, 229, 0.06);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.integration-live-banner strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 4px;
}

.integration-live-banner.is-live {
  background: rgba(47, 143, 91, 0.08);
  border-color: rgba(47, 143, 91, 0.2);
}

.integration-live-banner.is-warm {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
}

.integration-live-banner.is-muted {
  background: rgba(23, 104, 229, 0.06);
  border-color: rgba(23, 104, 229, 0.15);
}

.integration-card.is-active {
  border-color: rgba(23, 104, 229, 0.42);
  box-shadow: var(--shadow-accent);
}

.integration-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.integration-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.integration-metrics {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.source-filter-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(23, 104, 229, 0.08);
  color: var(--accent);
  font-weight: 600;
  padding: 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.confidence {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── Status Pills ─────────────────────────────────── */
.pill.urgency-high,
.tier-high,
.hero-score.tier-high {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(183, 75, 63, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.urgency-medium,
.tier-medium,
.hero-score.tier-medium {
  background: var(--warm-soft);
  color: var(--warm);
  border-color: rgba(201, 106, 37, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.urgency-low,
.tier-low,
.hero-score.tier-low {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(23, 104, 229, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.status-open {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.status-live {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(47, 143, 91, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.status-idle {
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
  border-color: rgba(15, 23, 42, 0.08);
}

.pill.status-working {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.status-on-hold {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border-color: rgba(147, 51, 234, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pill.status-completed {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ── Empty State ──────────────────────────────────── */
.empty-state {
  padding: 22px 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(47, 54, 64, 0.16);
  color: var(--muted);
}

/* ── Auth ─────────────────────────────────────────── */
.auth-shell {
  padding-top: 40px;
}

.auth-login-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  padding-top: 0;
}

.auth-login-card {
  width: min(520px, 100%);
  padding: 38px 40px;
  background:
    radial-gradient(ellipse at top right, rgba(23, 104, 229, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(246, 250, 255, 0.97));
  box-shadow: var(--shadow-lg), var(--inset-card);
}

.auth-login-card h1 {
  margin: 0 0 26px;
  font-family: "Bahnschrift", "Franklin Gothic Medium", "Trebuchet MS", sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.auth-login-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.auth-login-actions {
  margin-top: 20px;
}

.auth-login-intro {
  margin: 8px 0 24px;
  max-width: 48ch;
}

.auth-login-actions .primary-button {
  width: 100%;
  justify-content: center;
}

.auth-login-status {
  margin: 0;
}

.auth-hero {
  align-items: center;
}

.auth-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.3fr);
  gap: 20px;
  margin-top: 20px;
}

.auth-role-grid,
.user-admin-list {
  display: grid;
  gap: 14px;
}

.auth-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.auth-role-card,
.user-admin-row {
  border-radius: 20px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: rgba(248, 251, 255, 0.95);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.auth-role-card strong,
.hero-session-card strong {
  display: block;
  margin: 0;
  font-size: 1.35rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.015em;
}

.hero-session-card {
  display: grid;
  gap: 9px;
  justify-items: end;
  text-align: right;
}

.hero-session-card p {
  max-width: 34ch;
}

.hero-session-badges {
  justify-content: flex-end;
}

.hero-session-actions {
  justify-content: flex-end;
}

.inline-status {
  margin-top: 14px;
  border-radius: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(47, 54, 64, 0.1);
  background: rgba(248, 251, 255, 0.97);
  box-shadow: var(--shadow-sm);
}

.inline-status.is-error {
  border-color: rgba(183, 75, 63, 0.24);
  background: rgba(183, 75, 63, 0.08);
  color: #7d2334;
}

.inline-status.is-success {
  border-color: rgba(23, 104, 229, 0.24);
  background: rgba(23, 104, 229, 0.08);
  color: #15488f;
}

.user-admin-row,
.user-admin-summary,
.admin-row-editor {
  display: grid;
  gap: 12px;
}

.user-admin-summary p {
  margin: 6px 0 0;
}

.user-admin-summary small {
  color: var(--muted);
}

.admin-row-editor {
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px 16px;
  align-items: start;
}

.admin-row-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-row-secondary {
  grid-column: 1 / span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: end;
}

.admin-checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.admin-checkbox-field span {
  margin: 0;
}

.admin-row-actions-stack {
  display: grid;
  gap: 10px;
  justify-content: stretch;
}

.admin-row-actions-stack .primary-button,
.admin-row-actions-stack .text-button {
  width: 100%;
}

.admin-row-actions {
  justify-content: flex-start;
}

@media (max-width: 1200px) {
  .admin-row-editor {
    grid-template-columns: 1fr;
  }

  .admin-row-fields {
    grid-template-columns: 1fr 1fr;
  }

  .admin-row-secondary {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1220px) {
  .desktop-status-bar {
    grid-template-columns: 1fr;
  }

  .desktop-status-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace,
  .appointments-layout.is-open {
    grid-template-columns: 1fr;
  }

  .appointments-rail {
    position: static;
    max-height: none;
  }

  .appointments-rail-list {
    max-height: min(62vh, 520px);
  }

  .search-input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .conversation-panel {
    position: static;
  }

  .auth-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .desktop-status-metrics {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .hero {
    grid-template-columns: 1fr;
  }

  .customer-hero {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100vw - 24px, 100%);
  }

  .hero-session-card,
  .hero-session-card p {
    text-align: left;
    justify-items: start;
  }

  .hero-session-badges,
  .hero-session-actions {
    justify-content: flex-start;
  }

  .field-grid.appointment-transfer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .shell {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .desktop-status-bar {
    gap: 14px;
  }

  .desktop-status-intro p {
    max-width: none;
  }

  .tab-bar.is-mobile {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    margin-top: 0;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 8px 20px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tab-bar.is-mobile .tab-button {
    flex: 1 0 auto;
    white-space: nowrap;
    min-width: max-content;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions .primary-button,
  .panel-actions .text-button,
  .panel-actions .upload-button {
    flex: 1 1 100%;
    justify-content: center;
  }

  .hero {
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-top: 18px;
    width: calc(100vw - 18px);
  }

  .desktop-status-bar {
    padding: 20px 22px;
  }

  .hero,
  .summary-card,
  .panel,
  .customer-hero {
    padding: 20px 22px;
  }

  .hero h1 {
    max-width: none;
  }

  .auth-login-card {
    padding: 26px 22px;
  }

  .desktop-status-intro strong {
    font-size: 1.2rem;
  }

  .tab-bar.is-mobile {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Tab Bar ──────────────────────────────────────── */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding: 4px 0;
  position: relative;
  z-index: 2100;
}

.tab-button,
.ro-chip,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 12px;
  border: 1.5px solid rgba(47, 54, 64, 0.13);
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07), 0 3px 10px rgba(15, 23, 42, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab-button.is-glow {
  border-color: color-mix(in srgb, #d92f2f 45%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, #d92f2f 20%, transparent), 0 0 28px color-mix(in srgb, #d92f2f 36%, transparent), 0 4px 12px color-mix(in srgb, #d92f2f 24%, transparent);
  animation: communication-glow 1.8s ease-in-out infinite alternate;
}

.tab-alert-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d92f2f;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(217, 47, 47, 0.32);
}

.secondary-accent-button {
  background: rgba(15, 110, 143, 0.08);
  color: #0f6e8f;
  border-color: rgba(15, 110, 143, 0.22);
}

.tab-button.is-active,
.primary-button {
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: white;
  border-color: color-mix(in srgb, var(--accent) 60%, #111 40%);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 38%, transparent), 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.tab-button[disabled],
.ro-chip[disabled],
.primary-button[disabled],
.text-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Dashboard Stack ──────────────────────────────── */
.dashboard-stack {
  display: grid;
  gap: var(--ui-gap);
  margin-top: var(--ui-gap);
}

/* ── Communication ────────────────────────────────── */
.communication-shell,
.communication-main,
.communication-side,
.communication-message-list,
.communication-notification-list,
.communication-attachment-grid {
  display: grid;
  gap: 14px;
}

.communication-shell {
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.85fr);
  align-items: start;
  gap: 20px;
}

.communication-main,
.communication-side {
  align-content: start;
  gap: 14px;
}

.communication-side-offset {
  margin-top: 12px;
}

.communication-alerts-panel {
  position: static;
  top: auto;
  min-height: clamp(620px, 78vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}

.recon-shared-view-panel {
  position: static;
  top: auto;
}

.recon-shared-view-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.communication-message {
  display: grid;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: rgba(248, 251, 255, 0.93);
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.communication-message.is-outgoing {
  border-color: var(--theme-soft-border);
  background: var(--theme-soft-bg-strong);
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.communication-message-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.communication-message-head div {
  display: grid;
  gap: 4px;
}

.communication-message-head small {
  color: var(--muted);
}

.communication-message p,
.communication-notification p {
  margin: 0;
}

.communication-overview-card {
  overflow: hidden;
}

.communication-thread-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

/* ── Loaner ───────────────────────────────────────── */
.loaner-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.loaner-dashboard-stack {
  gap: 8px;
  margin-top: 6px;
}

.loaner-add-button {
  background: linear-gradient(145deg, #35a46a, #267a4e);
  border-color: rgba(38, 122, 78, 0.5);
  color: #fff;
  box-shadow: 0 2px 6px rgba(47, 143, 91, 0.28), 0 6px 18px rgba(47, 143, 91, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.loaner-add-button:hover {
  filter: brightness(1.06);
}

.loaner-delete-button {
  background: linear-gradient(145deg, #d4556e, #b03350);
  border-color: rgba(176, 51, 80, 0.5);
  color: #fff;
  box-shadow: 0 2px 6px rgba(194, 65, 90, 0.28), 0 6px 18px rgba(194, 65, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.loaner-delete-button:hover {
  filter: brightness(1.06);
}

.loaner-stage-card,
.loaner-walkthrough-card,
.loaner-reminder-card {
  padding: 20px 24px;
}

.loaner-stage-card {
  display: grid;
  gap: 16px;
}

.loaner-stage-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loaner-reminder-card {
  margin-top: 18px;
}

.loaner-reminder-grid {
  margin-top: 8px;
}

.loaner-walkthrough-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.loaner-walkthrough-card .panel-actions {
  margin: 0;
}

.loaner-walkthrough-card .media-grid {
  margin-top: 4px;
}

.loaner-walkthrough-grid {
  grid-template-columns: minmax(0, 1fr);
}

/* ── Recon ────────────────────────────────────────── */
.recon-dashboard-stack {
  gap: 12px;
  margin-top: 8px;
}

.recon-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.recon-search-input-shell {
  min-height: 42px;
}

.recon-search-input {
  min-height: 42px;
}

.recon-search-button {
  min-height: 42px;
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(47, 54, 64, 0.16);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07), 0 3px 10px rgba(15, 23, 42, 0.05);
}

.recon-search-button:hover {
  background: rgba(248, 251, 255, 1);
  border-color: rgba(23, 104, 229, 0.25);
  color: var(--ink);
}

.recon-add-vehicle-button {
  background: linear-gradient(145deg, #35a46a, #267a4e);
  border-color: rgba(38, 122, 78, 0.5);
  color: #fff;
}

.recon-delete-vehicle-button {
  background: linear-gradient(145deg, #d4556e, #b03350);
  border-color: rgba(176, 51, 80, 0.5);
  color: #fff;
}

.recon-open-work-order-button {
  background: linear-gradient(145deg, #2e7ceb, #1b5fcb);
  border-color: rgba(20, 86, 199, 0.5);
  color: #fff;
}

.recon-open-work-order-button:hover,
.recon-open-work-order-button:focus-visible {
  background: linear-gradient(145deg, #2e7ceb, #1b5fcb);
  color: #fff;
}

.recon-repair-item {
  padding: 20px 22px;
}

.recon-repair-item.is-approved {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(76, 175, 80, 0.02) 100%);
  border-left: 4px solid #4caf50;
}

.recon-repair-item.is-declined {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.05) 0%, rgba(231, 76, 60, 0.02) 100%);
  border-left: 4px solid #e74c3c;
}

.recon-repair-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.communication-thread-meta .textarea-field {
  grid-column: 1 / -1;
}

/* ── Communication Mode ───────────────────────────── */
.communication-mode-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.communication-mode-button {
  border-radius: 11px;
  border: 1.5px solid rgba(47, 54, 64, 0.12);
  background: white;
  color: var(--muted);
  padding: 12px 18px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07), 0 3px 10px rgba(15, 23, 42, 0.05);
  transition: all 160ms ease;
}

.communication-mode-button.is-active {
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  border-color: color-mix(in srgb, var(--accent) 60%, #111 40%);
  color: white;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 38%, transparent), 0 8px 20px color-mix(in srgb, var(--accent) 26%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.communication-conversation-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.communication-composer-actions,
.communication-group-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.communication-composer-actions {
  margin-top: 14px;
}

.communication-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(194, 65, 90, 0.12);
  color: var(--danger);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.communication-alert-badge.is-muted {
  background: rgba(90, 107, 128, 0.12);
  color: var(--muted);
}

.communication-notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.communication-notification-list {
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.communication-attachment-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.communication-attachment-tile {
  display: grid;
  gap: 11px;
  border-radius: 18px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: rgba(248, 251, 255, 0.93);
  padding: 14px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.communication-attachment-tile img,
.communication-attachment-tile video {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.communication-attachment-tile audio {
  width: 100%;
}

.communication-notification {
  border-left: 4px solid rgba(23, 104, 229, 0.18);
}

.communication-notification.is-unread {
  border-left-color: var(--accent);
  background: rgba(236, 244, 255, 0.96);
  box-shadow: 0 6px 24px rgba(23, 104, 229, 0.12), var(--inset-top);
}

.communication-notification.is-approved {
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
  box-shadow: 0 6px 24px rgba(76, 175, 80, 0.12), var(--inset-top);
}

.communication-notification.is-declined {
  border-left-color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
  box-shadow: 0 6px 24px rgba(231, 76, 60, 0.12), var(--inset-top);
}

.communication-notification small {
  color: var(--muted);
}

.panel-chip-alert {
  background: rgba(194, 65, 90, 0.12);
  color: var(--danger);
  border-color: rgba(194, 65, 90, 0.18);
}

/* ── Finance / Tech Grids ─────────────────────────── */
.finance-grid,
.tech-grid,
.field-grid,
.script-grid,
.clock-grid,
.repair-line-list,
.plan-grid,
.media-grid {
  display: grid;
  gap: var(--ui-gap);
}

.finance-grid,
.tech-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.finance-ro-card {
  grid-column: 1;
  grid-row: 1;
}

.finance-repair-card {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}

.finance-card-intake-card {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}

.tech-assignment-card {
  grid-column: 1;
  grid-row: 1;
}

.tech-assignment-lines-card {
  grid-column: 1;
  grid-row: 2;
}

.tech-upsells-card {
  grid-column: 2;
  grid-row: 1;
}

.tech-ai-card {
  grid-column: 1 / -1;
  grid-row: 3;
}

.tech-story-card {
  grid-column: 2;
  grid-row: 2;
}

.tech-media-card {
  grid-column: 1 / -1;
  grid-row: 4;
}

.tech-assignment-card,
.tech-assignment-lines-card,
.tech-upsells-card,
.tech-ai-card,
.tech-story-card,
.tech-media-card {
  align-self: start;
}

.tech-assignment-lines-card .reason-list {
  display: grid;
  gap: 10px;
}

.tech-assignment-lines-card .assignment-line-row {
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 251, 255, 0.92);
}

.tech-upsells-card .quick-service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.tech-upsells-card .quick-service-button {
  min-height: 104px;
  display: grid;
  align-content: start;
}

/* Technician dashboard polish */
.tech-grid {
  gap: 16px;
  align-items: stretch;
}

.tech-grid > .panel {
  padding: 14px 14px 16px;
}

.tech-grid .panel-head {
  margin-bottom: 10px;
}

.tech-grid .panel-head h2 {
  margin-bottom: 0;
}

.tech-assignment-card,
.tech-upsells-card {
  align-self: stretch;
  display: grid;
  align-content: start;
}

.tech-assignment-lines-card,
.tech-story-card {
  align-self: stretch;
  display: grid;
  align-content: start;
}

.tech-assignment-card .field-grid {
  gap: 10px 10px;
}

.tech-assignment-card .field-grid label {
  gap: 6px;
}

.tech-assignment-card .field-grid input,
.tech-assignment-card .field-grid select {
  min-height: 38px;
}

.tech-assignment-card .work-clock-box {
  margin-top: 10px;
}

.tech-assignment-card .clock-grid {
  gap: 10px;
  margin-bottom: 10px;
}

.tech-assignment-card .clock-grid .details-card {
  min-height: 96px;
  padding: 12px 14px;
}

.tech-assignment-card .panel-actions {
  gap: 8px !important;
}

.tech-assignment-lines-card .reason-item {
  margin-bottom: 0;
}

.tech-assignment-lines-card .assignment-line-row {
  min-height: 54px;
}

.tech-ai-card .script-grid {
  gap: 10px;
}

.tech-ai-card .script-grid .details-card {
  min-height: 180px;
  padding: 12px 14px;
}

.tech-story-card .textarea-field textarea {
  min-height: 82px;
  max-height: 120px;
}

.tech-media-card .panel-actions {
  margin-bottom: 8px;
}

.tech-media-card .media-grid {
  min-height: 96px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Finance Identity ─────────────────────────────── */
.finance-identity-grid {
  gap: 20px;
}

.finance-identity-grid label {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(47, 54, 64, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 249, 255, 0.95));
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.04), var(--inset-card);
}

.finance-identity-grid label span {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.finance-identity-grid input {
  min-height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 1rem;
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.05);
}

.finance-contract-inline {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  padding: 20px 22px;
  border-radius: 26px;
  border: 1px solid rgba(47, 54, 64, 0.07);
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.99), rgba(240, 246, 255, 0.93));
  box-shadow: var(--shadow-sm), var(--inset-card);
}

.finance-contract-inline > .panel-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  width: 100%;
}

.finance-contract-inline > .panel-actions > button {
  min-height: 48px;
  min-width: 0;
  width: 100%;
  padding-inline: 12px;
  justify-content: center;
  white-space: nowrap;
}

.contract-upload-link-button {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(23, 104, 229, 0.18);
}

.finance-payment-grid {
  gap: 16px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: stretch;
}

.finance-payment-grid input {
  min-height: 48px;
}

.finance-payment-actions-card,
.finance-payment-request-card,
.finance-balance-card,
.finance-reward-points-card,
.finance-payment-status .status-card {
  height: 100%;
}

.finance-payment-actions-card,
.finance-payment-request-card,
.finance-balance-card,
.finance-reward-points-card {
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.94));
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.04), var(--inset-card);
}

.finance-payment-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.finance-payment-actions > button {
  min-height: 54px;
  padding-inline: 18px;
  justify-content: center;
}

.finance-payment-request-card {
  margin-top: 0;
}

.finance-payment-request-card p {
  margin: 10px 0 8px;
  font-size: 1rem;
}

.finance-payment-request-card small {
  display: block;
  line-height: 1.45;
}

.finance-payment-status .status-card {
  margin-top: 0;
  min-height: 100%;
}

.finance-balance-card {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.94)) !important;
}

.finance-balance-card.is-fully-paid {
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.94)) !important;
  border-left: 4px solid #10b981;
}

.finance-balance-card.is-partial-paid {
  background: linear-gradient(180deg, rgba(254, 252, 232, 0.98), rgba(254, 243, 199, 0.94)) !important;
  border-left: 4px solid #f59e0b;
}

.finance-balance-card.is-unpaid {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(254, 205, 205, 0.94)) !important;
  border-left: 4px solid #ef4444;
}

.finance-balance-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1.5rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.02em;
}

.finance-reward-points-card {
  margin-top: 14px;
  height: auto !important;
  min-height: 0;
}

.finance-reward-points-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 1.2rem;
}

.finance-balance-card.is-fully-paid strong {
  color: #10b981;
}

.finance-balance-card.is-partial-paid strong {
  color: #d97706;
}

.finance-balance-card.is-unpaid strong {
  color: #dc2626;
}

.finance-signature-block {
  margin-top: 13px;
}

@media (max-width: 900px) {
  .finance-payment-grid {
    grid-template-columns: 1fr;
  }

  .finance-contract-inline > .panel-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .finance-contract-inline > .panel-actions {
    grid-template-columns: 1fr;
  }
}

/* ── Form Fields ──────────────────────────────────── */
.field-grid label,
.textarea-field,
.upload-field {
  display: grid;
  gap: 9px;
}

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-grid label span,
.textarea-field span,
.upload-field span,
.support-text {
  font-size: 0.86rem;
  color: var(--muted);
}

.field-grid input,
.field-grid select,
.textarea-field input,
.textarea-field textarea,
.upload-field input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(47, 54, 64, 0.11);
  background: rgba(250, 252, 255, 1);
  padding: 10px 13px;
  color: var(--ink);
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-grid input:focus,
.field-grid select:focus,
.textarea-field input:focus,
.textarea-field textarea:focus {
  outline: none;
  border-color: rgba(23, 104, 229, 0.38);
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.05), 0 0 0 3px rgba(23, 104, 229, 0.1);
}

.span-two {
  grid-column: span 2;
}

.span-full {
  grid-column: 1 / -1;
}

.admin-pin-input {
  min-width: 180px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.11);
  background: rgba(250, 252, 255, 1);
  padding: 11px 16px;
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.05);
}

.ro-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ro-chip:hover,
.tab-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  box-shadow: 0 4px 14px rgba(23, 104, 229, 0.36), 0 10px 28px rgba(23, 104, 229, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  filter: brightness(1.06);
}

.tab-button:not(.is-active):hover {
  border-color: rgba(23, 104, 229, 0.35);
  box-shadow: 0 2px 8px rgba(23, 104, 229, 0.1), 0 4px 14px rgba(15, 23, 42, 0.07);
}

.notice-card p,
.finance-empty p {
  max-width: 90ch;
}

/* ── Repair Lines ─────────────────────────────────── */
.repair-line-list {
  margin-bottom: 16px;
}

.repair-subsection {
  margin-bottom: 13px;
}

.booked-line-list {
  display: grid;
  gap: 12px;
  margin: 11px 0 18px;
}

.booked-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 251, 255, 0.92);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.booked-line strong {
  display: block;
  margin-bottom: 4px;
}

.booked-line span {
  font-weight: 700;
  color: var(--ink);
}

.repair-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: start;
  border-radius: 16px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: rgba(248, 251, 255, 0.92);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.repair-line input {
  margin-top: 4px;
}

.repair-line-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--muted);
}

.total-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.97);
  border: 1px solid rgba(47, 54, 64, 0.08);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.total-strip strong {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

/* ── Plan Grid ────────────────────────────────────── */
.plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.plan-card {
  text-align: left;
  border-radius: 20px;
  border: 1px solid rgba(47, 54, 64, 0.09);
  background: rgba(248, 251, 255, 0.96);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm), var(--inset-top);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.plan-card strong {
  display: block;
  margin: 9px 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.plan-card.is-active {
  border-color: rgba(23, 104, 229, 0.45);
  box-shadow: var(--shadow-accent);
  background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(240, 248, 255, 0.98));
}

/* ── Signature ────────────────────────────────────── */
.signature-block {
  display: grid;
  gap: 13px;
  margin-top: 11px;
}

.signature-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.signature-pad {
  width: 100%;
  height: 180px;
  border-radius: 18px;
  border: 1px dashed rgba(47, 54, 64, 0.2);
  background: rgba(255, 255, 255, 1);
  touch-action: none;
  box-shadow: inset 0 2px 10px rgba(15, 23, 42, 0.04);
}

.signature-preview-card img {
  width: 100%;
  max-width: 320px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: white;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.signature-preview-card small {
  color: var(--muted);
}

/* ── Script Grid ──────────────────────────────────── */
.script-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── Autospeech ───────────────────────────────────── */
.autospeech-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.autospeech-transcript-panel,
.autospeech-assist-panel {
  align-self: start;
}

.autospeech-transcript-panel > p:first-of-type {
  min-height: 104px;
  max-height: 160px;
  overflow: auto;
}

.autospeech-csi-card {
  margin: 8px 0 8px;
  background: rgba(231, 242, 255, 0.75);
  border-color: rgba(23, 104, 229, 0.18);
  box-shadow: 0 4px 16px rgba(23, 104, 229, 0.09), var(--inset-top);
}

.autospeech-live-main > .panel {
  padding-top: 14px;
  padding-bottom: 14px;
}

.autospeech-transcript-panel .panel-actions {
  gap: 8px;
  margin-top: 2px;
}

.autospeech-transcript-panel .autospeech-start-button,
.autospeech-transcript-panel .autospeech-stop-button,
.autospeech-transcript-panel .autospeech-coaching-button {
  width: 170px;
  min-width: 170px;
  height: 52px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.autospeech-start-button {
  color: white;
  border-color: transparent;
}

.autospeech-start-button.is-idle {
  background: linear-gradient(145deg, #35a46a, #267a4e);
  border-color: rgba(38, 122, 78, 0.5);
  box-shadow: 0 2px 6px rgba(47, 143, 91, 0.3), 0 8px 20px rgba(47, 143, 91, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.autospeech-start-button.is-recording,
.autospeech-start-button.is-recording[disabled] {
  background: linear-gradient(145deg, #1e7af0, #1456c7);
  border-color: rgba(20, 86, 199, 0.6);
  color: white;
  opacity: 1;
  box-shadow: 0 2px 6px rgba(23, 104, 229, 0.3), 0 8px 20px rgba(23, 104, 229, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.autospeech-start-button.is-idle:hover {
  filter: brightness(1.07);
  box-shadow: 0 4px 14px rgba(47, 143, 91, 0.38), 0 10px 28px rgba(47, 143, 91, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.autospeech-stop-button,
.autospeech-stop-button[disabled] {
  background: rgba(194, 65, 90, 0.09);
  border-color: rgba(194, 65, 90, 0.24);
  color: var(--danger);
}

.autospeech-stop-button:hover {
  background: linear-gradient(145deg, #d4556e, #b03350);
  border-color: rgba(176, 51, 80, 0.5);
  color: white;
  box-shadow: 0 2px 6px rgba(194, 65, 90, 0.28), 0 8px 20px rgba(194, 65, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.autospeech-coaching-button,
.autospeech-coaching-button:hover,
.autospeech-coaching-button:focus-visible {
  background: rgba(23, 104, 229, 0.09);
  border-color: rgba(23, 104, 229, 0.26);
  color: var(--accent);
}

.autospeech-assist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.autospeech-assist-grid .details-card {
  min-width: 0;
}

@media (max-width: 1400px) {
  .autospeech-assist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .autospeech-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .autospeech-assist-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Status Cards ─────────────────────────────────── */
.status-card {
  margin-top: 18px;
  border-radius: 20px;
  border: 1px solid rgba(47, 54, 64, 0.09);
  padding: 18px 20px;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.status-card.approved {
  border-color: rgba(23, 104, 229, 0.3);
  background: rgba(23, 104, 229, 0.08);
  box-shadow: 0 4px 16px rgba(23, 104, 229, 0.1), var(--inset-top);
}

.status-card.generated,
.status-card.sent,
.status-card.signed {
  border-color: rgba(23, 104, 229, 0.22);
}

.status-card.generated {
  background: rgba(255, 255, 255, 0.8);
}

.status-card.sent {
  background: rgba(201, 106, 37, 0.08);
  border-color: rgba(201, 106, 37, 0.24);
  box-shadow: 0 4px 16px rgba(201, 106, 37, 0.08), var(--inset-top);
}

.status-card.signed {
  background: rgba(23, 104, 229, 0.08);
  border-color: rgba(23, 104, 229, 0.3);
}

.status-card.declined,
.status-card.error {
  border-color: rgba(183, 75, 63, 0.3);
  background: rgba(183, 75, 63, 0.08);
  box-shadow: 0 4px 16px rgba(183, 75, 63, 0.08), var(--inset-top);
}

.status-card strong {
  display: block;
  margin: 9px 0;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.status-pill-button {
  border-radius: 10px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: white;
  color: var(--muted);
  padding: 10px 15px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07), 0 3px 10px rgba(15, 23, 42, 0.05);
  transition: all 160ms ease;
}

.status-pill-button.is-complete {
  color: white;
  border-color: rgba(20, 86, 199, 0.5);
  background: linear-gradient(145deg, #1e7af0, #1456c7);
  box-shadow: 0 2px 8px rgba(23, 104, 229, 0.28), 0 6px 18px rgba(23, 104, 229, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* ── Doc Preview ──────────────────────────────────── */
.doc-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.doc-preview-card {
  display: grid;
  gap: 11px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 251, 255, 0.97);
  padding: 16px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.doc-preview-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: white;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.09);
}

/* ── Clock Grid ───────────────────────────────────── */
.sensitive-data-card {
  gap: 14px;
}

.sensitive-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: start;
}

.sensitive-status-item {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 251, 255, 0.97);
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.sensitive-status-item strong {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.sensitive-status-item small {
  color: var(--muted);
  line-height: 1.35;
}

.sensitive-status-item.is-complete {
  border-color: rgba(38, 122, 78, 0.18);
  background: rgba(241, 249, 244, 0.98);
}

.sensitive-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.sensitive-upload-grid .doc-preview-card {
  gap: 8px;
  min-height: 118px;
  padding: 14px 16px;
  border-radius: 18px;
}

.sensitive-upload-grid .doc-preview-card img {
  aspect-ratio: 1.3 / 1;
  border-radius: 12px;
}

.clock-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.pending-transcript {
  border-radius: 14px;
  background: rgba(23, 104, 229, 0.1);
  color: var(--accent);
  padding: 13px 16px;
  margin-bottom: 13px;
  box-shadow: 0 4px 14px rgba(23, 104, 229, 0.1), var(--inset-top);
}

.audio-capture-status-card {
  margin-bottom: 2px;
}

.audio-capture-status-card small {
  color: var(--muted);
}

/* ── Media ────────────────────────────────────────── */
.media-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 13px;
}

.quick-service-button {
  text-align: left;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: rgba(248, 251, 255, 0.96);
  color: var(--ink) !important;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm), var(--inset-top);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quick-service-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--inset-top);
}

.quick-service-button strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink) !important;
}

.quick-service-button span {
  color: var(--muted);
  font-size: 0.88rem;
}

.quick-service-button span + span {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
}

.quick-service-button.is-selected {
  border-color: rgba(23, 104, 229, 0.42);
  background: rgba(23, 104, 229, 0.08);
  box-shadow: var(--shadow-accent);
}

.tech-story-card .voice-capture-panel {
  margin-bottom: 6px;
}

.voice-control-row {
  margin-top: 0;
}

.tech-story-action-row {
  margin-top: 4px;
  margin-bottom: 6px;
}

.tech-story-card > .details-card {
  margin-top: 4px;
}

.tech-start-button,
.tech-stop-button,
.tech-improve-button {
  min-height: 44px;
  padding: 0 24px;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  color: #666666;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
}

.tech-start-button:hover,
.tech-stop-button:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tech-start-button.is-idle {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  color: #666666;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tech-start-button.is-capturing {
  background: linear-gradient(135deg, #34C759 0%, #30B24A 50%, #2A9F3D 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.tech-start-button.is-capturing:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 199, 89, 0.4);
}

.tech-start-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tech-stop-button {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  color: #666666;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tech-stop-button.is-live {
  background: linear-gradient(135deg, #FF6B6B 0%, #E63C2B 50%, #CC0000 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.tech-stop-button.is-live:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.tech-stop-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tech-improve-button {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.98));
  border-color: rgba(15, 110, 143, 0.26);
  color: #0f6e8f;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07), 0 3px 10px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tech-improve-button:hover {
  border-color: rgba(15, 110, 143, 0.4);
  color: #0b5972;
}

.tech-improve-button:disabled {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(47, 54, 64, 0.12);
  color: rgba(90, 107, 128, 0.72);
}

.tech-recommendation-card small {
  display: block;
  margin-top: 6px;
}

.media-tile {
  display: grid;
  gap: 11px;
  border-radius: 20px;
  border: 1px solid rgba(47, 54, 64, 0.09);
  background: rgba(248, 251, 255, 0.97);
  padding: 14px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.media-tile img,
.media-tile video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(31, 42, 50, 0.06);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.audio-preview-card {
  display: grid;
  gap: 13px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(15, 110, 143, 0.09), rgba(23, 104, 229, 0.09)),
    rgba(31, 42, 50, 0.03);
  box-shadow: 0 4px 16px rgba(15, 110, 143, 0.08), var(--inset-top);
}

.audio-preview-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f6e8f;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 110, 143, 0.14);
  box-shadow: 0 2px 8px rgba(15, 110, 143, 0.1);
}

.audio-preview-card audio {
  width: 100%;
}

.media-caption {
  display: grid;
  gap: 4px;
}

.media-caption p {
  margin: 0;
}

.media-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.media-status {
  color: var(--accent);
}

.media-actions {
  margin-top: 5px;
}

/* ── Walkthrough ──────────────────────────────────── */
.walkthrough-helper-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  align-items: flex-start;
}

.walkthrough-helper-row p {
  flex: 1 1 360px;
  max-width: 72ch;
}

.walkthrough-capture-actions {
  margin: 14px 0 18px;
}

.walkthrough-summary-grid {
  margin-bottom: 18px;
}

.walkthrough-angle-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.walkthrough-panel .details-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 249, 255, 0.93));
  box-shadow: var(--shadow-sm), var(--inset-card);
}

.walkthrough-angle-grid .details-card {
  padding: 13px 15px;
  border-radius: 18px;
}

.walkthrough-angle-grid .details-card p {
  font-size: 0.95rem;
}

.walkthrough-angle-grid .details-card small {
  font-size: 0.82rem;
  line-height: 1.36;
}

.walkthrough-summary-grid .details-card small,
.walkthrough-media-tile .support-text {
  color: var(--muted);
}

.walkthrough-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.walkthrough-media-tile {
  align-content: start;
}

.walkthrough-detail-grid-compact .customer-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.walkthrough-detail-grid-compact .customer-contact-row input {
  width: 100%;
  min-width: 0;
}

.walkthrough-detail-grid-compact .customer-contact-sync-button {
  min-width: 100px;
  padding: 10px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, #111 45%);
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.walkthrough-detail-grid-compact .customer-contact-sync-button:hover {
  filter: brightness(1.04);
}

.walkthrough-detail-grid-compact .customer-contact-sync-button:active,
.walkthrough-detail-grid-compact .customer-contact-sync-button.is-done,
.walkthrough-detail-grid-compact .customer-contact-sync-button:disabled {
  border-color: rgba(47, 54, 64, 0.16);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: none;
}

/* ── Animations ───────────────────────────────────── */
@keyframes communication-glow {
  from {
    box-shadow: 0 0 0 1px rgba(23, 104, 229, 0.1), 0 0 14px rgba(23, 104, 229, 0.16), var(--inset-top);
  }

  to {
    box-shadow: 0 0 0 1px rgba(23, 104, 229, 0.18), 0 0 32px rgba(23, 104, 229, 0.34), var(--inset-top);
  }
}

/* ── Walkthrough Findings ─────────────────────────── */
.walkthrough-finding-list {
  display: grid;
  gap: 11px;
  margin-top: 0;
  padding-left: 20px;
}

.walkthrough-finding-list strong {
  color: var(--ink);
}

/* ── Upload Button ────────────────────────────────── */
.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.media-label-field {
  margin-top: 5px;
}

.advisor-media-tile {
  align-content: start;
}

/* ── Modal ────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: start center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(10, 18, 34, 0.52);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  border-radius: 32px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 32px 80px rgba(10, 18, 34, 0.28), 0 12px 32px rgba(10, 18, 34, 0.14), var(--inset-card);
}

.advisor-wording-modal {
  width: min(1040px, calc(100vw - 28px));
}

.autospeech-coaching-modal {
  width: min(920px, calc(100vw - 28px));
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-style: italic;
}

.loading-state p {
  margin: 0;
}

.modal-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.uber-launch-button {
  border-color: rgba(47, 54, 64, 0.16);
}

.uber-ride-modal {
  width: min(880px, calc(100vw - 28px));
}

.uber-suggestion-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.uber-suggestion-button {
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(47, 54, 64, 0.12);
  background: rgba(248, 251, 255, 0.94);
  color: var(--ink);
  padding: 9px 10px;
}

.uber-suggestion-button:hover {
  border-color: rgba(23, 104, 229, 0.32);
  background: rgba(236, 244, 255, 0.98);
}

.uber-driver-overlay {
  width: min(760px, calc(100vw - 28px));
}

.clock-action-button {
  min-height: 52px;
  padding: 0 26px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clock-action-button.is-start {
  background: linear-gradient(145deg, #35a46a, #267a4e);
  border-color: rgba(38, 122, 78, 0.5);
  box-shadow: 0 2px 6px rgba(47, 143, 91, 0.28), 0 6px 18px rgba(47, 143, 91, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.clock-action-button.is-end {
  background: linear-gradient(145deg, #d4556e, #b03350);
  border-color: rgba(176, 51, 80, 0.5);
  color: #fff;
  box-shadow: 0 2px 6px rgba(194, 65, 90, 0.28), 0 6px 18px rgba(194, 65, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.clock-action-button.is-disabled,
.clock-action-button:disabled {
  background: linear-gradient(145deg, #9ca3af, #6b7280);
  border-color: rgba(107, 114, 128, 0.42);
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}

.advisor-decision-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.recommendation-decision-button {
  min-width: 120px;
}

.advisor-assignment-modal .loaner-number-pill-input {
  width: max-content;
  min-width: 120px;
  max-width: 180px;
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(248, 251, 255, 0.96);
  border: 1px solid rgba(23, 104, 229, 0.24);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.advisor-assignment-modal .work-order-number-compact-input {
  width: 210px;
  max-width: 100%;
}

.advisor-assignment-modal {
  gap: 10px;
  padding: 20px 22px;
}

.advisor-assignment-modal .panel-head {
  margin-bottom: 0;
}

.advisor-assignment-modal .advisor-assignment-meta {
  margin: 0;
  line-height: 1.32;
}

.advisor-assignment-modal .advisor-assignment-input-group,
.advisor-assignment-modal label {
  margin: 0;
}

.advisor-assignment-modal .panel-actions {
  margin-top: 4px;
}

.advisor-loaner-pill-list {
  margin-top: 4px;
}

.advisor-loaner-pill-list .decision-pill {
  border-radius: 999px;
  border: 1px solid var(--theme-soft-border);
  background: var(--theme-soft-bg);
  color: var(--theme-soft-text);
  padding: 8px 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.advisor-loaner-pill-list .decision-pill.is-accept {
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  border-color: color-mix(in srgb, var(--accent) 60%, #111 40%);
  color: #fff;
}

/* ── Advisor Wording ──────────────────────────────── */
.advisor-wording-grid,
.advisor-objection-grid {
  display: grid;
  gap: 16px;
}

.advisor-wording-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.advisor-objection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wording-script-card p,
.objection-card p {
  line-height: 1.72;
}

.objection-card strong {
  display: block;
  margin-top: 11px;
  font-size: 0.94rem;
}

.objection-quote {
  font-style: italic;
  color: var(--ink);
}

/* ── Reports ──────────────────────────────────────── */
.report-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.performance-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.performance-metric-card.is-clickable {
  position: relative;
}

.performance-change--up {
  color: #12733b;
  font-weight: 700;
}

.performance-change--down {
  color: #b42318;
  font-weight: 700;
}

.report-card strong {
  display: block;
  margin: 9px 0;
  font-size: 2rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.03em;
}

.report-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.report-list {
  display: grid;
  gap: 13px;
}

.report-row {
  display: grid;
  gap: 13px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 251, 255, 0.95);
  padding: 15px 18px;
  box-shadow: var(--shadow-sm), var(--inset-top);
  transition: box-shadow 160ms ease;
}

.report-row:hover {
  box-shadow: var(--shadow), var(--inset-top);
}

.report-row p {
  margin: 6px 0 0;
}

.report-row-button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.report-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.performance-rank-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.performance-rank-row strong,
.product-performance-row strong {
  font-size: 1.04rem;
}

.performance-name-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 700;
}

.performance-owner-summary,
.performance-breakdown-list {
  display: grid;
  gap: 15px;
}

.performance-ro-breakdown {
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.performance-ro-metrics {
  margin-top: 4px;
}

.report-row-caret {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.progress-fill-tech {
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

/* ── BDC Report Tab ───────────────────────────────── */
.bdc-report-container {
  padding: 0;
}

.bdc-report-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.bdc-report-header h2 {
  margin: 0 0 4px;
}

.bdc-report-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.bdc-report-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
}

.bdc-report-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.bdc-report-table thead {
  background: rgba(248, 251, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 10;
}

.bdc-report-table th {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
}

.bdc-report-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  font-size: 0.95rem;
}

.bdc-report-table tbody tr:hover {
  background: rgba(248, 251, 255, 0.5);
}

.bdc-report-table tbody tr:last-child td {
  border-bottom: none;
}

.show-rate-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  min-width: 50px;
}

.show-rate-good {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.show-rate-fair {
  background: rgba(234, 179, 8, 0.15);
  color: #854d0e;
}

.show-rate-poor {
  background: rgba(239, 68, 68, 0.15);
  color: #7f1d1d;
}

.empty-state {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Calendar ─────────────────────────────────────── */
.calendar-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.calendar-button-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.report-date-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px));
  gap: 13px;
  margin-bottom: 18px;
}

.report-date-controls input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(47, 54, 64, 0.11);
  background: rgba(250, 252, 255, 1);
  padding: 10px 13px;
  color: var(--ink);
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.05);
}

/* ── Payment Detail ───────────────────────────────── */
.payment-detail-list {
  display: grid;
  gap: 11px;
  padding-top: 4px;
}

.payment-detail-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 13px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.94);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm), var(--inset-top);
}

.payment-detail-row p {
  margin: 6px 0 0;
}

.payment-detail-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
}

.payment-detail-meta strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.report-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-copy {
  line-height: 1.72;
}

/* ── Responsive (lower breakpoints) ─────────────────── */
@media (max-width: 980px) {
  .report-card-grid,
  .performance-metric-grid,
  .report-split,
  .finance-grid,
  .tech-grid,
  .communication-shell,
  .communication-main,
  .communication-side,
  .advisor-wording-grid,
  .advisor-objection-grid,
  .field-grid,
  .clock-grid {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: span 1;
  }

  .tech-assignment-card,
  .tech-assignment-lines-card,
  .tech-upsells-card,
  .tech-ai-card,
  .tech-story-card,
  .tech-media-card {
    grid-column: auto;
    grid-row: auto;
  }

  .repair-line {
    grid-template-columns: auto 1fr;
  }

  .repair-line-meta {
    grid-column: 2;
    justify-items: start;
  }

  .payment-detail-meta {
    justify-items: start;
  }

  .communication-thread-meta {
    grid-template-columns: 1fr;
  }

  .communication-alerts-panel {
    position: static;
    top: auto;
    min-height: clamp(480px, 62vh, 760px);
  }

  .communication-notification-list {
    max-height: none;
    min-height: 0;
  }

  .walkthrough-detail-grid-compact .customer-contact-row {
    grid-template-columns: 1fr;
  }

  .walkthrough-detail-grid-compact .customer-contact-sync-button {
    width: 100%;
  }

  .loaner-stage-grid,
  .loaner-stage-fields {
    grid-template-columns: 1fr;
  }

  .app-brand-banner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .app-brand-meta {
    justify-items: start;
    text-align: left;
  }

  .report-date-controls {
    grid-template-columns: 1fr;
  }

  .finance-ro-card,
  .finance-repair-card,
  .finance-card-intake-card,
  .finance-contract-card {
    grid-column: auto;
    grid-row: auto;
  }
}

/* ══════════════════════════════════════════════════════
   SEMANTIC BUTTON COLOR SYSTEM — flow: default → hover → active(grey)
   ══════════════════════════════════════════════════════ */

/* Success / confirm / complete actions */
.btn-success,
button.btn-success {
  background: linear-gradient(145deg, #35a46a, #267a4e);
  color: white;
  border-color: rgba(38, 122, 78, 0.5);
  box-shadow: 0 2px 6px rgba(47, 143, 91, 0.28), 0 6px 18px rgba(47, 143, 91, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-success:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(47, 143, 91, 0.38), 0 12px 28px rgba(47, 143, 91, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* Danger / destructive / remove actions */
.btn-danger,
button.btn-danger {
  background: linear-gradient(145deg, #d4556e, #b03350);
  color: white;
  border-color: rgba(176, 51, 80, 0.5);
  box-shadow: 0 2px 6px rgba(194, 65, 90, 0.28), 0 6px 18px rgba(194, 65, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-danger:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(194, 65, 90, 0.38), 0 12px 28px rgba(194, 65, 90, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Warning / attention actions */
.btn-warn,
button.btn-warn {
  background: linear-gradient(145deg, #e8900a, #c47208);
  color: white;
  border-color: rgba(196, 114, 8, 0.5);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.28), 0 6px 18px rgba(217, 119, 6, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-warn:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.38), 0 12px 28px rgba(217, 119, 6, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Neutral / secondary outline actions */
.btn-neutral,
button.btn-neutral {
  background: white;
  color: var(--muted);
  border: 1.5px solid rgba(47, 54, 64, 0.14);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07), 0 3px 10px rgba(15, 23, 42, 0.05);
}
.btn-neutral:hover {
  border-color: rgba(23, 104, 229, 0.3);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(23, 104, 229, 0.1), 0 4px 14px rgba(15, 23, 42, 0.07);
}

/* Tab color flow: each tab gets subtle tint when hovered (inactive) */
.tab-button:not(.is-active) {
  color: var(--muted);
}

.tab-button:not(.is-active):hover {
  color: var(--ink);
  background: linear-gradient(145deg, rgba(23, 104, 229, 0.06), rgba(67, 141, 255, 0.04));
}

/* Tinted inactive tabs by position for visual flow */
.tab-bar .tab-button:nth-child(1):not(.is-active):hover { border-color: rgba(23, 104, 229, 0.3); }
.tab-bar .tab-button:nth-child(2):not(.is-active):hover { border-color: rgba(14, 116, 144, 0.3); }
.tab-bar .tab-button:nth-child(3):not(.is-active):hover { border-color: rgba(47, 143, 91, 0.3); }
.tab-bar .tab-button:nth-child(4):not(.is-active):hover { border-color: rgba(217, 119, 6, 0.3); }
.tab-bar .tab-button:nth-child(5):not(.is-active):hover { border-color: rgba(194, 65, 90, 0.3); }
.tab-bar .tab-button:nth-child(6):not(.is-active):hover { border-color: rgba(23, 104, 229, 0.3); }
.tab-bar .tab-button:nth-child(7):not(.is-active):hover { border-color: rgba(14, 116, 144, 0.3); }
.tab-bar .tab-button:nth-child(8):not(.is-active):hover { border-color: rgba(47, 143, 91, 0.3); }
.tab-bar .tab-button:nth-child(9):not(.is-active):hover { border-color: rgba(217, 119, 6, 0.3); }

/* ══════════════════════════════════════════════════════
   SPACING FIXES — section-to-section consistent rhythm
   ══════════════════════════════════════════════════════ */

/* Manager search panel gets top gap when it follows summary-grid */
.summary-grid + .panel,
.manager-search-panel {
  margin-top: 16px;
}

/* Source sync panel spacing */
.summary-grid ~ section.panel,
.integration-panel {
  margin-top: 16px;
}

/* Consistent section gap wherever panels stack without dashboard-stack */
section.panel + section.panel,
section.panel + main {
  margin-top: 16px;
}

/* ══════════════════════════════════════════════════════
   IMPROVED INPUT / SEARCH FIELD STYLING
   ══════════════════════════════════════════════════════ */

/* All text inputs, selects, textareas — elevated appearance */
.field-grid input,
.field-grid select,
.textarea-field input,
.textarea-field textarea,
.upload-field input,
.scenario-grid input,
.scenario-grid select,
.compact-field select,
.report-date-controls input,
.admin-pin-input,
.finance-identity-grid input {
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid rgba(47, 54, 64, 0.12);
  background: #ffffff;
  padding: 11px 14px;
  color: var(--ink);
  font-size: 0.93rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), inset 0 1px 4px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-grid input:focus,
.field-grid select:focus,
.textarea-field input:focus,
.textarea-field textarea:focus,
.scenario-grid input:focus,
.scenario-grid select:focus,
.compact-field select:focus,
.report-date-controls input:focus {
  outline: none;
  border-color: rgba(23, 104, 229, 0.42);
  box-shadow: 0 0 0 3px rgba(23, 104, 229, 0.1), inset 0 1px 4px rgba(15, 23, 42, 0.03);
}

.field-grid input::placeholder,
.textarea-field input::placeholder,
.textarea-field textarea::placeholder {
  color: rgba(90, 107, 128, 0.6);
}

/* Textarea height */
.textarea-field textarea {
  min-height: 100px;
  resize: vertical;
}

/* Search input shell — already styled but ensure height */
.search-input-shell {
  min-height: 48px;
}

/* Select dropdown — custom arrow cue */
.field-grid select,
.compact-field select,
.scenario-grid select {
  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='%235a6b80' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ══════════════════════════════════════════════════════
   BUTTON-TO-BUTTON SPACING — always 10px gap in action rows
   ══════════════════════════════════════════════════════ */

.panel-actions,
.walkthrough-capture-actions,
.communication-composer-actions,
.communication-group-grid,
.hero-tags,
.recon-repair-actions,
.modal-summary-row,
.loaner-walkthrough-card .panel-actions {
  gap: 10px;
}

/* Adjacent primary-button or text-button without panel-actions wrapper */
.primary-button + .primary-button,
.primary-button + .text-button,
.text-button + .primary-button,
.text-button + .text-button {
  margin-left: 2px;
}

/* Final UI overrides for pill inputs, aligned action buttons, and red end/stop defaults */
.walkthrough-detail-grid-compact .customer-contact-row input,
.walkthrough-mileage-input,
.tech-ro-input,
.recon-search-input,
.field-grid input,
.field-grid select,
.textarea-field input,
.upload-field input,
.scenario-grid input,
.scenario-grid select,
.compact-field select,
.report-date-controls input,
.admin-pin-input,
.finance-identity-grid input {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.9));
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 1px 3px rgba(15, 23, 42, 0.06);
}

.search-input-shell,
.recon-search-input-shell {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.9));
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 1px 3px rgba(15, 23, 42, 0.06);
}

.walkthrough-detail-grid-compact .customer-contact-row input {
  min-height: 44px;
  padding-inline: 16px;
}

.walkthrough-mileage-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 10px 0 8px;
}

.walkthrough-mileage-label {
  margin: 0;
  color: var(--ink);
}

.walkthrough-mileage-input {
  width: 100%;
  min-width: 0;
  text-align: left;
  min-height: 44px;
  max-width: none;
}

.walkthrough-mileage-confirm-button {
  min-width: 100px;
  padding: 10px 18px;
  border-radius: 16px;
  white-space: nowrap;
}


.tech-ro-search-row {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.recon-search-row {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: center;
}

.tech-ro-search-button,
.recon-search-button {
  min-height: 46px;
  min-width: 112px;
  border-radius: 16px;
  padding-inline: 18px;
  justify-content: center;
}

.recon-search-input-shell,
.recon-search-input {
  min-height: 46px;
}

.recon-search-input-shell {
  display: grid;
  align-items: center;
  padding: 0 16px;
  width: 100%;
}

.recon-search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.recon-search-input:focus {
  outline: none;
}

.appointment-intake-search-friendly .primary-button,
.tech-ro-search-button,
.recon-search-button,
.walkthrough-detail-grid-compact .customer-contact-sync-button,
.walkthrough-mileage-confirm-button {
  border-radius: 16px;
}

.appointment-intake-search-friendly .search-input-row {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
}

.appointment-intake-search-friendly .primary-button {
  min-height: 52px;
  min-width: 112px;
  width: 112px;
  padding-inline: 16px;
  justify-content: center;
}

.recon-search-row {
  width: 100%;
}

.tech-stop-button:disabled,
.tech-stop-button.is-idle {
  background: rgba(212, 85, 110, 0.14);
  border-color: rgba(176, 51, 80, 0.3);
  color: #b03350;
  box-shadow: none;
}

.tech-clock-end-button.is-disabled,
.tech-clock-end-button:disabled {
  background: rgba(212, 85, 110, 0.14);
  border-color: rgba(176, 51, 80, 0.32);
  color: #b03350;
  box-shadow: none;
}

@media (max-width: 700px) {
  .walkthrough-mileage-row {
    grid-template-columns: 1fr;
  }

  .recon-search-button {
    width: 100%;
  }

  .recon-search-row {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════
   NOTICE CARD BANNER — compact title-only header panels
   ══════════════════════════════════════════════════════ */

.notice-card,
.finance-empty.panel {
  padding: 14px 22px;
}

.notice-card .panel-head,
.finance-empty .panel-head {
  margin-bottom: 0;
}

.notice-card .panel-head h2 {
  font-size: 1.25rem;
  margin-top: 2px;
}

.communication-empty-panel {
  margin-bottom: 14px;
}

/* Diag dashboard autospeech live layout spacing */
.autospeech-live-layout {
  display: grid;
  gap: 18px;
}

.autospeech-live-main {
  display: grid;
  gap: 18px;
}

/* Details card inside autospeech assist grid — consistent padding */
.autospeech-assist-grid .details-card {
  padding: 16px 18px;
}

.autospeech-assist-grid .details-card p,
.autospeech-assist-grid .details-card ul {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Open Stock Dashboard */
.open-stock-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-bar-wrapper {
  padding: 0 16px;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  font-size: 14px;
  background: var(--bg-soft);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.open-stock-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 16px;
}

.open-stock-vehicle-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.open-stock-vehicle-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.vehicle-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.vehicle-item-head > div:first-child {
  flex: 1;
}

.vehicle-item-head strong {
  display: block;
  font-size: 15px;
}

.vehicle-item-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.vehicle-item-head small {
  font-size: 12px;
  color: var(--muted);
}

/* Repair Section Headers */
.repair-section-header {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: rgba(23, 104, 229, 0.08);
  border-radius: 8px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.repair-section-header.is-approved {
  background: rgba(76, 175, 80, 0.08);
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

.repair-section-header.is-pending {
  background: rgba(33, 150, 243, 0.08);
  color: #1976d2;
}

.repair-section-header.is-declined {
  background: rgba(194, 65, 90, 0.08);
  color: var(--danger);
  border-left: 4px solid #e74c3c;
}

/* Recon Repair Decision Buttons */
.recon-decision-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1.5px solid;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.recon-decision-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.recon-btn-approve {
  background: linear-gradient(145deg, #38a169, #2f8f5b);
  color: white;
  border-color: rgba(47, 143, 91, 0.6);
  box-shadow: 0 2px 6px rgba(47, 143, 91, 0.3), 0 8px 20px rgba(47, 143, 91, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.recon-btn-approve:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(47, 143, 91, 0.4), 0 12px 28px rgba(47, 143, 91, 0.28);
}

.recon-btn-decline {
  background: linear-gradient(145deg, #d4566f, #c2415a);
  color: white;
  border-color: rgba(194, 65, 90, 0.6);
  box-shadow: 0 2px 6px rgba(194, 65, 90, 0.3), 0 8px 20px rgba(194, 65, 90, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.recon-repair-action-row {
  margin-bottom: 14px;
}

.recon-repair-action-row .primary-button {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 20px;
  font-weight: 700;
}

.recon-repair-add-button {
  background: linear-gradient(145deg, #2ea44f, #228a40);
  border-color: rgba(34, 138, 64, 0.45);
  box-shadow: 0 2px 10px rgba(34, 138, 64, 0.25);
}

.recon-repair-delete-button {
  background: linear-gradient(145deg, #d9485f, #c2334c);
  border-color: rgba(194, 51, 76, 0.45);
  box-shadow: 0 2px 10px rgba(194, 51, 76, 0.25);
}

.recon-send-approval-button {
  background: linear-gradient(145deg, #2d7df6, #1f64d6);
  border-color: rgba(31, 100, 214, 0.45);
  box-shadow: 0 2px 10px rgba(31, 100, 214, 0.25);
}

.recon-btn-decline:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(194, 65, 90, 0.4), 0 12px 28px rgba(194, 65, 90, 0.28);
}

/* Tech Assign Button */
.tech-assign-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1.5px solid;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
  background: linear-gradient(145deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: white;
  border-color: color-mix(in srgb, var(--accent) 60%, #111 40%);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 38%, transparent), 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.tech-assign-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 42%, transparent), 0 12px 28px color-mix(in srgb, var(--accent) 30%, transparent);
}

.tech-assign-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Performance Tab */
.perf-header {
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(23, 104, 229, 0.08), rgba(67, 141, 255, 0.05));
  border: 1px solid rgba(23, 104, 229, 0.15);
}

.kpi-metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  padding: 0;
}

.kpi-pill {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1.5px solid;
  display: grid;
  gap: 4px;
  transition: all 200ms ease;
  cursor: default;
}

.kpi-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.kpi-pill-primary {
  background: linear-gradient(135deg, rgba(23, 104, 229, 0.12), rgba(23, 104, 229, 0.08));
  border-color: rgba(23, 104, 229, 0.3);
}

.kpi-pill-success {
  background: linear-gradient(135deg, rgba(47, 143, 91, 0.12), rgba(47, 143, 91, 0.08));
  border-color: rgba(47, 143, 91, 0.3);
}

.kpi-pill-accent {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(217, 119, 6, 0.08));
  border-color: rgba(217, 119, 6, 0.3);
}

.kpi-pill-info {
  background: linear-gradient(135deg, rgba(15, 110, 143, 0.12), rgba(15, 110, 143, 0.08));
  border-color: rgba(15, 110, 143, 0.3);
}

.kpi-pill-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.12));
  border-color: rgba(59, 130, 246, 0.4);
  border-width: 2px;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.kpi-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.kpi-subtext {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.report-pill-strip {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 2px 0 0;
}

.report-pill-strip .kpi-pill {
  padding: 10px 12px;
  border-radius: 12px;
}

.report-pill-strip .kpi-label {
  font-size: 0.68rem;
}

.report-pill-strip .kpi-value {
  font-size: 1rem;
}

.perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1400px) {
  .perf-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .kpi-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.perf-section {
  display: flex;
  flex-direction: column;
  background: rgba(248, 251, 255, 0.98);
  border: 1px solid rgba(23, 104, 229, 0.12);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.perf-section .panel-head {
  margin-bottom: 18px;
}

.perf-rankings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.perf-row {
  display: grid;
  grid-template-columns: 60px 1fr 150px;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.98), rgba(244, 249, 255, 0.96));
  border-radius: 14px;
  border: 1px solid rgba(23, 104, 229, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 200ms ease;
}

.perf-row:hover {
  background: linear-gradient(135deg, rgba(240, 248, 255, 0.99), rgba(236, 244, 255, 0.98));
  border-color: rgba(23, 104, 229, 0.24);
  box-shadow: 0 4px 16px rgba(23, 104, 229, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.perf-rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.perf-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perf-info strong {
  font-size: 0.95rem;
  color: var(--ink);
}

.perf-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.perf-metrics span {
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(6, 182, 212, 0.1));
  border-radius: 18px;
  white-space: nowrap;
  border: 1px solid rgba(59, 130, 246, 0.24);
  font-weight: 600;
  font-size: 0.82rem;
  color: rgba(15, 23, 42, 0.8);
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
  transition: all 140ms ease;
}

.perf-metrics span:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.15));
  border-color: rgba(59, 130, 246, 0.36);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.perf-items {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(102, 126, 153, 0.1);
}

.perf-items-spiff {
  color: #0f4c81;
  font-weight: 700;
}

.perf-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.perf-bar-track {
  width: 100%;
  height: 28px;
  background: linear-gradient(90deg, rgba(23, 104, 229, 0.06), rgba(15, 110, 143, 0.04));
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(23, 104, 229, 0.12);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.perf-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 50%, #0891b2 100%);
  border-radius: 14px;
  transition: width 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 6px rgba(37, 99, 235, 0.25);
  position: relative;
}

.perf-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  border-radius: 14px;
}

.perf-bar small {
  font-size: 0.8rem;
  color: var(--ink);
  font-weight: 700;
  margin-top: 2px;
}

.perf-incentives {
  border: 1px solid rgba(23, 104, 229, 0.12);
  background: rgba(248, 251, 255, 0.98);
}

.perf-incentives-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.perf-incentive-card {
  border: 1px solid rgba(23, 104, 229, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.98), rgba(244, 249, 255, 0.96));
  padding: 14px;
  display: grid;
  gap: 12px;
}

.perf-incentive-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.perf-incentive-head h4 {
  margin: 0;
}

.perf-incentive-head strong {
  font-size: 0.95rem;
}

.perf-incentive-rows {
  display: grid;
  gap: 10px;
}

.perf-incentive-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr auto;
  gap: 8px;
  align-items: center;
}

.perf-incentive-row input {
  width: 100%;
}

.perf-incentive-row select {
  width: 100%;
}

.perf-incentive-remove-button {
  min-width: 96px;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid rgba(148, 163, 184, 0.5);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.perf-incentive-remove-button:hover:not(:disabled) {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.perf-incentive-add-button {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.perf-incentive-row input,
.perf-incentive-row select {
  height: 42px;
  border-radius: 12px;
}

.perf-incentive-summary-list {
  margin-top: 6px;
  display: grid;
  gap: 8px;
}

.perf-incentive-summary-card {
  border: 1px solid rgba(23, 104, 229, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(238, 246, 255, 0.9));
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.perf-incentive-summary-card strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.perf-incentive-summary-card small {
  color: var(--muted);
}

.recon-delivery-date-input {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
}

.estimate-shell {
  border: 1px solid rgba(23, 104, 229, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.95));
}

.estimate-shell-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: stretch;
}

.estimate-main-column {
  display: grid;
  gap: 12px;
}

.estimate-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(23, 104, 229, 0.12);
}

.estimate-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.estimate-api-message {
  display: block;
  margin-top: 8px;
}

.estimate-suggestions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.estimate-board-header {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(226, 238, 255, 0.8);
  border: 1px solid rgba(23, 104, 229, 0.16);
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.7fr 0.8fr;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.estimate-line-list {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

.estimate-line-card {
  border: 1px solid rgba(23, 104, 229, 0.15);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.estimate-line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
}

.estimate-line-title {
  display: grid;
  gap: 2px;
}

.estimate-line-total {
  font-weight: 800;
  color: #0f4c81;
}

.estimate-grid {
  display: grid;
  gap: 8px;
}

.estimate-grid-tech {
  grid-template-columns: 1.2fr 0.45fr;
  margin-bottom: 8px;
}

.estimate-grid-parts {
  grid-template-columns: 0.85fr 1.2fr 0.55fr 0.65fr 0.65fr;
}

.estimate-grid-pricing-single {
  grid-template-columns: 0.75fr 1.4fr 0.6fr 0.7fr 0.7fr 0.7fr;
  align-items: end;
  margin-top: 8px;
}

.estimate-field {
  display: grid;
  gap: 4px;
}

.estimate-field-wide {
  grid-column: 1 / -1;
}

.estimate-field span {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.estimate-field input,
.estimate-field textarea,
.estimate-field select {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.92rem;
}

.estimate-line-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.estimate-meta-chip {
  border: 1px solid rgba(23, 104, 229, 0.16);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(247, 251, 255, 0.95);
  display: grid;
  gap: 2px;
}

.estimate-meta-chip strong {
  font-size: 0.92rem;
}

.estimate-meta-chip small {
  color: var(--muted);
  font-size: 0.76rem;
}

.estimate-media-row {
  margin-top: 10px;
}

.estimate-approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.estimate-approval-row-main {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(90px, 0.8fr) minmax(130px, 1fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.estimate-approval-row-main span,
.estimate-approval-row-main strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.estimate-approval-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.estimate-media-buttons {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.estimate-media-button {
  min-height: 34px;
}

.estimate-line-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.estimate-alerts-rail .communication-alerts-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.estimate-alerts-rail .communication-notification-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Danger Button */
.danger-button {
  background: linear-gradient(145deg, #c2415a, #a83345);
  color: #ffffff;
  border: 1px solid rgba(194, 65, 90, 0.3);
}

.danger-button:hover:not([disabled]) {
  background: linear-gradient(145deg, #d94a65, #b73d50);
  box-shadow: 0 4px 12px rgba(194, 65, 90, 0.25);
}

.danger-button:active:not([disabled]) {
  transform: translateY(0) scale(0.98);
  background: linear-gradient(145deg, #a83345, #8f2a3a);
}

/* ── Repair Line Modal ────────────────────────────────── */
.repair-line-modal-backdrop {
  animation: repair-modal-fade-in 160ms ease both;
}

@keyframes repair-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.repair-line-modal-card {
  width: min(520px, calc(100vw - 28px));
  animation: repair-modal-slide-in 200ms cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

@keyframes repair-modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.repair-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repair-modal-title {
  margin: 0;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.repair-modal-close-button {
  margin-left: auto;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}

.repair-modal-close-button:hover {
  color: var(--ink);
  border-color: rgba(47, 54, 64, 0.22);
}

.repair-line-form {
  display: grid;
  gap: 14px;
}

.repair-form-errors {
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(194, 65, 90, 0.22);
  color: var(--danger);
  font-size: 0.88rem;
}

.repair-form-error-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.repair-form-group {
  display: grid;
  gap: 7px;
}

.repair-form-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.repair-form-required {
  color: var(--danger);
  margin-left: 2px;
}

.repair-form-input,
.repair-form-select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(47, 54, 64, 0.11);
  background: rgba(250, 252, 255, 1);
  padding: 10px 13px;
  color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.repair-form-input:focus,
.repair-form-select:focus {
  outline: none;
  border-color: rgba(23, 104, 229, 0.38);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05), 0 0 0 3px rgba(23, 104, 229, 0.1);
}

.repair-form-input[readonly] {
  background: rgba(240, 244, 250, 0.8);
  color: var(--muted);
  cursor: default;
}

.repair-form-field-error {
  border-color: rgba(194, 65, 90, 0.5) !important;
  box-shadow: inset 0 1px 3px rgba(194, 65, 90, 0.08), 0 0 0 3px rgba(194, 65, 90, 0.1) !important;
}

.repair-modal-actions {
  margin-top: 6px;
  justify-content: flex-end;
}

.repair-modal-save-button {
  background: linear-gradient(145deg, #2e7ceb, #1b5fcb);
  color: #fff;
  border: 1px solid rgba(23, 104, 229, 0.45);
  border-radius: 10px;
  padding: 8px 20px;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(23, 104, 229, 0.24);
}

.repair-modal-save-button:hover:not([disabled]) {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px rgba(23, 104, 229, 0.32);
}

.repair-modal-save-button:active:not([disabled]) {
  transform: translateY(0) scale(0.98);
  filter: none;
  box-shadow: 0 1px 4px rgba(23, 104, 229, 0.2);
}

/* ── Repair Dashboard ─────────────────────────────────── */
.repair-dashboard {
  display: grid;
  gap: 20px;
}

.repair-dashboard-head {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  margin-bottom: 4px;
}

.repair-section {
  display: grid;
  gap: 14px;
}

.repair-subsection-head {
  margin-bottom: 0;
}

.repair-section-title {
  margin: 2px 0 0;
  font-size: 1.08rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* VIN + search input rows */
.repair-vin-row,
.repair-search-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.repair-vin-input,
.repair-search-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  font-family: "Courier New", Courier, monospace;
}

.repair-search-input {
  letter-spacing: 0;
  font-family: inherit;
}

.repair-vin-input:focus,
.repair-search-input:focus {
  outline: none;
}

.repair-vin-input::placeholder,
.repair-search-input::placeholder {
  color: var(--muted);
  font-family: inherit;
  letter-spacing: 0;
}

.repair-decode-btn,
.repair-search-btn {
  min-height: 52px;
  padding: 0 22px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Loading state */
.repair-loading {
  padding: 24px 20px;
}

/* Error banner */
.repair-error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(194, 65, 90, 0.22);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
  animation: repair-modal-fade-in 160ms ease both;
}

.repair-error-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.repair-error-dismiss {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 0.9rem;
  color: var(--danger);
  border-color: rgba(194, 65, 90, 0.25);
  flex-shrink: 0;
}

.repair-error-dismiss:hover {
  background: rgba(194, 65, 90, 0.08);
  border-color: rgba(194, 65, 90, 0.4);
}

/* Decoded vehicle details card */
.repair-vehicle-details {
  animation: repair-modal-fade-in 200ms ease both;
}

.repair-vehicle-details-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.repair-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.repair-vehicle-field {
  display: grid;
  gap: 3px;
}

.repair-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.repair-field-value {
  font-size: 1rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.repair-vehicle-packages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
}

/* Empty state within repair dashboard */
.repair-empty-state {
  text-align: center;
  padding: 28px 24px;
}

.repair-empty-state p {
  margin: 0;
  line-height: 1.6;
}

/* Results grid */
.results-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Procedure cards */
.procedure-card {
  display: grid;
  gap: 10px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.procedure-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--inset-top);
}

.procedure-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.procedure-name {
  font-size: 0.98rem;
  font-family: "Bahnschrift", "Franklin Gothic Medium", sans-serif;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.procedure-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.procedure-steps-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
}

.procedure-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .repair-vin-row,
  .repair-search-row {
    grid-template-columns: 1fr;
  }

  .repair-decode-btn,
  .repair-search-btn {
    width: 100%;
  }

  .repair-vehicle-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

/* Parts Dashboard */
.parts-dashboard {
  display: grid;
  gap: 14px;
}

.parts-dashboard-tabs {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.72);
  width: fit-content;
}

.parts-dashboard-tab {
  border-radius: 999px;
  border: 1px solid rgba(23, 104, 229, 0.18);
  background: transparent;
  color: var(--text-color, #1b2a3a);
  min-width: 108px;
  justify-content: center;
}

.parts-dashboard-tab.active {
  background: linear-gradient(135deg, #1f73e8, #1b5fc0);
  color: #fff;
  border-color: rgba(23, 104, 229, 0.45);
}

/* Tab Navigation */
.parts-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--stroke);
  margin-bottom: 24px;
}

.parts-tab-btn {
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  color: #5a6b80;
  transition: all 0.2s;
}

.parts-tab-btn:hover {
  color: var(--ink);
}

.parts-tab-btn.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tab Panes */
.parts-tab-pane {
  display: none;
}

.parts-tab-pane.is-active {
  display: block;
}

.parts-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.parts-dashboard-grid--two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.parts-ro-card {
  border-left: 4px solid transparent;
}

.parts-ro-card.is-selected {
  box-shadow: 0 0 0 2px rgba(31, 115, 232, 0.22);
}

.parts-ro-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.parts-ro-open {
  font-weight: 700;
}

.parts-status-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.parts-status-pill.is-red {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.parts-status-pill.is-yellow {
  color: #92400e;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.3);
}

.parts-status-pill.is-green {
  color: #166534;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
}

.parts-dashboard-column,
.parts-vin-lookup {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.parts-search-row,
.parts-vin-input-row,
.parts-compose-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.parts-repair-search {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parts-search-row input,
.parts-vin-input-row input,
.parts-repair-search input,
.parts-message-input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  padding: 10px 12px;
  font: inherit;
}

.parts-message-input {
  min-height: 82px;
  resize: vertical;
}

.parts-search-row .primary-button,
.parts-vin-input-row .primary-button,
.parts-compose-row .primary-button {
  min-height: 48px;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.parts-search-row input,
.parts-vin-input-row input {
  min-height: 48px;
}

.parts-compose-row {
  align-items: stretch;
}

.parts-scroll-list,
.parts-message-thread {
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.parts-empty-state {
  color: #64748b;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  padding: 10px;
}

.parts-wo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: flex;
  justify-content: flex-end;
}

.parts-wo-overlay.is-hidden {
  display: none;
}

.parts-wo-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}

.parts-wo-overlay-panel {
  position: relative;
  width: min(760px, 96vw);
  height: 100%;
  overflow: auto;
  background: #f8fafc;
  border-left: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: -14px 0 28px rgba(15, 23, 42, 0.18);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.line-item-header {
  width: 100%;
  text-align: left;
  font-weight: 700;
}

.line-item-parts {
  display: none;
  margin-top: 8px;
}

.line-item-parts.open {
  display: block;
}

.parts-table {
  width: 100%;
  border-collapse: collapse;
}

.parts-table th,
.parts-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.parts-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.alert-item.unread {
  border-left: 3px solid #1f73e8;
}

.message-sender {
  font-weight: 700;
}

.message-role,
.message-time,
.alert-timestamp {
  color: #64748b;
  font-size: 12px;
}

.parts-vin-result,
.parts-repair-results,
.parts-lookup-result {
  margin-top: 10px;
}

@media (max-width: 1180px) {
  .parts-dashboard-grid,
  .parts-dashboard-grid--two {
    grid-template-columns: 1fr;
  }
}

/* Parts Dashboard 2-Column Layout */
.parts-dashboard-shell {
  display: grid;
  grid-template-columns: 30% 70%;
  gap: 12px;
  height: 100%;
  min-height: calc(100vh - 200px);
}

.parts-live-queue {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.parts-pulled-ros {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.parts-queue-header,
.parts-pulled-header {
  padding: 16px;
  border-bottom: 1px solid var(--stroke);
  flex-shrink: 0;
}

.parts-queue-list,
.parts-pulled-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.parts-queue-row,
.parts-pulled-row {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: background 150ms ease;
}

.parts-queue-row:hover,
.parts-pulled-row:hover {
  background: var(--accent-soft);
}

.parts-queue-row-active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.parts-queue-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Slide Drawer Modal */
.parts-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 999;
}

.parts-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.parts-drawer-container {
  position: fixed;
  right: 0;
  top: 14px;
  width: min(48vw, 720px);
  height: calc(100vh - 28px);
  max-height: 860px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-radius: 16px 0 0 16px;
}

.parts-drawer-container.is-open {
  transform: translateX(0);
}

.parts-drawer-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--stroke);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.parts-drawer-header-info h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.parts-drawer-header-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.parts-drawer-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(47, 54, 64, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: #4f617a;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 150ms ease;
}

.parts-drawer-close:hover {
  color: var(--ink);
  border-color: rgba(23, 104, 229, 0.35);
  background: rgba(236, 244, 255, 0.95);
}

.parts-drawer-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.parts-drawer-body {
  flex: 1;
  padding: 14px 18px;
  overflow-y: auto;
}

.parts-drawer-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--stroke);
  flex-shrink: 0;
  display: flex;
  gap: 10px;
}

.parts-drawer-footer button {
  flex: 1;
  min-height: 42px;
  max-height: 42px;
  padding: 0 14px;
  font-size: 0.98rem;
}

.parts-drawer-close-soft {
  flex: 1;
  min-height: 42px;
  max-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(47, 54, 64, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 253, 0.96));
  color: #2a3548;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.parts-drawer-close-soft:hover,
.parts-drawer-close-soft:focus-visible {
  border-color: rgba(23, 104, 229, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(236, 244, 255, 0.98));
  color: #1b3359;
}

/* New Line Item Highlight */
.is-new-line-item {
  background-color: var(--warm-soft);
  animation: highlight-pulse 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes highlight-pulse {
  0% {
    background-color: var(--warm);
  }
  100% {
    background-color: var(--warm-soft);
  }
}

.parts-line-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 8px;
}

.parts-line-item-header {
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.parts-line-item-parts {
  font-size: 13px;
  color: var(--muted);
}

.parts-line-item-parts table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
}

.parts-line-item-parts th,
.parts-line-item-parts td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.parts-line-item-parts th {
  background: var(--bg);
  font-weight: 600;
  color: var(--ink);
}

.parts-line-item-parts tr:last-child td {
  border-bottom: none;
}

/* Task 7: Parts Table Layout & Highlights */

.parts-line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.parts-line-items-table thead {
  background-color: #f3f4f6;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
}

.parts-line-items-table th {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
}

.parts-line-item-row {
  background-color: #fafafa;
  border-bottom: 1px solid #e5e7eb;
}

.parts-line-item-row.is-new-line-item {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.parts-line-item-cell {
  padding: 12px 8px;
}

.parts-line-item-header {
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.parts-line-item-desc {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.parts-line-item-status {
  font-size: 12px;
  color: #059669;
  text-transform: capitalize;
}

.parts-details-row {
  border-bottom: 1px solid #e5e7eb;
}

.parts-details-row.is-new-line-item {
  background-color: #fef3c7;
}

.parts-details-row td {
  padding: 10px 8px;
  font-size: 13px;
  color: #374151;
}

.parts-number {
  font-family: monospace;
  font-size: 12px;
  color: #1f2937;
}

.parts-description {
  max-width: 300px;
  word-wrap: break-word;
}

.parts-quantity {
  text-align: center;
  width: 80px;
}

.parts-price {
  text-align: right;
  width: 100px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.parts-badge-cell {
  text-align: center;
  width: 60px;
}

.parts-new-badge {
  background-color: #dc2626;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.parts-details-empty {
  text-align: center;
  color: #9ca3af;
  font-style: italic;
}

.parts-error-state {
  background-color: #fef2f2;
  border-left: 4px solid #dc2626;
}

.parts-error-message {
  color: #7c2d12;
  font-style: italic;
  padding: 8px;
}

.parts-queue-badge {
  background-color: #dc2626;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

@keyframes fadeHighlight {
  0% { background-color: #fef3c7; }
  100% { background-color: transparent; }
}

.parts-line-item-row.fade-out,
.parts-details-row.fade-out {
  animation: fadeHighlight 2s ease-out forwards;
}

/* OEM + MOC Stacked Rows Styling */

.parts-oem-row {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e4e8;
}

.parts-moc-row {
  background-color: #f0f4f8;
  border-bottom: 2px solid #e0e4e8;
  font-size: 0.95em;
  color: #5a6b80;
}

.parts-moc-row td:first-child {
  padding-left: 2em !important;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-oem {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-moc {
  background-color: #e0e7ff;
  color: #3730a3;
  border: 1px solid #a5b4fc;
}

/* BDC Scheduler Tab Styles */
.bdc-scheduler-container,
.bdc-dashboard-container,
.bdc-messages-container,
.bdc-campaigns-container {
  padding: 1rem;
}

.scheduler-header,
.dashboard-header,
.messages-header,
.campaigns-header {
  margin-bottom: 1.5rem;
}

.scheduler-header h2,
.dashboard-header h2,
.messages-header h2,
.campaigns-header h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  color: #111827;
}

.scheduler-header p,
.dashboard-header p,
.messages-header p,
.campaigns-header p {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.bdc-messages-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  min-height: 520px;
}

@media (max-width: 900px) {
  .perf-incentives-grid {
    grid-template-columns: 1fr;
  }

  .perf-incentive-row {
    grid-template-columns: 1fr;
  }

  .estimate-board-header {
    display: none;
  }

  .estimate-shell-layout {
    grid-template-columns: 1fr;
  }

  .estimate-line-actions {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .estimate-grid-tech,
  .estimate-grid-parts,
  .estimate-grid-pricing-single {
    grid-template-columns: 1fr;
  }

  .estimate-line-meta {
    grid-template-columns: 1fr;
  }
}

.bdc-msg-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 12px;
  min-height: 640px;
}

.bdc-msg-rail,
.bdc-msg-main {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #fff;
}

.bdc-msg-rail {
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.bdc-msg-rail-head {
  padding: 12px;
  border-bottom: 1px solid #e5edf7;
}

.bdc-msg-compose {
  padding: 12px;
  border-bottom: 1px solid #e5edf7;
}

.bdc-msg-compose label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #64748b;
}

.bdc-msg-compose-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.bdc-msg-compose-row input {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
}

.bdc-msg-rail-list {
  padding: 8px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.bdc-msg-item {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 6px 8px;
  min-height: 78px;
}

.bdc-msg-item.is-active {
  border-color: #1f73e8;
  box-shadow: 0 0 0 1px rgba(31, 115, 232, 0.2);
}

.bdc-msg-item-select {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.bdc-msg-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bdc-msg-item-top small,
.bdc-msg-item-select small,
.bdc-msg-item-select p {
  color: #64748b;
  margin: 1px 0 0;
  font-size: 11px;
}

.bdc-msg-item-select strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.bdc-msg-item-select p {
  margin-top: 2px;
  line-height: 1.2;
}

.bdc-msg-item-actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.bdc-msg-pane {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.bdc-msg-pane-head {
  padding: 12px;
  border-bottom: 1px solid #e5edf7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bdc-msg-pane-head small {
  display: block;
  color: #64748b;
  margin-top: 2px;
}

.bdc-msg-pane-actions {
  display: flex;
  gap: 8px;
}

.bdc-msg-thread {
  padding: 12px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  background: #f8fafc;
}

.bdc-msg-bubble {
  max-width: min(80%, 640px);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dbe4ef;
  background: #fff;
}

.bdc-msg-bubble.is-outgoing {
  margin-left: auto;
  background: #2f76e4;
  color: #fff;
  border-color: #2f76e4;
}

.bdc-msg-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.bdc-msg-bubble small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.85;
}

.bdc-msg-composer {
  border-top: 1px solid #e5edf7;
  padding: 12px;
  background: #fff;
}

.bdc-msg-composer-row {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 980px) {
  .bdc-msg-shell {
    grid-template-columns: 1fr;
  }
}

.bdc-thread-list {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px;
  overflow-y: auto;
}

.bdc-thread-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  margin-bottom: 8px;
  text-align: left;
  cursor: pointer;
}

.bdc-thread-item.is-active {
  border-color: #1f73e8;
  box-shadow: 0 0 0 1px rgba(31, 115, 232, 0.15);
}

.bdc-thread-item p {
  margin: 6px 0;
  color: #475569;
  font-size: 13px;
}

.bdc-thread-item small {
  color: #64748b;
  font-size: 12px;
}

.bdc-thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bdc-conversation-shell {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.bdc-conversation {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bdc-message-bubble {
  max-width: min(80%, 680px);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dbe4ef;
  background: #f8fbff;
}

.bdc-message-bubble.outgoing {
  margin-left: auto;
  background: #eaf3ff;
  border-color: #c8dcff;
}

.bdc-message-bubble.incoming {
  margin-right: auto;
  background: #f8fafc;
}

.bdc-message-bubble p {
  margin: 0 0 6px 0;
  color: #0f172a;
  white-space: pre-wrap;
}

.bdc-message-bubble small {
  color: #64748b;
  font-size: 12px;
}

.bdc-composer {
  border-top: 1px solid #dbe4ef;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
}

.bdc-composer-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#bdc-customer-select,
#bdc-message-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
}

#bdc-message-input {
  resize: vertical;
  min-height: 68px;
}

@media (max-width: 980px) {
  .bdc-messages-shell {
    grid-template-columns: 1fr;
  }
}

.scheduler-search,
.dashboard-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input,
.filter-group input,
.filter-group select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.filter-group label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-results,
.dashboard-results {
  margin-top: 1.5rem;
}

.customer-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 1rem;
  background: #f9f9f9;
}

.result-info {
  flex: 1;
  line-height: 1.5;
}

.appointment-form-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1.5rem;
  background: #f9f9f9;
  max-width: 100%;
  width: 100%;
}

.appointment-form-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.customer-vehicle-info,
.declined-items-section,
.services-due-section {
  padding: 1rem;
  background: white;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
}

.customer-vehicle-info p,
.declined-items-section p,
.services-due-section p {
  margin: 0.5rem 0;
}

.appointment-details {
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.appointment-details label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.appointment-details input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.bdc-ro-history-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.bdc-ro-history-item {
  margin-bottom: 0.75rem;
}

.bdc-ro-history-details {
  display: block;
}

.bdc-ro-history-line {
  display: block;
  margin-top: 0.2rem;
}

.bdc-ro-history-completed {
  color: #15803d;
  font-weight: 600;
}

.bdc-ro-history-declined {
  color: #b91c1c;
  font-weight: 600;
}

.bdc-ro-history-cp-total {
  color: #000;
  font-weight: 600;
}

.bdc-ro-history-cp-spend {
  color: #1e3a8a;
  font-weight: 600;
}

.service-selection {
  margin: 1rem 0;
}

.service-selection h4 {
  margin: 0 0 0.75rem 0;
}

#service-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
}

.service-option input {
  cursor: pointer;
}

.appointment-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
}

.no-results {
  color: #6b7280;
  padding: 1rem;
  text-align: center;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.dashboard-table thead {
  background: #f3f4f6;
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.dashboard-table th {
  font-weight: 600;
  color: #374151;
}

.dashboard-table tr:hover {
  background: #f9fafb;
}

.vehicle-checkbox {
  cursor: pointer;
}

.results-count {
  color: #6b7280;
  margin-bottom: 1rem;
}

.bulk-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 4px;
}

.urgency-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.urgency-badge.high {
  background: #fee2e2;
  color: #991b1b;
}

.urgency-badge.normal {
  background: #fef3c7;
  color: #92400e;
}

.badge {
  display: inline-block;
  background: #ef4444;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.badge.hidden {
  display: none;
}

/* Tab Navigation for BDC */
.messages-tabs,
.campaigns-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-weight: 500;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #111827;
}

.tab-btn.active {
  border-bottom-color: #007bff;
  color: #007bff;
}

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

.send-form,
.campaign-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.send-form label,
.campaign-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.send-form input,
.send-form select,
.send-form textarea,
.campaign-form input,
.campaign-form select,
.campaign-form textarea {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.send-form textarea,
.campaign-form textarea {
  resize: vertical;
  min-height: 100px;
}

.message-preview {
  padding: 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  margin: 1rem 0;
}

.message-preview.hidden {
  display: none;
}

.send-options {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0;
}

.send-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row;
}

.campaign-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #f9f9f9;
}

.campaign-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.campaign-card p {
  margin: 0.5rem 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.campaign-preview {
  padding: 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  margin: 1rem 0;
}

.campaign-preview.hidden {
  display: none;
}

/* ========================
   TASK 10: Invoice & SMS Styles
   ======================== */

/* Invoice Tab Styles */
.parts-invoice-container {
  padding: 20px;
  background: linear-gradient(180deg, #f7f9fc 0%, #f1f4f9 100%);
  border: 1px solid #d8e1ef;
  border-radius: 14px;
}

.parts-invoice-header,
.invoice-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invoice-header h2 {
  margin: 2px 0 0;
  font-size: 28px;
  color: #16263d;
}

.parts-invoice-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.parts-invoice-editor,
.invoice-editor {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #d8e1ef;
  box-shadow: 0 10px 24px rgba(18, 36, 66, 0.07);
}

.invoice-form-section {
  background: #f9fbff;
  border: 1px solid #e1e8f4;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.invoice-form-section h3 {
  margin: 0 0 12px;
  color: #1c2f4f;
}

.invoice-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-group-span-2 {
  grid-column: 1 / -1;
}

.invoice-editor .form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f6486;
  font-weight: 700;
}

.invoice-editor .form-group input {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #ccd8ea;
  background: #fff;
  padding: 9px 12px;
  font-size: 15px;
}

.invoice-editor .form-group input:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.15);
}

.invoice-info-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.invoice-info-row label {
  font-weight: 600;
  min-width: 180px;
  color: var(--ink);
}

.invoice-info-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

.invoice-info-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 104, 229, 0.1);
}

.invoice-line-items {
  margin: 24px 0;
}

.invoice-line-items h3 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 16px;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-soft);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  overflow: hidden;
}

.invoice-table th,
.invoice-table td {
  padding: 12px;
  border-bottom: 1px solid var(--stroke);
  text-align: left;
}

.invoice-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--ink);
}

.invoice-table td {
  color: var(--ink);
}

.invoice-line-input {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--stroke);
  border-radius: 3px;
  font-family: inherit;
  font-size: 14px;
}

.invoice-line-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 104, 229, 0.1);
}

.invoice-delete-line {
  padding: 4px 12px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.invoice-delete-line:hover {
  background: var(--danger);
  color: white;
}

.invoice-lines-shell {
  border: 1px solid #ccd8ea;
  border-radius: 10px;
  background: #f9fbff;
  padding: 10px;
}

.invoice-lines-header {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr) 140px 52px;
  gap: 10px;
  padding: 0 2px 8px;
  color: #51698d;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invoice-lines-list {
  display: grid;
  gap: 8px;
}

.invoice-line-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr) 140px 52px;
  gap: 10px;
  align-items: center;
}

.invoice-line-field {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid #c7d5e8;
  background: #fff;
  padding: 0 12px;
  font-size: 0.95rem;
}

.invoice-line-field:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.15);
}

.invoice-line-row .col-amount {
  text-align: right;
}

.invoice-line-row .invoice-delete-line {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  font-size: 1rem;
  font-weight: 700;
  padding: 0;
}

.invoice-lines-actions {
  margin-top: 10px;
}

.invoice-customer-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.invoice-customer-search-row input {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #ccd8ea;
  background: #fff;
  padding: 9px 12px;
  font-size: 15px;
}

.invoice-customer-search-results {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.invoice-customer-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 104, 229, 0.14);
  border-radius: 10px;
  background: rgba(247, 251, 255, 0.95);
}

.invoice-customer-result small {
  display: block;
  color: #64748b;
  margin-top: 2px;
}

.invoice-totals {
  margin: 24px 0;
  padding: 16px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--stroke);
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke);
  color: var(--ink);
}

.invoice-total-row:last-child {
  border-bottom: none;
}

.invoice-total-main {
  border-top: 2px solid var(--stroke);
  font-size: 18px;
  font-weight: 600;
  margin-top: 8px;
  padding-top: 12px;
  color: var(--ink);
}

.invoice-actions,
.invoice-affirm,
.invoice-sms {
  margin: 20px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.invoice-actions button,
.invoice-affirm button,
.invoice-sms button {
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.invoice-actions button:hover,
.invoice-affirm button:hover,
.invoice-sms button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .invoice-fields-grid {
    grid-template-columns: 1fr;
  }

  .form-group-span-2 {
    grid-column: auto;
  }
}

/* SMS Tab Styles */
.parts-sms-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 12px;
  background: linear-gradient(180deg, #f7f9fc 0%, #f1f4f9 100%);
  border: 1px solid #d8e1ef;
  border-radius: 14px;
}

.parts-sms-content,
.sms-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.sms-thread-list {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid #d8e1ef;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(18, 36, 66, 0.06);
}

.sms-thread-search,
.thread-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.thread-compose-row {
  margin-bottom: 12px;
}

.thread-compose-row .btn {
  width: 100%;
  min-height: 40px;
}

.sms-phone-input,
.thread-search-input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #ccd8ea;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

#sms-search-btn {
  white-space: nowrap;
  min-width: 92px;
}

.sms-phone-input:focus,
.thread-search-input:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.15);
}

.sms-threads {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.sms-thread-item {
  display: block;
  width: 100%;
  padding: 12px 12px 10px;
  margin-bottom: 8px;
  background: #f9fbff;
  border: 1px solid #dae4f2;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1f2f4a;
  font-size: 14px;
}

.sms-thread-item:hover {
  background: #eef4ff;
  border-color: #2d6cdf;
}

.sms-thread-item.is-active {
  background: linear-gradient(180deg, #2d6cdf 0%, #1e57bc 100%);
  color: white;
  border-color: #1e57bc;
  box-shadow: 0 6px 16px rgba(28, 84, 181, 0.28);
}

.sms-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 13px;
}

.sms-unread-badge {
  background: #d92f2f;
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(217, 47, 47, 0.32);
}

.sms-thread-preview {
  margin: 4px 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sms-thread-item.is-active .sms-thread-preview {
  color: rgba(255, 255, 255, 0.8);
}

.sms-conversation {
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d8e1ef;
  box-shadow: 0 8px 20px rgba(18, 36, 66, 0.06);
  min-height: 360px;
}

.sms-conversation-header {
  padding: 16px;
  border-bottom: 1px solid var(--stroke);
  background: var(--bg);
  font-weight: 600;
  color: var(--ink);
}

.sms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sms-header h2 {
  margin: 2px 0 0;
  color: #16263d;
}

.thread-items-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: 560px;
  padding-right: 4px;
}

.thread-items-container .empty-state {
  border: 1px dashed #cfdbef;
  border-radius: 12px;
  padding: 24px 14px;
  text-align: center;
  color: #5a6f90;
  background: #f8fbff;
}

.conversation-empty-state {
  margin: auto;
  color: #5a6f90;
  border: 1px dashed #cfdbef;
  border-radius: 14px;
  padding: 20px 24px;
  background: #f8fbff;
  max-width: 460px;
  text-align: center;
}

@media (max-width: 900px) {
  .sms-layout {
    grid-template-columns: 1fr;
  }
}

.sms-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.sms-message {
  display: flex;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sms-message.incoming {
  justify-content: flex-start;
}

.sms-message.outgoing {
  justify-content: flex-end;
}

.sms-message-bubble {
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 8px;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}

.sms-message.incoming .sms-message-bubble {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--stroke);
}

.sms-message.outgoing .sms-message-bubble {
  background: var(--accent);
  color: white;
}

.sms-compose {
  padding: 16px;
  border-top: 1px solid var(--stroke);
  display: flex;
  gap: 8px;
  background: var(--bg-soft);
}

.sms-message-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  max-height: 100px;
}

.sms-message-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 104, 229, 0.1);
}

.sms-compose button {
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sms-compose button:hover {
  background: #0f5ed7;
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

/* SMS UI v2 - matches current parts-sms-tab.js class names */
.sms-header .eyebrow {
  color: #4e6486;
  letter-spacing: 0.14em;
}

.conversation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #dfe7f3;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.conversation-ident {
  min-width: 0;
}

.conversation-header h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #1a2d49;
}

.conversation-phone {
  margin: 8px 0 0;
  color: #5a7296;
  font-size: 15px;
}

.sms-close-thread-btn {
  min-width: 88px;
  border-radius: 10px;
}

.conversation-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sms-delete-thread-btn {
  min-width: 88px;
  border-radius: 10px;
  border-color: #d34a4a;
  color: #b62222;
}

.sms-messages-area {
  flex: 1;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(38, 115, 229, 0.06) 0%, rgba(38, 115, 229, 0) 35%),
    #ffffff;
}

.no-messages {
  margin: 18px auto;
  max-width: 320px;
  text-align: center;
  border: 1px dashed #c9d8ef;
  border-radius: 12px;
  padding: 14px;
  color: #5b7397;
  background: #f8fbff;
}

.sms-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.sms-message.incoming {
  align-items: flex-start;
}

.sms-message.outgoing {
  align-items: flex-end;
}

.message-bubble {
  max-width: min(78%, 580px);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(23, 48, 84, 0.08);
}

.sms-message.incoming .message-bubble {
  background: #f5f8ff;
  border: 1px solid #d9e3f4;
  color: #1f3250;
}

.sms-message.outgoing .message-bubble {
  background: linear-gradient(180deg, #2c72e3 0%, #1f5cc4 100%);
  color: #fff;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-timestamp {
  margin-top: 6px;
  font-size: 12px;
  color: #607896;
}

.sms-composer {
  border-top: 1px solid #dfe7f3;
  background: #f7faff;
  padding: 12px 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.message-input {
  min-height: 82px;
  border: 1px solid #c8d7ee;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.4;
  resize: vertical;
  background: #fff;
}

.message-input:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.14);
}

#sms-send-btn {
  min-width: 108px;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 700;
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.thread-header strong {
  font-size: 22px;
  line-height: 1.1;
}

.thread-preview {
  margin: 6px 0 3px;
  font-size: 14px;
  color: #5a7397;
}

.sms-thread-item.is-active .thread-preview,
.sms-thread-item.is-active .thread-time {
  color: rgba(255, 255, 255, 0.92);
}

.thread-time {
  font-size: 12px;
  color: #5b7396;
}

.tab-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #d92f2f;
  vertical-align: middle;
}

.unread-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d92f2f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}

@media (max-width: 900px) {
  .sms-composer {
    grid-template-columns: 1fr;
  }

  #sms-send-btn {
    width: 100%;
  }

  .conversation-header h3 {
    font-size: 22px;
  }
}

/* Balance Summary Styles (Task 13) */
.balance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--stroke);
}

.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-stat .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-stat .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.summary-stat .value.success {
  color: var(--success);
}

.summary-stat .value.warning {
  color: var(--warm);
}

.bdc-flow-card {
  max-width: 100%;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.bdc-flow-steps {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.75rem;
}

.bdc-step-pane.hidden {
  display: none;
}

.bdc-step-pane {
  display: grid;
  gap: 10px;
}

.bdc-flow-card .customer-vehicle-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

.bdc-flow-card .customer-vehicle-info p {
  margin: 0;
}

.bdc-prediction-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}

.bdc-prediction-toolbar label {
  margin: 0;
}

.bdc-prediction-toolbar .btn {
  min-height: 40px;
}

.bdc-flow-card .declined-items-section,
.bdc-flow-card .services-due-section {
  padding: 0.85rem;
  border-radius: 10px;
}

.bdc-ro-history-list {
  max-height: 190px;
  overflow: auto;
  padding-right: 6px;
}

.bdc-ro-history-item {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.bdc-ro-history-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.bdc-recommendation-grid {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.bdc-bundle-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.bdc-flow-card .recommendation-card,
.bdc-flow-card .bundle-card {
  padding: 14px 16px;
  border-radius: 16px;
}

.bdc-flow-card .recommendation-card p,
.bdc-flow-card .bundle-card p {
  margin: 6px 0;
  line-height: 1.45;
  color: #4a5f7e;
}

.bdc-flow-card .recommendation-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bdc-flow-card .recommendation-metrics,
.bdc-flow-card .bundle-metrics {
  margin: 8px 0 6px;
}

.bdc-flow-card .panel-actions {
  margin-top: 6px;
}

.bdc-flow-card .panel-actions .text-button,
.bdc-flow-card .panel-actions .primary-button {
  min-height: 36px;
  padding: 8px 14px;
}

.bdc-reco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.bdc-reco-card {
  border: 1px solid #d7e2f3;
  border-radius: 10px;
  padding: 12px;
  background: #f8fbff;
}

.bdc-reco-card h5 {
  margin: 0 0 6px 0;
}

.bdc-reco-card p {
  margin: 6px 0;
}

.bdc-calendar-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, minmax(110px, 1fr));
  gap: 6px;
  overflow-x: auto;
}

.bdc-calendar-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  align-items: start;
}

.bdc-calendar-categories {
  border: 1px solid #d9e2f0;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.bdc-category-tab {
  border: 1px solid #c8d8ef;
  background: #ffffff;
  border-radius: 10px;
  color: #2b4668;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  cursor: pointer;
  position: relative;
}

.bdc-category-tab strong {
  color: #1f4e99;
}

.bdc-category-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.bdc-category-paint-icon {
  margin-left: auto;
  font-size: 13px;
  line-height: 1;
  opacity: 0.9;
}

.bdc-category-tab.is-active {
  border-color: #1f6feb;
  background: #eaf2ff;
  box-shadow: 0 0 0 1px rgba(31, 111, 235, 0.15) inset;
}

.bdc-calendar-header-time,
.bdc-calendar-header-cell,
.bdc-calendar-time {
  font-size: 12px;
  color: #516987;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.bdc-calendar-header-cell {
  flex-direction: column;
  gap: 2px;
}

.bdc-calendar-header-cell small {
  font-size: 11px;
  color: #6b7f99;
}

.bdc-slot-btn {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid #c9d8f3;
  background: #eef4ff;
  color: #2459a6;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 14px;
}

.bdc-slot-btn small {
  font-size: 10px;
  color: inherit;
  opacity: 0.9;
}

.bdc-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.bdc-slot-badge-waiter {
  background: #dc2626;
}

.bdc-slot-badge-dropoff {
  background: #16a34a;
}

.bdc-step2-selector-card label {
  margin-top: 8px;
}

.bdc-slot-btn.is-unavailable {
  background: #eef2f7;
  color: #9aa8be;
  border-color: #d8e0ec;
  cursor: pointer;
}

.bdc-slot-btn.is-capacity-blocked:not(.is-selected) {
  background: #fff4f4;
  border-color: #ef9a9a;
  color: #9f1239;
}

.bdc-slot-btn.is-selected {
  background: linear-gradient(135deg, #2b7fff, #1f5fd6);
  border-color: transparent;
  color: #ffffff;
}

.bdc-slot-btn.is-suggested:not(.is-selected) {
  background: #e9fbe9;
  border-color: #88c98c;
  color: #165b1c;
  font-weight: 600;
}

.bdc-confirmation-grid {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.bdc-confirmation-row {
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto;
  gap: 8px;
  align-items: center;
}

.bdc-confirmation-row input {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.95rem;
}

.bdc-confirmation-row .customer-contact-sync-button {
  min-height: 36px;
  padding: 7px 14px;
  min-width: 120px;
  width: 140px;
}

.bdc-reminder-button-wide {
  width: 280px;
  min-height: 40px;
  padding: 9px 14px;
  margin-top: 2px;
  justify-self: start;
}

.mpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.mpi-status-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1f2937;
}

.mpi-status-btn.is-active {
  color: #fff;
  border-color: transparent;
}

.mpi-green.is-active {
  background: #16a34a;
}

.mpi-yellow.is-active {
  background: #ca8a04;
}

.mpi-red.is-active {
  background: #dc2626;
}

.mpi-na.is-active {
  background: #6b7280;
}

/* Responsive Design */
@media (max-width: 980px) {
  .bdc-calendar-layout {
    grid-template-columns: 1fr;
  }

  .bdc-calendar-categories {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}
@media (max-width: 768px) {
  .parts-sms-content {
    grid-template-columns: 1fr;
  }

  .sms-message-bubble {
    max-width: 90%;
  }

  .invoice-info-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .invoice-info-row label {
    min-width: auto;
  }

  .parts-invoice-editor,
  .sms-conversation,
  .sms-thread-list {
    border-radius: 4px;
  }

  .balance-summary {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── SMS Tabs ──────────────────────────────────────── */

.sms-container {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.sms-conversation-card {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: rgba(248, 251, 255, 0.93);
  box-shadow: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sms-conversation-card:hover {
  background: rgba(248, 251, 255, 0.98);
  border-color: rgba(47, 54, 64, 0.12);
}

.sms-conversation-card.is-active {
  border-color: rgba(23, 104, 229, 0.3);
  background: rgba(248, 251, 255, 0.98);
}

.sms-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.sms-card-customer-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.sms-card-timestamp {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.sms-card-preview {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-card-actions {
  display: none;
  gap: 8px;
  align-items: center;
  position: absolute;
  top: 12px;
  right: 12px;
}

.sms-conversation-card:hover .sms-card-actions {
  display: flex;
}

.sms-card-action-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.sms-card-action-btn:hover {
  color: var(--danger);
}

.sms-thread-view {
  display: none;
  grid-template-rows: 1fr auto;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.93);
  max-height: 60vh;
  overflow: hidden;
}

.sms-thread-view.is-active {
  display: grid;
}

.sms-messages-container {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding-right: 8px;
}

.sms-message {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(47, 54, 64, 0.08);
  background: rgba(248, 251, 255, 0.93);
  width: fit-content;
  max-width: 70%;
}

.sms-message.is-outgoing {
  justify-self: end;
  border-color: rgba(23, 104, 229, 0.18);
  background: rgba(231, 242, 255, 0.88);
}

.sms-message-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.sms-message-timestamp {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-align: right;
}

.sms-compose-area {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(47, 54, 64, 0.08);
  padding-top: 16px;
}

.sms-compose-wrapper {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: flex-end;
}

.sms-input {
  padding: 10px 14px;
  border: 1px solid rgba(47, 54, 64, 0.18);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  max-height: 80px;
  background: white;
}

.sms-input:focus {
  outline: none;
  border-color: rgba(23, 104, 229, 0.4);
  box-shadow: 0 0 0 2px rgba(23, 104, 229, 0.1);
}

.sms-char-counter {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: right;
}

.sms-char-counter.is-warning {
  color: var(--warning);
}

.sms-char-counter.is-error {
  color: var(--danger);
}

.sms-send-btn {
  padding: 10px 16px;
  background: linear-gradient(145deg, #1e7af0, #1456c7);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.sms-send-btn:hover:not(:disabled) {
  box-shadow: 0 2px 6px rgba(23, 104, 229, 0.3);
  transform: translateY(-1px);
}

.sms-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sms-empty-state {
  display: grid;
  place-items: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  text-align: center;
  font-size: 0.95rem;
}

.sms-hidden-label {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(47, 54, 64, 0.08);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.sms-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #d92f2f;
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(217, 47, 47, 0.32);
}

.sms-card-header.has-unread {
  color: var(--accent-blue);
  font-weight: 700;
}

.run-prediction-button {
  background: #0b63e5;
  border-color: #0b63e5;
  color: #fff;
}

.run-prediction-button:hover {
  background: #0853bf;
  border-color: #0853bf;
}

button[data-action="run-advisor-prediction"] {
  background: #0b63e5;
  border-color: #0b63e5;
  color: #fff;
}

button[data-action="run-advisor-prediction"]:hover {
  background: #0853bf;
  border-color: #0853bf;
}
.bdc-add-customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bdc-add-customer-grid input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.bdc-warranty-assessment-card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #f8fbff;
}

.bdc-warranty-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.bdc-warranty-status {
  margin: 0 0 8px;
  color: #ef4444;
}

.bdc-warranty-meta {
  margin: 0;
  color: #334155;
}
