/* Redline 3D — Dealer Dashboard v2 (matches auth/login quality) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --rl-red: #e11d24;
  --rl-red-dark: #991b1b;
  --rl-red-glow: rgba(225, 29, 36, 0.25);
  --rl-bg: #050508;
  --rl-surface: #0c0c10;
  --rl-surface-2: #121218;
  --rl-surface-3: #1a1a22;
  --rl-border: rgba(255, 255, 255, 0.07);
  --rl-text: #f4f4f5;
  --rl-muted: #a1a1aa;
  --rl-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rl-logo-url: url('/assets/redline_3d.png');
  --rl-logo-src: '/assets/redline_3d.png';
  --dash-sidebar-w: 260px;
  --dash-topbar-h: 64px;
  --dash-content-pad: 1.75rem;
}

/* Light theme. The toggle in dashboard.html sets data-theme="light" on <html>.
   Only content surfaces and content text flip — brand red is identical in both
   themes, and the sidebar and top bar deliberately stay dark (see below). */
:root[data-theme="light"] {
  --rl-bg: #f5f5f7;
  --rl-surface: #ffffff;
  --rl-surface-2: #fafafa;
  --rl-surface-3: #f0f0f3;
  --rl-border: rgba(0, 0, 0, 0.10);
  --rl-text: #17171b;
  --rl-muted: #5b5b66;
}

/* Sidebar and top bar stay dark in both themes: they are chrome, only the
   content area goes light. Under the light theme, pin their colours back to
   the dark values as literals, since the variables above have flipped. Each
   rule mirrors an existing selector; the :root[data-theme="light"] prefix
   out-ranks the original, and !important is used where the original has it or
   where a dashboard.html rule would otherwise win (.sidebar span/div and
   * { color: var(--text) } are both theme-driven there). */
/* The dark rgba(10, 10, 10, 0.72) background is translucent: over the light
   page it composites to mid-grey (#4b4b4c), not dark. #080809 is what the
   dark theme actually renders (that rgba over --rl-bg #050508), made opaque. */
:root[data-theme="light"] .dashboard-v2 .sidebar {
  background: #080809 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
}

:root[data-theme="light"] .dashboard-v2 .sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* !important: dashboard.html's `.sidebar span { color: var(--text) !important }`
   beats the originals, which is why the "3D" renders white, not red, today. */
:root[data-theme="light"] .dashboard-v2 .sidebar-wordmark-main,
:root[data-theme="light"] .dashboard-v2 .sidebar-wordmark-accent {
  color: #f4f4f5 !important;
}

:root[data-theme="light"] .dashboard-v2 .sidebar-wordmark-tag {
  color: #a1a1aa;
}

:root[data-theme="light"] .dashboard-v2 .nav-section-title {
  color: #a1a1aa !important;
}

:root[data-theme="light"] .dashboard-v2 .nav-item {
  color: #a1a1aa !important;
}

:root[data-theme="light"] .dashboard-v2 .nav-item:hover:not(.active) {
  background: #121218 !important;
  color: #f4f4f5 !important;
}

/* Restated so the .nav-item pin above does not out-rank the active item. */
:root[data-theme="light"] .dashboard-v2 .nav-item.active {
  color: #fff !important;
}

:root[data-theme="light"] .dashboard-v2 .nav-badge,
:root[data-theme="light"] .dashboard-v2 .user-avatar {
  color: #fff !important;
}

:root[data-theme="light"] .dashboard-v2 .sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #121218;
}

:root[data-theme="light"] .dashboard-v2 .user-name,
:root[data-theme="light"] .dashboard-v2 .user-email {
  color: #f4f4f5 !important;
}

:root[data-theme="light"] .dashboard-v2 .top-bar {
  background: #080809 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

/* Theme toggle, PWA install and Logout sit in the top bar. */
:root[data-theme="light"] .dashboard-v2 .top-bar .btn-secondary {
  background: #121218 !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  color: #f4f4f5 !important;
}

:root[data-theme="light"] .dashboard-v2 .top-bar .btn-secondary:hover {
  background: #2a2a2a !important;
}

:root[data-theme="light"] .dashboard-v2 .top-bar .mobile-menu-btn {
  color: #f4f4f5;
}

:root[data-theme="light"] .dashboard-v2 .top-bar .mobile-menu-btn:hover {
  background: #141414;
}

/* Icons use stroke="currentColor", and dashboard.html's * { color: var(--text) }
   reaches every <svg> and <path>, so pin their colour here too. */
:root[data-theme="light"] .dashboard-v2 .sidebar svg,
:root[data-theme="light"] .dashboard-v2 .sidebar svg *,
:root[data-theme="light"] .dashboard-v2 .top-bar svg,
:root[data-theme="light"] .dashboard-v2 .top-bar svg * {
  color: #f4f4f5;
}

body.dashboard-v2 {
  font-family: var(--rl-font) !important;
  background: var(--rl-bg) !important;
  color: var(--rl-text) !important;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body.dashboard-v2 .dash-watermark {
  position: absolute;
  top: calc(var(--dash-topbar-h) + var(--dash-content-pad) + 4pt);
  left: calc(var(--dash-content-pad) + 10pt);
  right: var(--dash-content-pad);
  pointer-events: none;
  z-index: 0;
  user-select: none;
  opacity: 0.07;
}

body.dashboard-v2 .dash-watermark-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 0.88;
  font-family: var(--rl-font);
  font-weight: 800;
  letter-spacing: -0.04em;
}

body.dashboard-v2 .dash-watermark-redline {
  font-size: clamp(3.5rem, 11vw, 7.5rem);
  color: #ffffff;
  text-shadow: 0 0 80px rgba(225, 29, 36, 0.35);
}

body.dashboard-v2 .dash-watermark-3d {
  font-size: clamp(1.75rem, 5.5vw, 3.75rem);
  color: var(--rl-red);
  letter-spacing: 0.08em;
  margin-left: 0.08em;
}

@media (max-width: 768px) {
  body.dashboard-v2 .dash-watermark {
    opacity: 0.05;
    top: calc(var(--dash-topbar-h) + 1rem + 4pt);
    left: calc(1rem + 10pt);
    right: 1rem;
  }
  body.dashboard-v2 .dash-watermark-redline {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }
}

.dashboard-v2 .dashboard-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.dashboard-v2 .sidebar {
  width: 260px;
  flex-shrink: 0;
  background: rgba(10, 10, 10, 0.72) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--rl-border) !important;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.dashboard-v2 .sidebar-header {
  padding: 1.35rem 1.25rem 1.1rem;
  border-bottom: 1px solid var(--rl-border);
  position: relative;
  z-index: 1;
}

.dashboard-v2 .sidebar-wordmark {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  line-height: 1;
}

.dashboard-v2 .sidebar-wordmark-main {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--rl-text);
}

.dashboard-v2 .sidebar-wordmark-accent {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--rl-red);
}

.dashboard-v2 .sidebar-wordmark-tag {
  flex: 0 0 100%;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rl-muted);
  margin-top: 0.15rem;
}

.dashboard-v2 .sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.dashboard-v2 .nav-section { margin-bottom: 1.25rem; }

.dashboard-v2 .nav-section-title {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--rl-muted) !important;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.dashboard-v2 #launch-configurator-btn {
  border-radius: 10px !important;
  font-size: 0.8125rem !important;
  letter-spacing: 0.04em !important;
  box-shadow: 0 4px 20px var(--rl-red-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.dashboard-v2 #launch-configurator-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--rl-red-glow);
}

.dashboard-v2 .nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem !important;
  border-radius: 10px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: var(--rl-muted) !important;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.dashboard-v2 .nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.dashboard-v2 .nav-item:hover:not(.active) {
  background: var(--rl-surface-2) !important;
  color: var(--rl-text) !important;
}

.dashboard-v2 .nav-item.active {
  background: linear-gradient(135deg, var(--rl-red) 0%, var(--rl-red-dark) 100%) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 16px var(--rl-red-glow);
}

.dashboard-v2 .sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
}

.dashboard-v2 .user-avatar {
  background: linear-gradient(135deg, var(--rl-red), var(--rl-red-dark)) !important;
  font-weight: 700;
}

.dashboard-v2 .main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 260px;
  min-height: 100vh;
  background: transparent !important;
  position: relative;
  z-index: 1;
}

/* Phones (batch K): the sidebar is an off-canvas overlay there (admin.css), so
   the content takes the full width. Without this the 260px margin above
   out-ranked admin.css's own reset and pushed every page off a phone screen.
   And the sidebar's tap targets reach 44px (they were 42px, the menu button 40x43). */
@media (max-width: 768px) {
  .dashboard-v2 .main-content { margin-left: 0; }
  .dashboard-v2 .nav-item,
  .dashboard-v2 #launch-configurator-btn { min-height: 44px; }
  .dashboard-v2 #mobile-menu-btn { min-width: 44px; min-height: 44px; }
}
/* Phones turned sideways (844x390, 932x430 are wider than 768px): the same phone
   layout - admin.css's off-canvas sidebar and menu button, mirrored here - instead
   of the desktop sidebar taking a third of a 390px-tall screen. Tablets and
   laptops are taller than 500px and keep their layout. */
@media (max-width: 1024px) and (max-height: 500px) {
  .dashboard-v2 .sidebar { transform: translateX(-100%); }
  .dashboard-v2 .sidebar.open { transform: translateX(0); }
  .dashboard-v2 .mobile-menu-btn { display: block; }
  .dashboard-v2 .main-content { margin-left: 0; }
  .dashboard-v2 .nav-item,
  .dashboard-v2 #launch-configurator-btn { min-height: 44px; }
  .dashboard-v2 #mobile-menu-btn { min-width: 44px; min-height: 44px; }
}

.dashboard-v2 .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  height: 64px;
  background: rgba(10, 10, 10, 0.72) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rl-border) !important;
  position: sticky;
  top: 0;
  z-index: 50;
}

.dashboard-v2 .page-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

.dashboard-v2 .content-area {
  padding: 1.75rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

.dashboard-v2 .card {
  background: var(--rl-surface) !important;
  border: 1px solid var(--rl-border) !important;
  border-radius: 16px !important;
  overflow: hidden;
}

.dashboard-v2 .card-header {
  padding: 1.25rem 1.5rem !important;
  border-bottom: 1px solid var(--rl-border) !important;
}

.dashboard-v2 .btn-primary {
  background: linear-gradient(135deg, var(--rl-red) 0%, var(--rl-red-dark) 100%) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
}

.dashboard-v2 .btn-secondary {
  background: var(--rl-surface-2) !important;
  border: 1px solid var(--rl-border) !important;
  border-radius: 10px !important;
  color: var(--rl-text) !important;
}

/* Pricing engine */
.dashboard-v2 .pricing-engine-wrapper { max-width: 1280px; }

.dashboard-v2 .pricing-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.dashboard-v2 .pricing-page-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-v2 .pricing-wip-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--rl-red);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
}

.dashboard-v2 .pricing-formula-hint {
  font-size: 0.8125rem;
  color: var(--rl-muted);
  line-height: 1.5;
  margin: 0;
}

.dashboard-v2 .pricing-mode-banner {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
}

.dashboard-v2 .pricing-mode-banner.mode-kit { border-color: rgba(59, 130, 246, 0.3); background: rgba(59, 130, 246, 0.06); }
.dashboard-v2 .pricing-mode-banner.mode-bom { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.06); }
.dashboard-v2 .pricing-mode-banner.mode-hybrid { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.06); }

/* .order-form-upload-zone is reused by the BOM tab's PDF import wizard (retired standalone
   Order Form tab used to render it too). */
.dashboard-v2 .order-form-upload-zone {
  border: 2px dashed var(--rl-border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 1rem 0 1.25rem;
  transition: border-color 0.15s, background 0.15s;
}

.dashboard-v2 .order-form-upload-zone.drag-over {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(168, 85, 247, 0.06);
}

.dashboard-v2 .pipeline-row .quote-row-project {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

/* Flat bomCatalog/openings CSV import wizard */
.dashboard-v2 .bom-csv-launcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rl-border);
}

.dashboard-v2 .bom-csv-wizard {
  margin-bottom: 1.75rem;
  padding: 1.25rem;
  border: 1px solid var(--rl-border);
  border-radius: 12px;
  background: var(--rl-surface-2);
}

.dashboard-v2 .bom-csv-wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-v2 .bom-csv-wizard-header .pricing-section-title {
  margin: 0;
}

.dashboard-v2 .bom-csv-steps {
  display: flex;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}

.dashboard-v2 .bom-csv-step-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--rl-border);
  color: var(--rl-muted);
}

.dashboard-v2 .bom-csv-step-dot.active {
  border-color: #a855f7;
  color: #a855f7;
}

.dashboard-v2 .bom-csv-step-dot.done {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: #a855f7;
}

.dashboard-v2 .bom-csv-preview-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  margin: 0.75rem 0;
}

.dashboard-v2 .bom-csv-col-pickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-v2 .bom-csv-col-pickers label span {
  display: block;
  font-size: 0.8125rem;
  color: var(--rl-muted);
  margin-bottom: 0.25rem;
}

.dashboard-v2 .bom-csv-step-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.dashboard-v2 .bom-csv-target-search-bar {
  margin-bottom: 0.75rem;
}

.dashboard-v2 .bom-csv-targets {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
}

.dashboard-v2 .bom-csv-target-group {
  margin-bottom: 0.5rem;
}

.dashboard-v2 .bom-csv-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rl-border);
}

.dashboard-v2 .bom-csv-target-row-hidden {
  display: none;
}

.dashboard-v2 .bom-csv-target-row .bom-csv-target-select {
  max-width: 280px;
}

.dashboard-v2 .bom-csv-target-label {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
}

.dashboard-v2 .bom-csv-target-current {
  font-size: 0.75rem;
  color: var(--rl-muted);
}

/* Conflict review for a re-mapped rate — reused by the BOM tab's PDF import method (retired
   standalone Order Form tab used this same markup/class set for its own re-upload review). */
.dashboard-v2 .order-form-conflict-review {
  padding: 1.25rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.06);
  margin-bottom: 1.5rem;
}

.dashboard-v2 .order-form-conflict-bulk-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.dashboard-v2 .order-form-conflict-rows {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  background: var(--rl-surface-2);
}

.dashboard-v2 .order-form-conflict-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rl-border);
  flex-wrap: wrap;
}

.dashboard-v2 .order-form-conflict-row:last-child {
  border-bottom: none;
}

.dashboard-v2 .order-form-conflict-desc {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  min-width: 180px;
}

.dashboard-v2 .order-form-conflict-prices {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.dashboard-v2 .order-form-conflict-old {
  color: var(--rl-muted);
  text-decoration: line-through;
}

.dashboard-v2 .order-form-conflict-new {
  color: #22c55e;
  font-weight: 600;
}

.dashboard-v2 .order-form-conflict-arrow {
  color: var(--rl-muted);
}

.dashboard-v2 .order-form-conflict-actions {
  display: flex;
  gap: 0.5rem;
}

.dashboard-v2 .order-form-conflict-resolve-btn {
  border: 1px solid var(--rl-border);
  background: transparent;
  color: var(--rl-muted);
}

.dashboard-v2 .order-form-conflict-resolve-btn.active {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  font-weight: 600;
}

.dashboard-v2 .order-form-conflict-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.dashboard-v2 .mode-cards {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .dashboard-v2 .mode-cards {
    grid-template-columns: 1fr;
  }
}

.dashboard-v2 .pricing-mode-banner strong { display: block; font-size: 0.9375rem; margin-bottom: 0.25rem; }
.dashboard-v2 .pricing-mode-banner p { margin: 0; font-size: 0.8125rem; color: var(--rl-muted); }

.dashboard-v2 .pricing-nav {
  background: var(--rl-surface) !important;
  border: 1px solid var(--rl-border) !important;
  border-radius: 12px !important;
  padding: 0.35rem !important;
  gap: 0.25rem !important;
}

.dashboard-v2 .pricing-nav-item {
  border-radius: 8px !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  padding: 0.6rem 1rem !important;
  color: var(--rl-muted) !important;
}

.dashboard-v2 .pricing-nav-item.active {
  background: var(--rl-red) !important;
  color: #fff !important;
  box-shadow: 0 2px 12px var(--rl-red-glow);
}

.dashboard-v2 .pricing-nav-item.pricing-nav-muted {
  opacity: 0.45;
  pointer-events: none;
}

.dashboard-v2 .pricing-nav-item.pricing-nav-secondary {
  opacity: 0.7;
}

.dashboard-v2 .pricing-panel {
  background: var(--rl-surface) !important;
  border: 1px solid var(--rl-border) !important;
  border-radius: 16px !important;
  padding: 1.5rem !important;
  margin-top: 1rem;
}

/* Page-level framing-system selector (Stage 2) — sits above the 8-tab pricing nav, visible
   regardless of which tab is active. Same solid-highlight active-state convention as
   .pricing-nav-item.active (readability fix: no off-white/gray box behind inactive tab text,
   just muted text directly on the dark surface; active tab gets a solid red fill + white
   text, not a subtle border). */
.dashboard-v2 .framing-system-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
}

.dashboard-v2 .framing-system-tabs {
  display: flex;
  gap: 0.4rem;
}

.dashboard-v2 .framing-system-tab {
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--rl-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
}

.dashboard-v2 .framing-system-tab.active {
  background: var(--rl-red);
  color: #fff;
  box-shadow: 0 2px 12px var(--rl-red-glow);
}

.dashboard-v2 .framing-system-selector .mirror-toggle-bar {
  margin: 0;
  flex: 1 1 auto;
}

.dashboard-v2 .pricing-section-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.75rem !important;
}

.dashboard-v2 .pricing-help {
  color: var(--rl-muted) !important;
  font-size: 0.8125rem !important;
  margin-bottom: 1rem !important;
}

.dashboard-v2 .pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dashboard-v2 .pricing-table th {
  text-align: left;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--rl-muted) !important;
  padding: 0.65rem 0.75rem;
  background: var(--rl-surface-2) !important;
  border-bottom: 1px solid var(--rl-border) !important;
}

.dashboard-v2 .pricing-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--rl-border) !important;
  vertical-align: middle;
}

.dashboard-v2 .pricing-input,
.dashboard-v2 .form-input {
  background: var(--rl-surface-2) !important;
  border: 1px solid var(--rl-border) !important;
  border-radius: 8px !important;
  padding: 0.5rem 0.65rem !important;
  font-size: 0.875rem !important;
  color: var(--rl-text) !important;
  width: 100%;
  max-width: 120px;
}

.dashboard-v2 .mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .dashboard-v2 .mode-cards { grid-template-columns: 1fr; }
}

.dashboard-v2 .mode-card {
  position: relative;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 2px solid var(--rl-border);
  background: var(--rl-surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  color: var(--rl-text);
}

.dashboard-v2 .mode-card:hover { border-color: rgba(255,255,255,0.15); }
.dashboard-v2 .mode-card.selected {
  border-color: var(--rl-red);
  background: rgba(225, 29, 36, 0.08);
}

.dashboard-v2 .mode-card-title {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}

.dashboard-v2 .mode-card-desc {
  font-size: 0.75rem;
  color: var(--rl-muted);
  line-height: 1.45;
}

.dashboard-v2 .framing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .dashboard-v2 .framing-grid { grid-template-columns: 1fr; }
}

.dashboard-v2 .framing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--rl-surface-2);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
}

.dashboard-v2 .framing-card-label {
  font-weight: 600;
  font-size: 0.875rem;
}

.dashboard-v2 .framing-card-sub {
  font-size: 0.7rem;
  color: var(--rl-muted);
  margin-top: 2px;
}

.dashboard-v2 .framing-card input {
  max-width: 72px;
  text-align: center;
}

.dashboard-v2 .pricing-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: 12px;
}

.dashboard-v2 .pricing-subsection-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--rl-red);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rl-border);
}

/* ── Homepage ── */
.dashboard-v2 .dashboard-home {
  max-width: 1200px;
}

.dashboard-v2 .dash-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: stretch;
  margin-bottom: 1.75rem;
  padding: 2rem 2.25rem;
  background: linear-gradient(135deg, rgba(225, 29, 36, 0.1) 0%, rgba(12, 12, 16, 0.55) 50%, rgba(12, 12, 16, 0.7) 100%);
  border: 1px solid var(--rl-border);
  border-radius: 20px;
}

@media (max-width: 900px) {
  .dashboard-v2 .dash-hero { grid-template-columns: 1fr; }
}

.dashboard-v2 .dash-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rl-red);
  margin: 0 0 0.75rem;
}

.dashboard-v2 .dash-hero-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.dashboard-v2 .dash-hero-lead {
  font-size: 0.9375rem;
  color: var(--rl-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 540px;
}

.dashboard-v2 .dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dashboard-v2 .dash-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  background: linear-gradient(135deg, var(--rl-red) 0%, var(--rl-red-dark) 100%);
  color: #fff !important;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--rl-red-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.dashboard-v2 .dash-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--rl-red-glow);
}

.dashboard-v2 .dash-btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.35rem;
  background: transparent;
  color: var(--rl-text) !important;
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dashboard-v2 .dash-btn-ghost:hover {
  background: var(--rl-surface-2);
  border-color: rgba(255, 255, 255, 0.15);
}

.dashboard-v2 .dash-hero-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--rl-border);
  border-radius: 16px;
}

.dashboard-v2 .dash-stat { text-align: center; }

.dashboard-v2 .dash-stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rl-muted);
  margin-bottom: 0.35rem;
}

.dashboard-v2 .dash-stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--rl-text);
}

.dashboard-v2 .dash-stat-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--rl-muted);
  margin-top: 0.5rem;
}

.dashboard-v2 .dash-framing-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.dashboard-v2 .dash-framing-chips span {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--rl-border);
  color: var(--rl-muted);
}

.dashboard-v2 .dash-account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 768px) {
  .dashboard-v2 .dash-account-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-v2 .dash-account-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem 1.15rem;
  text-align: left;
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--rl-text);
}

.dashboard-v2 .dash-account-card:hover {
  border-color: rgba(225, 29, 36, 0.45);
  background: var(--rl-surface-2);
}

.dashboard-v2 .dash-account-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rl-red);
}

.dashboard-v2 .dash-account-card strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--rl-text);
}

.dashboard-v2 .dash-account-hint {
  font-size: 0.75rem;
  color: var(--rl-muted);
  line-height: 1.35;
}

.dashboard-v2 .account-empty-hint {
  padding: 1rem 0;
  color: var(--rl-muted);
  font-size: 0.875rem;
}

.dashboard-v2 .account-empty-hint p {
  margin: 0 0 1rem;
}

.dashboard-v2 #page-plan.page-content.active,
.dashboard-v2 #page-settings.page-content.active,
.dashboard-v2 #page-contract-settings.page-content.active {
  max-width: 1100px;
}

.dashboard-v2 .dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
  .dashboard-v2 .dash-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .dashboard-v2 .dash-quick-grid { grid-template-columns: 1fr; }
}

.dashboard-v2 .dash-quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--rl-text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.dashboard-v2 .dash-quick-card:hover {
  border-color: rgba(225, 29, 36, 0.4);
  background: var(--rl-surface-2);
  transform: translateY(-2px);
}

.dashboard-v2 .dash-quick-icon {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--rl-red);
  background: rgba(225, 29, 36, 0.12);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
}

.dashboard-v2 .dash-quick-title {
  font-weight: 700;
  font-size: 0.9375rem;
}

.dashboard-v2 .dash-quick-desc {
  font-size: 0.75rem;
  color: var(--rl-muted);
}

.dashboard-v2 .dash-card {
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: 16px;
  overflow: hidden;
}

.dashboard-v2 .dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--rl-border);
}

.dashboard-v2 .dash-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.dashboard-v2 .dash-card-sub {
  font-size: 0.8125rem;
  color: var(--rl-muted);
  margin: 0;
}

.dashboard-v2 .dash-search-wrap {
  position: relative;
  flex: 1;
  max-width: 280px;
}

.dashboard-v2 .dash-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--rl-muted);
  pointer-events: none;
}

.dashboard-v2 .dash-search-wrap .form-input {
  padding-left: 2.25rem !important;
  max-width: none;
}

.dashboard-v2 .pipeline-table-head {
  display: grid;
  grid-template-columns: 2fr 100px 120px 120px;
  gap: 1rem;
  padding: 0.65rem 1.5rem;
  background: var(--rl-surface-2);
  border-bottom: 1px solid var(--rl-border);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rl-muted);
}

.dashboard-v2 .pipeline-body .quote-row {
  display: grid;
  grid-template-columns: 2fr 100px 120px 120px;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--rl-border);
  align-items: center;
  font-size: 0.875rem;
  transition: background 0.12s;
}

.dashboard-v2 .pipeline-body .quote-row:hover {
  background: var(--rl-surface-2);
}

.dashboard-v2 .quote-row-project {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.dashboard-v2 .quote-type-pill {
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.dashboard-v2 .quote-type-lead {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.dashboard-v2 .quote-type-quote {
  background: rgba(161, 161, 170, 0.15);
  color: var(--rl-muted);
}

.dashboard-v2 .quote-row-date {
  color: var(--rl-muted);
  font-size: 0.8125rem;
}

.dashboard-v2 .quote-status-select {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--rl-surface-2);
  border: 1px solid var(--rl-border);
  color: var(--rl-text);
  cursor: pointer;
  width: fit-content;
}

.dashboard-v2 .quote-row-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.dashboard-v2 .pipeline-empty {
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.dashboard-v2 .pipeline-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  color: var(--rl-muted);
  opacity: 0.6;
}

.dashboard-v2 .pipeline-empty-icon svg {
  width: 100%;
  height: 100%;
}

.dashboard-v2 .pipeline-empty h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.dashboard-v2 .pipeline-empty p {
  margin: 0 0 1.5rem;
  color: var(--rl-muted);
  font-size: 0.875rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.dashboard-v2 .trial-onboard {
  padding: 2.25rem 1.5rem 2rem;
  max-width: 980px;
  margin: 0 auto;
}

.dashboard-v2 .trial-onboard-head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.dashboard-v2 .trial-onboard-head h3 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.dashboard-v2 .trial-onboard-head p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--rl-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.dashboard-v2 .trial-onboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-v2 .trial-onboard-item {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-v2 .trial-onboard-item-feature {
  border-color: rgba(185, 28, 28, 0.45);
  background: rgba(185, 28, 28, 0.06);
}

.dashboard-v2 .trial-onboard-num {
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #EF4444;
}

.dashboard-v2 .trial-onboard-item h4 {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  font-weight: 700;
}

.dashboard-v2 .trial-onboard-item p {
  margin: 0;
  color: var(--rl-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.dashboard-v2 .trial-onboard-contact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

.dashboard-v2 .trial-onboard-contact a {
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.dashboard-v2 .trial-onboard-contact a:hover {
  color: #EF4444;
}

.dashboard-v2 .trial-onboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.dashboard-v2 .trial-onboard-btn-ghost {
  font: inherit;
  padding: 0.6rem 1.1rem;
  background: transparent;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-v2 .trial-onboard-btn-ghost:hover {
  border-color: rgba(185, 28, 28, 0.6);
}

@media (max-width: 900px) {
  .dashboard-v2 .trial-onboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ── BOM panel ── */
.dashboard-v2 .bom-system-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard-v2 .bom-system-tabs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .dashboard-v2 .bom-system-tabs { grid-template-columns: 1fr; }
}

.dashboard-v2 .bom-system-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: var(--rl-surface-2);
  border: 2px solid var(--rl-border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--rl-text);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.dashboard-v2 .bom-system-tab:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.dashboard-v2 .bom-system-tab.active {
  border-color: var(--rl-red);
  background: rgba(225, 29, 36, 0.08);
}

.dashboard-v2 .bom-system-tab-label {
  font-weight: 700;
  font-size: 0.875rem;
}

.dashboard-v2 .bom-system-tab-desc {
  font-size: 0.7rem;
  color: var(--rl-muted);
  line-height: 1.35;
}

.dashboard-v2 .bom-global-rates {
  padding: 1.25rem;
  background: var(--rl-surface-2);
  border: 1px solid var(--rl-border);
  border-radius: 14px;
  margin-bottom: 1.5rem;
}

.dashboard-v2 .bom-rates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .dashboard-v2 .bom-rates-grid { grid-template-columns: 1fr; }
}

.dashboard-v2 .bom-rates-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rl-muted);
}

.dashboard-v2 .bom-rates-grid .pricing-input {
  max-width: none;
}

.dashboard-v2 .bom-group-count {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--rl-muted);
  margin-left: 0.35rem;
}

.dashboard-v2 .bom-cat-cell strong {
  display: block;
  font-size: 0.8125rem;
}

.dashboard-v2 .bom-cat-code {
  display: block;
  font-size: 0.68rem;
  color: var(--rl-muted);
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}

.dashboard-v2 .bom-cat-check {
  text-align: center;
  width: 48px;
}

.dashboard-v2 .bom-material-input {
  max-width: 110px;
}

.dashboard-v2 .bom-lines-table th:nth-child(2),
.dashboard-v2 .bom-lines-table td:nth-child(2) {
  width: 48px;
  text-align: center;
}

/* The pipeline's columns: Project, Framing, Estimate, Status, Date, Actions.
   The header and every row use this one definition, with fixed tracks for all
   but Project, so each title sits over its own column. (Separate grids with
   auto or fr tracks would size each one to its own content.) */
.dashboard-v2 .pipeline-cq {
  --pipeline-cols: minmax(0, 1fr) 112px 88px 100px 64px 204px;
  container: pipeline / inline-size;
}

.dashboard-v2 .pipeline-table-head {
  display: grid;
  grid-template-columns: var(--pipeline-cols);
  gap: 0.75rem;
  padding: 0.55rem 1.25rem;
  background: var(--rl-surface-2);
  border-bottom: 1px solid var(--rl-border);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rl-muted);
}

.dashboard-v2 .pipeline-table-head .pipeline-col-actions {
  text-align: right;
}

.dashboard-v2 .pipeline-body.pipeline-table {
  padding: 0;
}

.dashboard-v2 .pipeline-row {
  display: grid;
  grid-template-columns: var(--pipeline-cols);
  gap: 0.75rem;
  padding: 0.55rem 1.25rem;
  border-bottom: 1px solid var(--rl-border);
  align-items: center;
  font-size: 0.8125rem;
  transition: background 0.12s;
}

.dashboard-v2 .pipeline-row:hover {
  background: var(--rl-surface-2);
}

.dashboard-v2 .pipeline-row-title {
  /* block, or the ellipsis below never applies and a long name runs on into
     the Framing column */
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.dashboard-v2 .pipeline-row-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--rl-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-v2 .pipeline-row-meta {
  color: var(--rl-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-v2 .pipeline-row-estimate {
  font-weight: 600;
  color: var(--rl-text);
}

.dashboard-v2 .pipeline-row-main {
  min-width: 0;
}

.dashboard-v2 .pipeline-row .quote-row-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.dashboard-v2 .pipeline-row .pipeline-btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* Remove: an X, white on the dark theme and black on the light one. */
.dashboard-v2 .pipeline-btn-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

:root[data-theme="light"] .dashboard-v2 .pipeline-btn-remove {
  color: #000000;
}

.dashboard-v2 .pipeline-btn-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.dashboard-v2 .pipeline-btn-remove:focus-visible,
.dashboard-v2 .pipeline-share .share-badge:focus-visible,
.dashboard-v2 .share-menu [role="menuitem"]:focus-visible {
  outline: 2px solid var(--rl-red);
  outline-offset: 2px;
}

/* The share line under a quote's title: the status badge (it opens the link's
   menu) and Copy link. */
.dashboard-v2 .pipeline-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.3rem;
}

.dashboard-v2 .pipeline-share .share-badge {
  margin-top: 0;
  border: 0;
  font-family: inherit;
  line-height: 1.35;
  white-space: normal;
  text-align: left;
  cursor: pointer;
}

.dashboard-v2 .pipeline-share .share-badge::after {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}

.dashboard-v2 .pipeline-row .pipeline-btn-copy {
  padding: 0.15rem 0.5rem;
  font-size: 0.66rem;
}

.dashboard-v2 .pipeline-btn-copy.is-copied {
  border-color: rgba(34, 197, 94, 0.45);
  color: #4ade80;
}

:root[data-theme="light"] .dashboard-v2 .pipeline-btn-copy.is-copied {
  color: #15803d;
}

/* The badge's menu. In <body> and fixed, because the card clips its content. */
.dashboard-v2 .share-menu {
  position: fixed;
  z-index: 1000;
  min-width: 168px;
  padding: 0.3rem;
  background: var(--rl-surface-3);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.dashboard-v2 .share-menu [role="menuitem"] {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--rl-text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.dashboard-v2 .share-menu [role="menuitem"]:hover:not([disabled]),
.dashboard-v2 .share-menu [role="menuitem"]:focus-visible {
  background: var(--rl-surface-2);
}

.dashboard-v2 .share-menu [role="menuitem"][disabled] {
  color: var(--rl-muted);
  opacity: 0.6;
  cursor: not-allowed;
}

.dashboard-v2 .share-menu .share-menu-danger {
  color: #f87171;
}

:root[data-theme="light"] .dashboard-v2 .share-menu .share-menu-danger {
  color: #b91c1c;
}

@media (pointer: coarse) {
  .dashboard-v2 .share-menu [role="menuitem"] {
    min-height: 44px;
  }
}

/* Narrow pipeline (a phone, or a small window): no header, each row a card.
   Keyed to the card's own width, so it holds however the page around it is
   laid out, including the coming mobile dashboard. */
@container pipeline (max-width: 860px) {
  .dashboard-v2 .pipeline-table-head {
    display: none;
  }
  .dashboard-v2 .pipeline-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "project project"
      "meta    estimate"
      "status  date"
      "actions actions";
    gap: 0.6rem 0.75rem;
    margin: 0.6rem 0.75rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--rl-border);
    border-radius: 12px;
    background: var(--rl-surface-2);
  }
  .dashboard-v2 .pipeline-row:hover {
    background: var(--rl-surface-2);
  }
  .dashboard-v2 .pipeline-row > .quote-row-project { grid-area: project; align-items: flex-start; }
  .dashboard-v2 .pipeline-row > .pipeline-row-meta { grid-area: meta; }
  .dashboard-v2 .pipeline-row > .pipeline-row-estimate { grid-area: estimate; text-align: right; }
  .dashboard-v2 .pipeline-row > .quote-status-select { grid-area: status; min-height: 40px; }
  .dashboard-v2 .pipeline-row > .quote-row-date { grid-area: date; align-self: center; text-align: right; }
  .dashboard-v2 .pipeline-row > .quote-row-actions {
    grid-area: actions;
    justify-content: flex-start;
    gap: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--rl-border);
  }
  .dashboard-v2 .pipeline-row-title {
    white-space: normal;
  }
  .dashboard-v2 .pipeline-row .quote-row-actions .pipeline-btn {
    min-height: 44px;
    padding: 0 1rem;
    font-size: 0.8125rem;
  }
  .dashboard-v2 .pipeline-row .quote-row-actions .pipeline-btn-primary {
    flex: 1 1 auto;
  }
  .dashboard-v2 .pipeline-btn-remove {
    width: 44px;
    height: 44px;
    margin-left: auto;
  }
  .dashboard-v2 .pipeline-row .pipeline-btn-copy {
    min-height: 36px;
    padding: 0 0.75rem;
    font-size: 0.75rem;
  }
  .dashboard-v2 .pipeline-share .share-badge {
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
  }
}

/* The smallest phones (320-375px): tighter card edges, and Open/Edit and
   Contract share what is left beside the X, so all three stay on one line. */
@container pipeline (max-width: 400px) {
  .dashboard-v2 .pipeline-row {
    margin: 0.5rem;
    padding: 0.75rem;
  }
  .dashboard-v2 .pipeline-row .quote-row-actions .pipeline-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 0.5rem;
  }
}

/* ── Leads tab rows ──
   The inline styles dashboard.html's renderLeads and the Leads header used to
   write, moved here unchanged (batch Q) so the phone layout below can replace
   them; scripts/verify-pipeline-mobile.mjs checks every computed value against
   the old build. The status tint never showed: `background: var(--info)20` is
   invalid once substituted, so it is left out rather than "fixed" on desktop. */
.dashboard-v2 .leads-query-input {
  padding-left: 34px;
  width: 200px;
}

.dashboard-v2 .leads-table-head,
.dashboard-v2 .lead-row {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 100px 150px 100px 140px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-v2 .leads-table-head {
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dashboard-v2 .lead-row {
  align-items: center;
  font-size: 0.9rem;
}

.dashboard-v2 .lead-cell-name {
  font-weight: 600;
}

.dashboard-v2 .lead-cell-muted {
  color: var(--text-muted) !important;
  font-size: 0.85rem;
}

.dashboard-v2 .lead-cell-building {
  font-size: 0.85rem;
}

.dashboard-v2 .lead-status {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  display: inline-block;
  width: fit-content;
}

.dashboard-v2 .lead-status-new { color: var(--info) !important; }
.dashboard-v2 .lead-status-contacted { color: var(--warning) !important; }
.dashboard-v2 .lead-status-converted { color: var(--success) !important; }
.dashboard-v2 .lead-status-lost { color: var(--danger) !important; }

.dashboard-v2 .lead-cell-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ── Phones (batch Q): two-line rows and the record sheet ──
   .list-row-m is a row's phone form (pipelineRowPhoneHtml, leadRowPhoneHtml):
   one button, two lines. It is display:none everywhere else, and a display:none
   child is no grid item, so desktop and tablet rows are laid out exactly as
   before. Everything that shows it sits in the PHONE_LIST_MEDIA query
   (js/record-sheet.js): portrait phones up to 600px wide, and phones turned
   sideways. Tablets (768 and up, taller than 500px) keep the cards above. */
.dashboard-v2 .list-row-m {
  display: none;
}

@media (max-width: 600px), (max-width: 1024px) and (max-height: 500px) {
  /* The Overview card also matches the legacy .pipeline-card rule below
     (padding, a column gap, a hover lift with a red border). On a phone the
     rows run edge to edge, and a tap leaves :hover stuck on, so neither
     applies. Desktop keeps it as it is. */
  .dashboard-v2 .pipeline-card.pipeline-cq {
    padding: 0;
    gap: 0;
  }
  .dashboard-v2 .pipeline-card.pipeline-cq:hover {
    border-color: var(--rl-border);
    transform: none;
  }

  /* The card head: the title, then the search across the card. */
  .dashboard-v2 .pipeline-card .dash-card-head {
    align-items: center;
    gap: 0.6rem 1rem;
    padding: 0.85rem 0.9rem 0.75rem;
  }
  .dashboard-v2 .pipeline-card .dash-card-title {
    margin: 0;
  }
  .dashboard-v2 .pipeline-card .dash-card-sub {
    display: none;
  }
  .dashboard-v2 .pipeline-card .dash-search-wrap {
    flex: 1 1 240px;
    max-width: none;
  }
  .dashboard-v2 .pipeline-card .dash-search-wrap .form-input {
    min-height: 44px;
  }

  /* A pipeline row is only its phone form. */
  .dashboard-v2 .pipeline-cq .pipeline-row {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--rl-border);
    border-radius: 0;
    background: transparent;
  }
  .dashboard-v2 .pipeline-cq .pipeline-row:hover {
    background: transparent;
  }
  .dashboard-v2 .pipeline-cq .pipeline-row:last-child {
    border-bottom: 0;
  }
  .dashboard-v2 .pipeline-cq .pipeline-row > :not(.list-row-m) {
    display: none;
  }

  /* The phone row. Every span names its colour: dashboard.html's
     `.main-content span { color: var(--text) }` would otherwise win. */
  .dashboard-v2 .list-row-m {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0.6rem 0.9rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--rl-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .dashboard-v2 .list-row-m:active {
    background: var(--rl-surface-2);
  }
  .dashboard-v2 .list-row-m:focus-visible {
    outline: 2px solid var(--rl-red);
    outline-offset: -2px;
  }
  .dashboard-v2 .list-row-m .rm-l1,
  .dashboard-v2 .list-row-m .rm-l2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
  }
  .dashboard-v2 .list-row-m .rm-l2 {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.4;
  }
  .dashboard-v2 .list-row-m .rm-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--rl-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dashboard-v2 .list-row-m .rm-total {
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--rl-text);
  }
  .dashboard-v2 .list-row-m .rm-nototal {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rl-muted);
  }
  .dashboard-v2 .list-row-m .rm-bld {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--rl-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dashboard-v2 .list-row-m .rm-date {
    flex: 0 0 auto;
    color: var(--rl-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .dashboard-v2 .list-row-m .rm-kind {
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #60a5fa;
  }
  .dashboard-v2 .list-row-m .rm-pill {
    flex: 0 0 auto;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    background: rgba(161, 161, 170, 0.15);
    color: #d4d4d8;
  }
  .dashboard-v2 .list-row-m .rm-s-new { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
  .dashboard-v2 .list-row-m .rm-s-followup,
  .dashboard-v2 .list-row-m .rm-s-contacted { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
  .dashboard-v2 .list-row-m .rm-s-pending { background: rgba(168, 85, 247, 0.16); color: #c084fc; }
  .dashboard-v2 .list-row-m .rm-s-won,
  .dashboard-v2 .list-row-m .rm-s-converted { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
  .dashboard-v2 .list-row-m .rm-s-lost { background: rgba(239, 68, 68, 0.14); color: #f87171; }
  .dashboard-v2 .list-row-m .rm-share,
  .dashboard-v2 .list-row-m .rm-inpipe {
    flex: 0 0 auto;
    font-weight: 600;
    white-space: nowrap;
    color: var(--rl-muted);
  }
  .dashboard-v2 .list-row-m .rm-share::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 0.3rem;
    border-radius: 50%;
    background: currentColor;
    vertical-align: 1px;
  }
  .dashboard-v2 .list-row-m .rm-share-opened { color: #fbbf24; }
  .dashboard-v2 .list-row-m .rm-share-approved,
  .dashboard-v2 .list-row-m .rm-inpipe { color: #4ade80; }
  .dashboard-v2 .list-row-m .rm-share-changes_requested { color: #f87171; }

  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-kind { color: #1d4ed8; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-pill { background: rgba(113, 113, 122, 0.14); color: #3f3f46; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-s-new { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-s-followup,
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-s-contacted { background: rgba(245, 158, 11, 0.16); color: #92400e; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-s-pending { background: rgba(168, 85, 247, 0.12); color: #6b21a8; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-s-won,
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-s-converted { background: rgba(34, 197, 94, 0.14); color: #166534; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-s-lost { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-share-opened { color: #b45309; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-share-approved,
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-inpipe { color: #15803d; }
  :root[data-theme="light"] .dashboard-v2 .list-row-m .rm-share-changes_requested { color: #b91c1c; }

  /* The Leads card: the title, then search, filter and an icon-only Refresh
     on one line; each lead only its phone form. The header's padding and gap
     are !important or inline today, hence !important here. */
  .dashboard-v2 .leads-card {
    container-type: inline-size;
  }
  .dashboard-v2 .leads-card > .card-header {
    gap: 0.6rem 1rem !important;
    padding: 0.85rem 0.9rem 0.75rem !important;
  }
  .dashboard-v2 .leads-toolbar {
    flex: 1 1 260px;
    min-width: 0;
  }
  .dashboard-v2 .leads-query {
    flex: 1 1 0;
    min-width: 0;
  }
  .dashboard-v2 .leads-query-input {
    width: 100%;
    max-width: none;
    min-height: 44px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-right: 0.5rem;
    padding-left: 34px !important;
  }
  .dashboard-v2 #leads-filter {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.5rem !important;
  }
  .dashboard-v2 #refresh-leads-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0 !important;
    gap: 0;
    font-size: 0 !important;
  }
  .dashboard-v2 .leads-table-head {
    display: none;
  }
  .dashboard-v2 .leads-card .lead-row {
    display: block;
    padding: 0;
    border-bottom: 1px solid var(--rl-border);
  }
  .dashboard-v2 .leads-card .lead-row:last-child {
    border-bottom: 0;
  }
  .dashboard-v2 .leads-card .lead-row > :not(.list-row-m) {
    display: none;
  }

  /* Sideways (the list 600px or wider): the two lines become one -
     name, size and framing, status, link or date, total. */
  @container (min-width: 600px) {
    .dashboard-v2 .list-row-m {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      min-height: 48px;
      padding-top: 0.35rem;
      padding-bottom: 0.35rem;
    }
    .dashboard-v2 .list-row-m .rm-l1,
    .dashboard-v2 .list-row-m .rm-l2 {
      display: contents;
    }
    .dashboard-v2 .list-row-m .rm-kind { order: 0; }
    .dashboard-v2 .list-row-m .rm-name { order: 1; }
    .dashboard-v2 .list-row-m .rm-bld { order: 2; flex: 0 1 auto; max-width: 34%; font-size: 0.78rem; }
    .dashboard-v2 .list-row-m .rm-inpipe,
    .dashboard-v2 .list-row-m .rm-pill { order: 3; }
    .dashboard-v2 .list-row-m .rm-share,
    .dashboard-v2 .list-row-m .rm-date { order: 4; min-width: 64px; font-size: 0.75rem; text-align: right; }
    .dashboard-v2 .list-row-m .rm-total { order: 5; min-width: 78px; text-align: right; }
  }
}

/* The record sheet (js/record-sheet.js). It exists only while open, and only a
   phone row opens it. Above the sidebar (100); below the share menu, toasts and
   modals (1000), which it can open. */
body.record-sheet-open {
  overflow: hidden;
}

/* A toast (1000) is above the sheet; at the bottom it would sit on the
   sheet's buttons and take the next tap. While a sheet is open it shows at
   the top, and lets taps through to the sheet. */
body.record-sheet-open .toast-container {
  top: calc(0.75rem + env(safe-area-inset-top));
  bottom: auto;
  pointer-events: none;
}

.dashboard-v2 .record-sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.55);
  animation: record-sheet-fade 0.16s ease-out;
}

.dashboard-v2 .record-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 901;
  max-width: 640px;
  max-height: 85vh;
  max-height: 85dvh;
  margin: 0 auto;
  padding: 0 1rem calc(1rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--rl-surface-3);
  color: var(--rl-text);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
  animation: record-sheet-up 0.2s ease-out;
  outline: none;
}

@keyframes record-sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes record-sheet-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-v2 .record-sheet,
  .dashboard-v2 .record-sheet-scrim {
    animation: none;
  }
}

.dashboard-v2 .record-sheet-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  margin: 0 -1rem;
  background: var(--rl-surface-3);
}

.dashboard-v2 .record-sheet-grab {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

:root[data-theme="light"] .dashboard-v2 .record-sheet-grab {
  background: rgba(0, 0, 0, 0.18);
}

.dashboard-v2 .record-sheet-close {
  position: absolute;
  top: 0;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--rl-muted);
  cursor: pointer;
}

.dashboard-v2 .record-sheet-close:focus-visible,
.dashboard-v2 .record-sheet-chip:focus-visible,
.dashboard-v2 .record-sheet-delete:focus-visible {
  outline: 2px solid var(--rl-red);
  outline-offset: 2px;
}

.dashboard-v2 .record-sheet-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dashboard-v2 .record-sheet-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--rl-muted);
  overflow-wrap: anywhere;
}

.dashboard-v2 .record-sheet-total {
  margin: 0.35rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--rl-text);
}

.dashboard-v2 .record-sheet-total.record-sheet-nototal {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rl-muted);
}

.dashboard-v2 .record-sheet-label {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rl-muted);
}

.dashboard-v2 .record-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dashboard-v2 .record-sheet-chip {
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--rl-border);
  border-radius: 999px;
  background: var(--rl-surface-2);
  color: var(--rl-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-v2 .record-sheet-chip[aria-pressed="true"] {
  background: rgba(225, 29, 36, 0.18);
  border-color: rgba(225, 29, 36, 0.5);
  color: #fca5a5;
}

:root[data-theme="light"] .dashboard-v2 .record-sheet-chip[aria-pressed="true"] {
  background: rgba(225, 29, 36, 0.1);
  color: #b91c1c;
}

.dashboard-v2 .record-sheet-share .pipeline-share {
  margin-top: 0;
}

.dashboard-v2 .record-sheet-share .share-badge,
.dashboard-v2 .record-sheet-share .pipeline-btn-copy {
  min-height: 44px;
  padding: 0 0.8rem;
  font-size: 0.8rem;
}

.dashboard-v2 .record-sheet-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dashboard-v2 .record-sheet-actions .pipeline-btn {
  min-height: 46px;
  font-size: 0.88rem;
}

.dashboard-v2 .record-sheet-actions .pipeline-btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

@media (min-width: 560px) {
  .dashboard-v2 .record-sheet-actions {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-v2 .record-sheet-actions .record-sheet-wide {
    grid-column: 1 / -1;
  }
}

.dashboard-v2 .record-sheet-delete {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f87171;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

:root[data-theme="light"] .dashboard-v2 .record-sheet-delete {
  color: #b91c1c;
}

/* ── Pipeline cards (legacy) ── */
.dashboard-v2 .pipeline-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1rem 1.25rem 1.5rem;
}

.dashboard-v2 .pipeline-list-head {
  padding: 0.65rem 1.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rl-muted);
  border-bottom: 1px solid var(--rl-border);
}

.dashboard-v2 .pipeline-card {
  background: var(--rl-surface-2);
  border: 1px solid var(--rl-border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.15s, transform 0.15s;
}

.dashboard-v2 .pipeline-card:hover {
  border-color: rgba(225, 29, 36, 0.35);
  transform: translateY(-1px);
}

.dashboard-v2 .pipeline-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dashboard-v2 .pipeline-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dashboard-v2 .pipeline-source-pill {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dashboard-v2 .pipeline-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.dashboard-v2 .pipeline-card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
}

.dashboard-v2 .pipeline-detail span {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rl-muted);
  margin-bottom: 0.1rem;
}

.dashboard-v2 .pipeline-detail strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.dashboard-v2 .pipeline-card-contact {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--rl-muted);
}

.dashboard-v2 .pipeline-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rl-border);
}

.dashboard-v2 .pipeline-btn {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface);
  color: var(--rl-text);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}

.dashboard-v2 .pipeline-btn:hover {
  background: var(--rl-surface-3);
  border-color: rgba(255, 255, 255, 0.12);
}

.dashboard-v2 .pipeline-btn-primary {
  background: linear-gradient(135deg, var(--rl-red) 0%, var(--rl-red-dark) 100%);
  border-color: transparent;
  color: #fff;
}

.dashboard-v2 .pipeline-btn-primary:hover {
  box-shadow: 0 4px 16px var(--rl-red-glow);
}

.dashboard-v2 .pipeline-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ── Contract settings ── */
.dashboard-v2 .contract-settings-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .dashboard-v2 .contract-settings-layout {
    grid-template-columns: 1fr;
  }
}

.dashboard-v2 .contract-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--rl-border);
}

.dashboard-v2 .contract-tab {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  color: var(--rl-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.dashboard-v2 .contract-tab.active {
  background: var(--rl-red);
  border-color: var(--rl-red);
  color: #fff;
}

.dashboard-v2 .contract-settings-form {
  padding: 1.25rem;
}

.dashboard-v2 .contract-tab-panel {
  display: none;
}

.dashboard-v2 .contract-tab-panel.active {
  display: block;
}

.dashboard-v2 .contract-help {
  font-size: 0.8125rem;
  margin-bottom: 0.65rem;
}

.dashboard-v2 .signature-panel {
  border: 1px solid var(--rl-border);
  border-radius: 12px;
  padding: 1rem;
  background: #fff;
}

.dashboard-v2 .signature-panel canvas {
  width: 100%;
  max-width: 480px;
  border: 1px dashed rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  cursor: crosshair;
  display: block;
  background: #fff;
}

.dashboard-v2 .signature-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dashboard-v2 .payment-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-v2 .payment-preset-btn {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  color: var(--rl-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.dashboard-v2 .payment-preset-btn.active {
  border-color: var(--rl-red);
  color: var(--rl-red);
  background: rgba(225, 29, 36, 0.08);
}

.dashboard-v2 .contract-save-row {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rl-border);
}

.dashboard-v2 .contract-settings-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-v2 .contract-preview-wrap {
  padding: 1rem 1.25rem 1.25rem;
}

.dashboard-v2 .contract-preview-doc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--rl-muted);
}

.dashboard-v2 .contract-preview-doc h4 {
  margin: 0 0 0.25rem;
  color: var(--rl-text);
  font-size: 1rem;
}

.dashboard-v2 .contract-preview-kicker {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rl-red);
  margin: 0 0 0.35rem;
}

.dashboard-v2 .contract-preview-sub {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
}

.dashboard-v2 .contract-preview-sig {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--rl-border);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard-v2 .contract-list-sidebar {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 280px;
  overflow-y: auto;
}

.dashboard-v2 .contract-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  cursor: pointer;
  font-family: inherit;
  color: var(--rl-text);
  transition: border-color 0.12s;
}

.dashboard-v2 .contract-list-item:hover {
  border-color: rgba(225, 29, 36, 0.35);
}

.dashboard-v2 .contract-list-num {
  font-weight: 700;
  font-size: 0.8125rem;
}

.dashboard-v2 .contract-list-customer {
  font-size: 0.75rem;
  color: var(--rl-muted);
}

.dashboard-v2 .contract-list-building {
  font-size: 0.7rem;
  color: var(--rl-muted);
}

.dashboard-v2 .contract-list-total {
  grid-row: span 2;
  align-self: center;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--rl-red);
}

/* ── Contract document view ── */
.dashboard-v2 .contract-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.dashboard-v2 .contract-view-toolbar-right {
  display: flex;
  gap: 0.5rem;
}

.dashboard-v2 .contract-view-body {
  max-width: 900px;
}

.dashboard-v2 .contract-doc {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 2rem 2.25rem;
  border: 1px solid var(--rl-border);
  font-size: 0.875rem;
  line-height: 1.55;
}

.dashboard-v2 .contract-doc-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #111;
}

.dashboard-v2 .contract-doc-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
  margin: 0 0 0.35rem;
}

.dashboard-v2 .contract-doc-header h2 {
  margin: 0;
  font-size: 1.35rem;
  color: #111 !important;
}

.dashboard-v2 .contract-doc-meta {
  margin: 0.25rem 0 0;
  color: #555;
  font-size: 0.8125rem;
}

.dashboard-v2 .contract-doc-id {
  text-align: right;
  font-size: 0.8125rem;
}

.dashboard-v2 .contract-doc-id strong {
  display: block;
  font-size: 1.1rem;
  color: #111;
}

.dashboard-v2 .contract-doc-status {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #f3f4f6;
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.dashboard-v2 .dash-loading-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
  margin-bottom: 1.5rem;
  font-family: var(--rl-font);
  font-weight: 800;
}

.dashboard-v2 .contract-doc-section {
  margin-bottom: 1.35rem;
}

.dashboard-v2 .contract-doc-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin: 0 0 0.65rem;
}

.dashboard-v2 .contract-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .dashboard-v2 .contract-doc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-v2 .contract-doc-grid span {
  display: block;
  font-size: 0.68rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-v2 .contract-doc-grid strong {
  font-size: 0.875rem;
  color: #111;
}

.dashboard-v2 .contract-doc-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .dashboard-v2 .contract-doc-cols {
    grid-template-columns: 1fr;
  }
}

.dashboard-v2 .contract-doc-text {
  margin: 0;
  color: #333;
}

.dashboard-v2 .contract-doc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ccc;
}

.dashboard-v2 .contract-sig-block p {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: #111;
}

.dashboard-v2 .contract-sig-line {
  height: 48px;
  border-bottom: 1px solid #111;
  margin-bottom: 0.35rem;
}

.dashboard-v2 .contract-sig-img {
  max-height: 56px;
  max-width: 200px;
  display: block;
  margin-bottom: 0.35rem;
}

.dashboard-v2 .contract-sig-block span {
  font-size: 0.75rem;
  color: #666;
}

/* ── Account pages (settings, contracts, billing) ── */
.dashboard-v2 .dash-account-page {
  max-width: 1200px;
}

.dashboard-v2 .dash-page-intro {
  margin-bottom: 1.5rem;
}

.dashboard-v2 .dash-page-title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}

.dashboard-v2 .dash-page-lead {
  font-size: 0.9375rem;
  color: var(--rl-muted);
  margin: 0;
  max-width: 640px;
  line-height: 1.55;
}

.dashboard-v2 .dash-card-body {
  padding: 0 1.5rem 1.5rem;
}

.dashboard-v2 .dash-settings-page {
  max-width: 1200px;
}

.dashboard-v2 .dash-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-v2 .dash-settings-page-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-v2 .dash-settings-page-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-v2 .dash-settings-page .dash-card {
  height: 100%;
}

.dashboard-v2 .dash-settings-divider {
  height: 1px;
  background: var(--rl-border);
  margin: 1.35rem 0;
}

.dashboard-v2 .dash-logo-upload {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
}

.dashboard-v2 .dash-logo-preview {
  width: 160px;
  height: 80px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

/* Light theme: black at 25% over the light upload panel renders as a grey
   slab, and the white dashed edge disappears. An empty white slot with a dark
   dashed edge reads as a placeholder instead. */
:root[data-theme="light"] .dashboard-v2 .dash-logo-preview {
  border-color: rgba(0, 0, 0, 0.18);
  background: var(--rl-surface);
}

.dashboard-v2 .dash-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.dashboard-v2 .dash-logo-placeholder {
  font-size: 0.75rem;
  color: var(--rl-muted);
}

.dashboard-v2 .dash-logo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.dashboard-v2 .dash-config-body {
  display: flex;
  flex-direction: column;
}

.dashboard-v2 .dash-config-option {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dashboard-v2 .dash-config-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-v2 .dash-config-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rl-text);
}

.dashboard-v2 .dash-field-hint {
  font-size: 0.8125rem;
  color: var(--rl-muted);
  margin: 0;
  line-height: 1.45;
}

.dashboard-v2 .dash-field-status {
  font-size: 0.8125rem;
}

.dashboard-v2 .dash-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.dashboard-v2 .dash-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dashboard-v2 .dash-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--rl-surface-3);
  border: 1px solid var(--rl-border);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}

.dashboard-v2 .dash-switch-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.dashboard-v2 .dash-switch input:checked + .dash-switch-slider {
  background: var(--rl-red);
  border-color: var(--rl-red);
}

.dashboard-v2 .dash-switch input:checked + .dash-switch-slider::before {
  transform: translateX(20px);
}

.dashboard-v2 .dash-method-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.dashboard-v2 .dash-method-option {
  display: block;
  cursor: pointer;
}

.dashboard-v2 .dash-method-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dashboard-v2 .dash-method-option-inner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  transition: border-color 0.15s, background 0.15s;
}

.dashboard-v2 .dash-method-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rl-text);
}

.dashboard-v2 .dash-method-desc {
  font-size: 0.75rem;
  color: var(--rl-muted);
}

.dashboard-v2 .dash-method-option:hover .dash-method-option-inner {
  border-color: rgba(225, 29, 36, 0.35);
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-v2 .dash-method-option:has(input:checked) .dash-method-option-inner {
  border-color: var(--rl-red);
  background: rgba(225, 29, 36, 0.1);
  box-shadow: inset 3px 0 0 var(--rl-red);
}

.dashboard-v2 .dash-method-option:has(input:checked) .dash-method-name {
  color: #fff;
}

/* Light theme: the white above sits on a 10% red tint over a white card,
   about 1.2:1. Use the light theme's text colour instead. */
:root[data-theme="light"] .dashboard-v2 .dash-method-option:has(input:checked) .dash-method-name {
  color: var(--rl-text);
}

.dashboard-v2 .dash-settings-savebar {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.dashboard-v2 .dash-settings-savebar .dash-btn-primary {
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.dashboard-v2 .dash-settings-savebar .spinner {
  width: 18px;
  height: 18px;
}

.dashboard-v2 .dash-settings-page .form-group {
  margin-bottom: 1rem;
}

.dashboard-v2 .dash-settings-page .form-group:last-child {
  margin-bottom: 0;
}

.dashboard-v2 .dash-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .dashboard-v2 .dash-settings-grid {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }
}

.dashboard-v2 .dash-form-section {
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--rl-border);
}

.dashboard-v2 .dash-form-section:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.dashboard-v2 .dash-form-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rl-red);
  margin: 0 0 1rem;
}

.dashboard-v2 .dash-field-hint {
  font-size: 0.8125rem;
  color: var(--rl-muted);
  margin: 0.35rem 0 0.65rem;
  line-height: 1.45;
}

.dashboard-v2 .dash-field-status {
  font-size: 0.8125rem;
  margin-top: 0.35rem;
}

.dashboard-v2 .dash-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9375rem;
  margin-top: 0.35rem;
}

.dashboard-v2 .dash-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--rl-red);
}

.dashboard-v2 .dash-input-narrow {
  max-width: 220px;
}

/* Settings website field: a visual https:// inside the left edge of the input,
   placed the way .dash-search-wrap places its icon. js/website-url.js adds the
   scheme on save, so the dealer never has to type it. The 120px cap on
   .form-input is lifted here because a URL behind a prefix cannot fit in it. */
.dashboard-v2 .dash-url-wrap {
  position: relative;
}

.dashboard-v2 .dash-url-prefix {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: var(--rl-muted);
  pointer-events: none;
}

.dashboard-v2 .dash-url-wrap .form-input {
  padding-left: 4rem !important;
  max-width: none;
}

.dashboard-v2 .dash-url-wrap .form-input[aria-invalid="true"] {
  border-color: var(--danger) !important;
}

.dashboard-v2 .dash-field-error {
  color: var(--danger);
}

.dashboard-v2 .dash-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rl-border);
}

.dashboard-v2 .dash-plan-compare {
  margin-top: 1.25rem;
}

.dashboard-v2 .dash-plan-table-wrap {
  overflow-x: auto;
}

.dashboard-v2 .dash-plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dashboard-v2 .dash-plan-table th,
.dashboard-v2 .dash-plan-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rl-border);
  text-align: left;
}

.dashboard-v2 .dash-plan-table th {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rl-muted);
  background: var(--rl-surface-2);
}

.dashboard-v2 .dash-plan-table th:not(:first-child),
.dashboard-v2 .dash-plan-table td:not(:first-child) {
  text-align: center;
}

.dashboard-v2 .dash-plan-yes {
  color: #4ade80;
  font-weight: 600;
}

.dashboard-v2 .dash-plan-no {
  color: var(--rl-muted);
}

.dashboard-v2 .dash-plan-price-row td {
  font-weight: 700;
  background: rgba(225, 29, 36, 0.04);
}

.dashboard-v2 .dash-plan-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
}

.dashboard-v2 .dash-plan-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rl-muted);
  margin-bottom: 0.35rem;
}

.dashboard-v2 .dash-plan-stat-value {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-v2 .dash-plan-stat-value.is-yes {
  color: #4ade80;
}

.dashboard-v2 .dash-plan-stat-value.is-muted {
  color: var(--rl-muted);
}

.dashboard-v2 .dash-plan-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dashboard-v2 .dash-plan-upgrade {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rl-border);
}

.dashboard-v2 .dash-plan-upgrade-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-v2 .dash-plan-upgrade-lead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--rl-muted);
}

.dashboard-v2 .dash-plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.dashboard-v2 .dash-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.dashboard-v2 .dash-plan-card:hover {
  border-color: rgba(225, 29, 36, 0.45);
  transform: translateY(-2px);
}

.dashboard-v2 .dash-plan-card-featured {
  border-color: var(--rl-red);
  background: rgba(225, 29, 36, 0.06);
}

.dashboard-v2 .dash-plan-card-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--rl-red);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

.dashboard-v2 .dash-plan-card-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.dashboard-v2 .dash-plan-card-tag {
  font-size: 0.75rem;
  color: var(--rl-muted);
}

.dashboard-v2 .dash-plan-card-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--rl-red);
  margin-top: 0.35rem;
}

.dashboard-v2 .dash-plan-card-price small {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rl-muted);
}

.dashboard-v2 .dash-plan-card-alt {
  font-size: 0.75rem;
  color: var(--rl-muted);
}

/* Plan & Billing - three-tier chooser with one shared billing-cycle toggle.
   Only the pieces the two-card layout did not already have; the base
   .dash-plan-card rules above still supply the card shell. Desktop and tablet
   only, by design - no mobile breakpoint. */
.dashboard-v2 .dash-plan-upgrade-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-v2 .dash-plan-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  flex-shrink: 0;
}

.dashboard-v2 .dash-plan-toggle-btn {
  border: none;
  background: transparent;
  color: var(--rl-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dashboard-v2 .dash-plan-toggle-btn.is-active {
  background: var(--rl-red);
  color: #fff;
}

/* Three fixed columns rather than the base auto-fit, so the tiers never
   reflow to 2+1 inside the Plan & Billing card. */
.dashboard-v2 .dash-plan-cards-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

/* Tighter than the two-card layout so three fit without crowding. */
.dashboard-v2 .dash-plan-cards-3 .dash-plan-card {
  padding: 1rem 0.9rem;
  gap: 0.2rem;
}

.dashboard-v2 .dash-plan-cards-3 .dash-plan-card-name {
  font-size: 0.9375rem;
  line-height: 1.3;
  min-height: 2.4em;
}

.dashboard-v2 .dash-plan-cards-3 .dash-plan-card-price {
  font-size: 1.5rem;
  margin-top: 0.15rem;
}

.dashboard-v2 .dash-plan-card-features {
  list-style: none;
  margin: 0.65rem 0 0.9rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dashboard-v2 .dash-plan-card-features li {
  position: relative;
  padding-left: 0.95rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--rl-muted);
}

.dashboard-v2 .dash-plan-card-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rl-red);
}

/* margin-top:auto pins the CTA to the bottom so the three cards line up
   even when a tier name wraps to two lines. */
.dashboard-v2 .dash-plan-card-cta {
  margin-top: auto;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface);
  color: var(--rl-text);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.dashboard-v2 .dash-plan-card-cta:hover {
  border-color: var(--rl-red);
}

.dashboard-v2 .dash-plan-card-featured .dash-plan-card-cta {
  background: var(--rl-red);
  border-color: var(--rl-red);
  color: #fff;
}

/* Contract — full-width policy / legal fields */
.dashboard-v2 .contract-settings-main {
  min-width: 0;
}

.dashboard-v2 .contract-prose-panel.active {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.dashboard-v2 .contract-prose-panel .form-group {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
}

.dashboard-v2 textarea.contract-textarea {
  display: block;
  width: 100%;
  min-height: 148px;
  max-width: none;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.55;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
}

@media (max-width: 1100px) {
  .dashboard-v2 .contract-settings-layout {
    grid-template-columns: 1fr;
  }
}

@media print {
  .dashboard-v2 .sidebar,
  .dashboard-v2 .top-bar,
  .dashboard-v2 .no-print,
  .dashboard-v2 .dash-watermark {
    display: none !important;
  }
  .dashboard-v2 .main-content {
    margin-left: 0 !important;
  }
  .dashboard-v2 .contract-doc {
    border: none;
    border-radius: 0;
    padding: 0;
  }
}

/* ==========================================================================
   SHARE — the status badge on a quote's pipeline row
   Spec: docs/share-quote-spec.md §9A.

   The date in the badge is produced SERVER-SIDE ("Opened October 4, 2026 at
   2:41 PM CDT"). Nothing here formats or decides anything; these rules only
   colour what the server already said.
   ========================================================================== */

.dashboard-v2 .share-badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* "Not opened" is deliberately quiet - it is the resting state, not a problem. */
.dashboard-v2 .share-badge-sent {
  background: rgba(161, 161, 170, 0.15);
  color: var(--rl-muted);
}

.dashboard-v2 .share-badge-opened {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.dashboard-v2 .share-badge-approved {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
}

.dashboard-v2 .share-badge-changes_requested {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

.dashboard-v2 .share-badge-revoked {
  background: rgba(161, 161, 170, 0.1);
  color: var(--rl-muted);
}

.dashboard-v2 .share-badge-expired {
  background: rgba(161, 161, 170, 0.1);
  color: var(--rl-muted);
  text-decoration: line-through;
}

/* The light theme needs darker text for the same meaning: amber, red and
   green at dark-theme brightness wash out on white. */
:root[data-theme="light"] .dashboard-v2 .share-badge-opened {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

:root[data-theme="light"] .dashboard-v2 .share-badge-changes_requested {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

:root[data-theme="light"] .dashboard-v2 .share-badge-approved {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

/* ==========================================================================
   EMAIL VERIFICATION BANNER - Phase 1b
   js/verification-banner.js. Shown to unverified users on every tab.

   Amber, not red: being unverified is a thing to fix, not a failure state,
   and the user has full access to the product either way. The only thing it
   blocks is outbound share email, which is what the copy names.
   ========================================================================== */

/* THE VERIFICATION ASK — one line on the trial's plan card (2026-09-22).
   Was a full-width amber banner across the dashboard; only the trial reminder
   emails depend on a confirmed address, so it sits beside "Trial ends" instead
   of shouting on every page. Muted on purpose: informative, not an alarm. */
.dashboard-v2 .verify-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0.9rem 0 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.06);
  font-size: 0.82rem;
  line-height: 1.5;
}

.dashboard-v2 .verify-notice[hidden] {
  display: none !important;
}

.dashboard-v2 .verify-notice-text {
  flex: 1 1 260px;
  min-width: 0;
  color: var(--rl-muted);
}

.dashboard-v2 .verify-notice-text strong {
  color: var(--rl-text);
  font-weight: 600;
  word-break: break-word;
}

.dashboard-v2 .verify-notice-btn {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 600;
  padding: 0.42rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  cursor: pointer;
  white-space: nowrap;
}

.dashboard-v2 .verify-notice-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.22);
}

.dashboard-v2 .verify-notice-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dashboard-v2 .verify-notice-note {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.78rem;
  color: var(--rl-muted);
}

.dashboard-v2 .verify-note-ok { color: #4ade80; }
.dashboard-v2 .verify-note-bad { color: #f87171; }

/* Success state, after they confirm without reloading the page. */
.dashboard-v2 .verify-notice-ok {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.07);
}

.dashboard-v2 .verify-notice-ok .verify-notice-text strong {
  color: #4ade80;
}
