/* ==========================================================================
   MPAATANEL — Component Library
   ========================================================================== */

/* ---- Loading state ---- */
.sales-trend-card { min-width: 0; }
.sales-trend-chart { height: 270px; min-height: 270px; position: relative; }
.sales-trend-chart canvas { display: block; width: 100% !important; height: 270px !important; }
.sales-trend-empty { height: 100%; padding: var(--space-8); }
.chart-period-switcher { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); background: var(--bg-canvas); }
.chart-period-switcher button { border: 0; border-radius: var(--radius-pill); padding: 6px 9px; background: transparent; color: var(--text-muted); cursor: pointer; font: 700 11px var(--font-body); }
.chart-period-switcher button.active { background: var(--navy-900); color: #fff; }
.executive-dashboard__vehicle-art { width: min(360px, 38vw); height: 150px; flex: 0 0 auto; overflow: visible; background: transparent; }
.executive-dashboard__vehicle-art img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* ---- Loading state ---- */
.catalog-popover {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}
.vehicle-popover { width: min(780px, calc(100vw - 32px)); }
.catalog-popover::backdrop { background: rgba(2, 14, 32, 0.62); backdrop-filter: blur(4px); }
.catalog-popover__header { display: flex; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.catalog-popover__header h2 { margin-top: var(--space-2); }
.catalog-popover__header p { margin-bottom: 0; }
.catalog-popover__actions { display: flex; justify-content: flex-end; gap: var(--space-3); padding-top: var(--space-2); }

/* ---- Loading state ---- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 14, 32, 0.86);
  backdrop-filter: blur(7px);
  opacity: 1;
  transition: opacity 180ms ease;
}
.loading-screen[hidden] { display: none; }
.loading-screen.is-leaving { opacity: 0; }
.loading-screen__panel { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); min-width: 190px; }
.loading-screen__logo {
  width: 118px;
  height: 70px;
  padding: 8px 13px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 14px 38px rgba(0,0,0,0.26);
}
.loading-screen__logo img { width: 100%; height: 100%; object-fit: contain; }
.loading-screen__spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--gold-400);
  border-right-color: var(--gold-400);
  border-radius: 50%;
  animation: loading-spin 760ms linear infinite;
}
.loading-screen__label { margin: 0; color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
@keyframes loading-spin { to { transform: rotate(360deg); } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--navy-900); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-800); box-shadow: var(--shadow-md); color: #fff; }

.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--navy-950); box-shadow: var(--shadow-gold-glow); }
.btn-gold:hover { color: var(--navy-950); box-shadow: 0 8px 28px rgba(212, 169, 74, 0.38); }

.btn-outline { background: var(--bg-card); border-color: var(--border-strong); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--navy-700); color: var(--navy-900); }

.btn-success { background: var(--success-500); color: #fff; }
.btn-success:hover { background: var(--success-600); color: #fff; }

.btn-danger { background: var(--bg-card); border-color: var(--danger-500); color: var(--danger-500); }
.btn-danger:hover { background: var(--danger-500); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-canvas-alt); transform: none; }

.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover.card-hoverable { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.vehicle-card__preview {
  width: 116px;
  height: 78px;
  float: right;
  margin: 0 0 var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-canvas-alt), #dce9f8);
  overflow: hidden;
}
.vehicle-card__photo-button { width: 100%; height: 100%; display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.vehicle-card__preview img { width: 100%; height: 100%; display: block; object-fit: cover; transition: filter var(--transition-fast), transform var(--transition-fast); }
.vehicle-card__photo-button:hover img { filter: brightness(1.06); transform: scale(1.02); }
.vehicle-card__preview-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); color: var(--text-muted); font-size: 12px; }
.vehicle-card__preview-empty svg { width: 42px; height: 42px; opacity: 0.55; }
.vehicle-card__preview-empty svg { width: 28px; height: 28px; }
.vehicle-card__preview-empty span { font-size: 10px; }
.vehicle-card__pricing { clear: both; }
.vehicle-photo-viewer { width: min(900px, calc(100vw - 32px)); max-width: none; padding: 42px 16px 16px; border: 0; border-radius: var(--radius-lg); background: rgba(2, 14, 32, 0.96); box-shadow: var(--shadow-lg); }
.vehicle-photo-viewer::backdrop { background: rgba(2, 14, 32, 0.78); backdrop-filter: blur(4px); }
.vehicle-photo-viewer img { display: block; max-width: 100%; max-height: calc(100dvh - 100px); margin: 0 auto; object-fit: contain; }
.vehicle-photo-viewer__close { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.14); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }

.card-flush { padding: 0; overflow: hidden; }

.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}
.card-header h3 { margin: 0 0 4px; }
.card-header p { margin: 0; font-size: 13px; }

.role-strip { border-left: 4px solid transparent; padding-left: calc(var(--space-6) - 4px); }
.role-strip--sales { border-left-color: var(--role-sales); }
.role-strip--finance { border-left-color: var(--role-finance); }
.role-strip--logistics { border-left-color: var(--role-logistics); }
.role-strip--admin { border-left-color: var(--role-admin); }
.role-strip--gold { border-left-color: var(--gold-500); }

/* ---- Stat Card ---- */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}
.stat-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-4);
}
.stat-card__icon svg { width: 22px; height: 22px; }
.stat-card__label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.stat-card__value { font-family: var(--font-heading); font-size: 26px; font-weight: 700; color: var(--navy-900); letter-spacing: -0.02em; }
.stat-card__trend { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: var(--space-2); }
.stat-card__trend.up { color: var(--success-500); }
.stat-card__trend.down { color: var(--danger-500); }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-50); color: var(--success-600); }
.badge-warning { background: var(--warning-50); color: var(--warning-600); }
.badge-danger { background: var(--danger-50); color: var(--danger-600); }
.badge-info { background: var(--info-50); color: var(--info-600); }
.badge-neutral { background: var(--bg-canvas-alt); color: var(--text-secondary); }
.badge-gold { background: #FBF3E2; color: var(--gold-700); }

.role-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; }
.role-badge--sales { background: var(--role-sales-bg); color: var(--role-sales); }
.role-badge--finance { background: var(--role-finance-bg); color: var(--role-finance); }
.role-badge--logistics { background: var(--role-logistics-bg); color: var(--role-logistics); }
.role-badge--admin { background: var(--role-admin-bg); color: var(--role-admin); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--bg-card); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 700;
  padding: 14px var(--space-5);
  background: var(--bg-canvas-alt);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.data-table tbody td { padding: 15px var(--space-5); border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--bg-canvas); }
.data-table .cell-muted { color: var(--text-muted); }
.data-table .cell-strong { font-weight: 600; color: var(--navy-900); }

.empty-state { text-align: center; padding: var(--space-16) var(--space-6); color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: var(--space-4); opacity: 0.4; }

/* ---- Permission troubleshooting ---- */
.permission-page {
  max-width: 680px;
  margin: clamp(2rem, 8vh, 6rem) auto;
  padding: clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.permission-page__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--warning-50);
  color: var(--warning-600);
  font: 800 28px/1 var(--font-heading);
}
.permission-page h1 { margin: var(--space-3) 0 var(--space-2); }
.permission-page__message { max-width: 520px; margin: 0 auto var(--space-5); }
.permission-page__details {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-canvas-alt);
  color: var(--text-secondary);
  font-size: 13px;
}
.permission-page__details strong { color: var(--text-primary); }
.permission-page__actions { display: flex; justify-content: center; gap: var(--space-3); flex-wrap: wrap; }
.permission-page__help { margin: var(--space-5) 0 0; font-size: 12px; }

@media (max-width: 600px) {
  .permission-page { margin: var(--space-5) 0; }
  .permission-page__actions .btn { width: 100%; }
}

/* ---- Forms ---- */
.form-group { margin-bottom: var(--space-5); }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 7px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-choice-group ul { display: flex; gap: var(--space-4); flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.form-choice-group li { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(212, 169, 74, 0.15);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357617A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

@media (max-width: 720px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .card, .stat-card { padding: var(--space-4); border-radius: var(--radius-md); }
  .vehicle-card__preview { width: 104px; height: 70px; margin-left: var(--space-3); }
  .card-header { flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
  .card-header > .btn, .card-header > a.btn { width: 100%; }
  .stat-card__value { font-size: 22px; }
  .stat-card__label { font-size: 11px; }
  .btn { min-height: 44px; padding: 11px 16px; }
  .btn-sm { min-height: 40px; }
  .form-input, .form-select, .form-textarea { min-height: 44px; font-size: 16px; }
  .form-textarea { min-height: 110px; }
  .table-wrap { margin-left: calc(var(--space-4) * -1); margin-right: calc(var(--space-4) * -1); border-left: 0; border-right: 0; border-radius: 0; -webkit-overflow-scrolling: touch; }
  table.data-table { min-width: 680px; }
  .data-table thead th, .data-table tbody td { padding: 12px var(--space-4); }
  .pipeline { margin-left: calc(var(--space-4) * -1); margin-right: calc(var(--space-4) * -1); border-radius: 0; padding: var(--space-4); }
  .wizard-steps { overflow-x: auto; padding-bottom: 2px; }
  .wizard-step { min-width: 118px; white-space: nowrap; }
  .summary-sidebar { position: static; }
  .toast-stack { top: var(--space-4); left: var(--space-4); right: var(--space-4); }
  .toast { min-width: 0; max-width: none; }
  .sales-trend-card .card-header { align-items: stretch; }
  .chart-period-switcher { width: 100%; justify-content: space-between; }
  .chart-period-switcher button { flex: 1; }
  .sales-trend-chart { height: 230px; }
  .executive-dashboard__vehicle-art { width: 100%; height: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Alerts / Banners ---- */
.alert {
  display: flex; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  margin-bottom: var(--space-5);
  align-items: flex-start;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 700; margin-bottom: 2px; display: block; }
.alert-danger { background: var(--danger-50); border-color: #f5c9c5; color: var(--danger-600); }
.alert-warning { background: var(--warning-50); border-color: #f5deb0; color: var(--warning-600); }
.alert-success { background: var(--success-50); border-color: #b9e6cf; color: var(--success-600); }
.alert-info { background: var(--info-50); border-color: #bcd4fc; color: var(--info-600); }

.compliance-banner {
  background: linear-gradient(135deg, #fff7ec, #fdeeea);
  border: 1.5px solid var(--danger-500);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex; gap: var(--space-4); align-items: flex-start;
  margin-bottom: var(--space-6);
  box-shadow: 0 4px 20px rgba(225, 72, 59, 0.12);
}
.compliance-banner__icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--danger-500);
  display: flex; align-items: center; justify-content: center;
  animation: pulse-danger 2s infinite;
}
.compliance-banner__icon svg { width: 22px; height: 22px; color: #fff; }
@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 72, 59, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(225, 72, 59, 0); }
}
.compliance-banner strong { display: block; color: var(--danger-600); font-size: 14.5px; margin-bottom: 4px; }
.compliance-banner p { color: #7a3128; font-size: 13.5px; margin: 0; }

/* ---- Toasts ---- */
.toast-stack { position: fixed; top: var(--space-6); right: var(--space-6); z-index: 200; display: flex; flex-direction: column; gap: var(--space-3); }
.toast {
  min-width: 300px; max-width: 380px;
  background: var(--navy-900); color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
  display: flex; gap: var(--space-3); align-items: flex-start;
  animation: toastIn var(--transition-slow);
  border-left: 4px solid var(--gold-500);
}
.toast.success { border-left-color: var(--success-500); }
.toast.error { border-left-color: var(--danger-500); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.toast-body { font-size: 13px; line-height: 1.4; }

/* ---- Pipeline Stepper ---- */
.pipeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-6);
  position: relative;
  overflow-x: auto;
  gap: var(--space-2);
}

.pipeline-stage {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 120px; position: relative; text-align: center;
}

.pipeline-stage::after {
  content: '';
  position: absolute;
  top: 22px; left: 50%; width: 100%; height: 2px;
  background: var(--border-strong);
  z-index: 0;
}
.pipeline-stage:last-child::after { display: none; }
.pipeline-stage.completed::after { background: var(--success-500); }

.pipeline-stage__node {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-canvas-alt);
  border: 2px solid var(--border-strong);
  color: var(--text-muted);
  font-weight: 700;
  z-index: 1;
  margin-bottom: var(--space-3);
  transition: all var(--transition-base);
}
.pipeline-stage__node svg { width: 20px; height: 20px; }

.pipeline-stage.completed .pipeline-stage__node {
  background: var(--success-500); border-color: var(--success-500); color: #fff;
}
.pipeline-stage.active .pipeline-stage__node {
  background: var(--navy-900); border-color: var(--navy-900); color: var(--gold-400);
  box-shadow: 0 0 0 6px rgba(11, 30, 61, 0.1);
  animation: pulse-active 2s infinite;
}
@keyframes pulse-active {
  0%, 100% { box-shadow: 0 0 0 6px rgba(11, 30, 61, 0.1); }
  50% { box-shadow: 0 0 0 10px rgba(11, 30, 61, 0.04); }
}
.pipeline-stage.locked .pipeline-stage__node { opacity: 0.5; }

.pipeline-stage__label { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.pipeline-stage.locked .pipeline-stage__label { color: var(--text-muted); }
.pipeline-stage__meta { font-size: 10.5px; color: var(--text-muted); }

@media (max-width: 900px) {
  .pipeline { flex-direction: column; align-items: stretch; }
  .pipeline-stage { flex-direction: row; text-align: left; gap: var(--space-3); padding: var(--space-2) 0; }
  .pipeline-stage::after { display: none; }
  .pipeline-stage__node { margin-bottom: 0; }
}

/* ---- Quote Wizard ---- */
.wizard-steps { display: flex; gap: var(--space-2); margin-bottom: var(--space-8); }
.wizard-step {
  flex: 1; text-align: center; padding: var(--space-3) var(--space-2);
  border-bottom: 3px solid var(--border-subtle);
  color: var(--text-muted); font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  transition: all var(--transition-base);
}
.wizard-step.active { border-color: var(--gold-500); color: var(--navy-900); }
.wizard-step.done { border-color: var(--success-500); color: var(--success-600); }

.summary-sidebar {
  position: sticky; top: calc(var(--topbar-height) + var(--space-6));
  background: var(--navy-900);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}
.summary-sidebar h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; margin-bottom: var(--space-5); }
.summary-line { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.08); color: var(--text-inverse-muted); }
.summary-line strong { color: #fff; font-weight: 600; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,0.12); }
.summary-total .label { font-size: 12.5px; color: var(--text-inverse-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-total .value { font-family: var(--font-heading); font-size: 24px; font-weight: 800; color: var(--gold-400); }
.quotation-preview__eyebrow { color: var(--gold-400); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.quotation-preview h4 { margin-top: 4px; }
.quotation-preview__vehicle { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; margin-bottom: var(--space-2); border-bottom: 1px solid rgba(255,255,255,.1); }
.quotation-preview__vehicle-image { width: 58px; height: 46px; flex: 0 0 58px; border-radius: var(--radius-sm); background: rgba(255,255,255,.1); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: var(--text-inverse-muted); font-size: 10px; }
.quotation-preview__vehicle-image.has-image span { display: none; }
.quotation-preview__vehicle strong { display: block; color: #fff; font-size: 12px; }
.quotation-preview__vehicle small { display: block; color: var(--text-inverse-muted); font-size: 10px; margin-top: 2px; }
.quotation-preview__status { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,.1); color: var(--text-inverse-muted); font-size: 11px; }
.quotation-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 430px); gap: var(--space-8); align-items: start; }
.quotation-mode-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin: 0 0 var(--space-4); padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-card-alt); }
.quotation-mode-controls__label { color: var(--text-secondary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.quotation-mode-controls .quotation-preview__modes { width: min(360px, 100%); margin: 0; background: var(--bg-canvas-alt); }
.quotation-mode-controls .quotation-preview__modes button { color: var(--text-secondary); }
.quotation-mode-controls .quotation-preview__modes button.is-active { background: var(--navy-900); color: #fff; }
.quotation-submit { min-height: 52px; font-size: 14px; }
.quotation-preview { background: #fff; color: var(--text-primary); border: 1px solid var(--border-subtle); box-shadow: 0 18px 42px rgba(8,28,69,.16); }
.quotation-preview h4 { color: var(--navy-900); font-size: 18px; opacity: 1; text-transform: none; letter-spacing: 0; }
.quotation-preview__eyebrow { color: var(--gold-700); }
.quotation-preview__title-row p { color: var(--text-muted); }
.quotation-preview__badge { border-color: var(--border-strong); color: var(--navy-700); }
.quotation-preview__vehicle { border-color: var(--border-subtle); }
.quotation-preview__vehicle-image { background-color: var(--bg-canvas-alt); color: var(--text-muted); }
.quotation-preview__vehicle strong { color: var(--navy-900); }
.quotation-preview__vehicle small { color: var(--text-muted); }
.quotation-preview .summary-line { color: var(--text-secondary); border-color: var(--border-subtle); }
.quotation-preview .summary-line strong { color: var(--navy-900); }
.quotation-preview .summary-total { border-color: var(--border-strong); }
.quotation-preview .summary-total .label { color: var(--text-secondary); }
.quotation-preview .summary-total .value { color: var(--navy-900); font-size: 28px; }
.quotation-preview .quotation-preview__status { border-color: var(--border-subtle); color: var(--text-muted); }
.quotation-preview__email { border-color: var(--border-subtle); background: var(--bg-canvas); }
.quotation-preview__email span { color: var(--text-muted); }
.quotation-preview__email strong { color: var(--navy-900); }
.quotation-preview__email p { color: var(--text-secondary); }
.preview-mode-email .quotation-preview__vehicle { padding-top: var(--space-5); }
.preview-mode-invoice { border-top: 5px solid var(--gold-500); }
.preview-mode-invoice .quotation-preview__eyebrow { color: var(--gold-700); }
.quotation-heading { position: relative; min-height: 130px; overflow: hidden; padding-right: var(--space-4); }
.quotation-heading > div:first-child { position: relative; z-index: 1; }
.quotation-heading__art { width: min(360px, 38vw); height: 122px; display: flex; align-items: end; justify-content: end; margin-left: auto; }
.quotation-heading__art img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: right bottom; filter: drop-shadow(0 14px 18px rgba(8,28,69,.16)); }
.quote-section { overflow: hidden; }
.quote-section__toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.quote-section__toggle > span { display: flex; align-items: center; gap: var(--space-3); }
.quote-section__toggle > span > strong { color: var(--gold-600); font-size: 12px; }
.quote-section__toggle h3 { margin: 0; }
.quote-section__toggle small { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.quote-section__toggle > svg { width: 18px; height: 18px; color: var(--text-muted); transition: transform var(--transition-base); }
.quote-section__body { max-height: 0; overflow: hidden; opacity: 0; margin-top: 0; transition: max-height var(--transition-slow), opacity var(--transition-base), margin-top var(--transition-base); }
.quote-section.is-open .quote-section__body { max-height: 1800px; opacity: 1; margin-top: var(--space-6); }
.quote-section.is-open .quote-section__toggle > svg { transform: rotate(180deg); }
.quotation-preview__title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.quotation-preview__title-row p { margin: 2px 0 0; color: var(--text-inverse-muted); font-size: 11px; }
.quotation-preview__badge { padding: 4px 7px; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-pill); color: var(--gold-400); font: 700 9px var(--font-body); letter-spacing: .08em; }
.quotation-preview__modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: var(--space-4) 0; padding: 4px; border-radius: var(--radius-md); background: rgba(255,255,255,.08); }
.quotation-preview__modes button { border: 0; border-radius: var(--radius-sm); padding: 8px 5px; background: transparent; color: var(--text-inverse-muted); cursor: pointer; font: 600 11px var(--font-body); }
.quotation-preview__modes button.is-active { background: var(--gold-500); color: var(--navy-950); }
.quotation-preview__email { margin-bottom: var(--space-4); padding: var(--space-3); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-md); background: rgba(255,255,255,.06); }
.quotation-preview__email span { color: var(--text-inverse-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.quotation-preview__email strong { display: block; color: #fff; font-size: 12px; margin: 3px 0 7px; }
.quotation-preview__email p { margin: 0; color: var(--text-inverse-muted); font-size: 11px; }

/* ---- Progress bar ---- */
.progress-track { height: 8px; background: var(--bg-canvas-alt); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); border-radius: var(--radius-pill); transition: width var(--transition-slow); }

/* ---- Utility ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .quotation-workspace { grid-template-columns: minmax(0, 1fr) minmax(330px, 390px); gap: var(--space-5); }
  .quotation-preview { position: static; }
}
@media (max-width: 820px) {
  .quotation-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .quotation-heading { min-height: 0; gap: var(--space-2); }
  .quotation-heading__art { width: 100%; height: 82px; margin-top: calc(var(--space-2) * -1); }
  .quotation-mode-controls { align-items: stretch; flex-direction: column; gap: var(--space-2); }
  .quotation-mode-controls .quotation-preview__modes { width: 100%; }
}

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; align-items: center; gap: var(--space-3); }
.mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mb-6 { margin-bottom: var(--space-6); }
.text-muted { color: var(--text-muted); } .text-success { color: var(--success-500); } .text-danger { color: var(--danger-500); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }
.section-title h2 { margin: 0; }
