/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */

:root {
  /* Base palette - Light mode default */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-muted: #f1f5f9;
  
  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #cbd5e1;
  --text-muted: #94a3b8;
  
  /* Status colors - The soul of the app (original colors) */
  --status-not-now: #94a3b8;
  --status-intake: #3b82f6;
  --status-underwriters: #f59e0b;
  --status-quoted: #a855f7;
  --status-presented: #ec4899;
  --status-bound: #22c55e;
  --status-not-taken: #6b7280;
  --status-void: #ef4444;
  --status-mga-pending: #f97316;
  --status-draft: #64748b;
  --status-pending: #0f766e;
  --status-pending-bg: #14b8a6;
  --status-on-hold: #7c3aed;
  --status-on-hold-bg: #8b5cf6;
  --status-waiting-on-insured: #ea580c;
  --status-waiting-on-insured-bg: #f97316;
  --status-submitted: #0284c7;
  --status-submitted-bg: #0ea5e9;
  --status-closed: #475569;
  --status-on-going: #ea580c;
  --status-on-going-bg: #f97316;
  --status-unknown: #64748b;
  --status-muted: #6b7280;
  --status-muted-bg: #e5e7eb;
  --status-success: #16a34a;
  --status-success-bg: #dcfce7;
  
  /* Accents - Teal */
  --accent-primary: #0d9488;
  --accent-primary-hover: #0f766e;
  --accent-success: #22c55e;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --accent-subtle: rgba(13, 148, 136, 0.1);
  --accent-muted: rgba(13, 148, 136, 0.25);
  
  /* Default card color */
  --card-color: var(--status-intake);
  
  /* Sizing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Animation - Fizzy-style easings */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-overshoot: cubic-bezier(0.25, 1.75, 0.5, 1);
  --ease-out-overshoot-subtle: cubic-bezier(0.25, 1.25, 0.5, 1);
  --duration-fast: 0.1s;
  --duration-normal: 0.2s;
  --duration-slow: 0.3s;
  --dialog-duration: 150ms;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  
  /* Focus ring */
  --focus-ring-color: var(--status-intake);
  --focus-ring-size: 2px;
  --focus-ring-offset: 1px;
  
  color-scheme: light;
}
/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-theme="dark"] {
  /* Dark surfaces */
  --bg-base: #0f172a;
  --bg-surface: #1e293b;
  --bg-elevated: #334155;
  --bg-hover: #334155;
  --bg-muted: #1e293b;
  --bg-main: #0f172a;
  --surface-subtle: #172033;
  
  /* Dark borders */
  --border-subtle: #334155;
  --border-default: #475569;
  
  /* Dark text */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #64748b;
  --text-muted: #64748b;
  
  /* Status colors - slightly lighter for dark mode visibility */
  --status-not-now: #9ca3af;
  --status-intake: #60a5fa;
  --status-underwriters: #fbbf24;
  --status-quoted: #c084fc;
  --status-presented: #f472b6;
  --status-bound: #4ade80;
  --status-not-taken: #9ca3af;
  --status-void: #f87171;
  --status-mga-pending: #fb923c;
  --status-draft: #94a3b8;
  --status-pending: #2dd4bf;
  --status-pending-bg: #14b8a6;
  --status-on-hold: #a78bfa;
  --status-on-hold-bg: #8b5cf6;
  --status-waiting-on-insured: #fb923c;
  --status-waiting-on-insured-bg: #f97316;
  --status-submitted: #38bdf8;
  --status-submitted-bg: #0ea5e9;
  --status-closed: #94a3b8;
  --status-on-going: #fb923c;
  --status-on-going-bg: #f97316;
  --status-unknown: #94a3b8;
  --status-muted: #9ca3af;
  --status-muted-bg: #374151;
  --status-success: #4ade80;
  --status-success-bg: #14532d;

  /* Accents - lighter teal for dark mode */
  --accent-primary: #2dd4bf;
  --accent-primary-hover: #14b8a6;
  --accent-success: #4ade80;
  --accent-danger: #f87171;
  --accent-warning: #fbbf24;
  --accent-subtle: rgba(45, 212, 191, 0.15);
  --accent-muted: rgba(52, 211, 153, 0.3);
  
  /* Dark shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  
  color-scheme: dark;
}

[data-theme="dark"] .lv-detail-pane__body,
[data-theme="dark"] .lv-detail-pane__body .dashboard-page,
[data-theme="dark"] .lv-detail-pane__body .form-page,
[data-theme="dark"] .lv-detail-pane__body .single-page,
[data-theme="dark"] .lv-detail-pane__body .quote-pane {
  background: var(--bg-base);
  color: var(--text-primary);
}

[data-theme="dark"] .lv-detail-pane__panel,
[data-theme="dark"] .lv-pane__panel,
[data-theme="dark"] .quote-pane__card,
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .pane-readonly-field,
[data-theme="dark"] .comments-section,
[data-theme="dark"] .modal-content,
[data-theme="dark"] dialog.modal-dialog {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}

[data-theme="dark"] .quote-pane__stat-card,
[data-theme="dark"] .lv-pane__linked-row,
[data-theme="dark"] .lv-pane__linked-table,
[data-theme="dark"] .lv-group-pill,
[data-theme="dark"] .lv-doc-count,
[data-theme="dark"] .add-card-menu__result {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

[data-theme="dark"] .lv-group-pill__stat,
[data-theme="dark"] .quote-pane__stat-label,
[data-theme="dark"] .pane-detail-header__meta,
[data-theme="dark"] .quote-pane__amount,
[data-theme="dark"] .lv-text--muted,
[data-theme="dark"] .lv-empty {
  color: var(--text-secondary);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .add-card-menu__input,
[data-theme="dark"] textarea,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] .form-textarea::placeholder,
[data-theme="dark"] .add-card-menu__input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"])::placeholder {
  color: var(--text-muted);
}

/* Fallback to system preference when no explicit theme is set */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    /* Dark mode canvas */
    --lch-canvas: 20% 0.02 233;
    --lch-ink-inverted: var(--lch-black);
    
    /* Dark mode ink (grays) */
    --lch-ink-darkest: 96% 0.003 260;
    --lch-ink-darker: 86% 0.006 260;
    --lch-ink-dark: 74% 0.009 260;
    --lch-ink-medium: 62% 0.012 260;
    --lch-ink-light: 40% 0.015 260;
    --lch-ink-lighter: 30% 0.018 260;
    --lch-ink-lightest: 25% 0.02 260;
    
    /* Dark mode status colors */
    --lch-blue-dark: 74% 0.129 256;
    --lch-blue-medium: 62% 0.159 258;
    --lch-blue-light: 40% 0.094 260;
    
    --lch-yellow-dark: 74% 0.136 80;
    --lch-yellow-medium: 62% 0.146 70;
    --lch-yellow-light: 40% 0.074 60;
    
    --lch-green-dark: 74% 0.117 145;
    --lch-green-medium: 62% 0.126 146;
    --lch-green-light: 40% 0.065 147;
    
    --lch-purple-dark: 74% 0.141 306;
    --lch-purple-medium: 62% 0.177 308;
    --lch-purple-light: 40% 0.099 310;
    
    --lch-pink-dark: 74% 0.129 340;
    --lch-pink-medium: 62% 0.166 342;
    --lch-pink-light: 40% 0.085 344;
    
    --lch-red-dark: 74% 0.139 42;
    --lch-red-medium: 62% 0.154 40;
    --lch-red-light: 40% 0.088 38;
    
    /* Override surface colors */
    --bg-base: oklch(18% 0.02 233);
    --bg-surface: oklch(22% 0.018 233);
    --bg-elevated: oklch(26% 0.016 233);
    --bg-hover: oklch(30% 0.014 233);
    --bg-muted: oklch(20% 0.019 233);
    
    /* Darker shadows */
    --shadow-lg: 
      0 0 0 1px oklch(var(--lch-black) / 42%),
      0 0.2em 1.6em -0.8em oklch(var(--lch-black) / 60%),
      0 0.4em 2.4em -1em oklch(var(--lch-black) / 70%),
      0 0.4em 0.8em -1.2em oklch(var(--lch-black) / 80%);
    
    color-scheme: dark;
  }
}
/* ==========================================================================
   BASE
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-base);
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Screen reader only - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Display utilities */
.hidden { display: none !important; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Flexbox utilities */
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-none { flex: none; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* Gap utilities */
.gap-0 { gap: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-25 { width: 25%; }
.w-50 { width: 50%; }
.w-75 { width: 75%; }
.max-w-full { max-width: 100%; }

/* Padding utilities */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }

/* Margin utilities */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Text utilities */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Text color utilities */
.text-muted { color: var(--text-muted); }
.text-warning { color: var(--accent-warning); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }

/* Border utilities */
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--border-subtle); }
.border-b { border-bottom: 1px solid var(--border-subtle); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Cursor utilities */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Opacity utilities */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Grid utilities */
.grid-span-full { grid-column: 1 / -1; }
.grid-span-2 { grid-column: span 2; }

/* Form-specific utilities (replacing common inline styles) */
.form-section-title--no-border { margin-top: 0; border-top: none; padding-top: 0; }
.dashboard-card__body--flush { padding: 0; }
.task-item--centered { align-items: center; }
.inline-form-actions { display: flex; gap: 8px; }
.inline-form-label { display: flex; gap: 8px; align-items: center; margin: 0; }
.form-hint--spaced { margin-bottom: 16px; }
.form-hint--tight { margin-bottom: 12px; }
.search-wrapper--spaced { margin-bottom: 12px; }
.estimate-card--hidden { display: none; margin-bottom: 20px; }
.btn--spaced { margin-top: 12px; }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Table column widths */
.table-col-10 { width: 10%; }
.table-col-15 { width: 15%; }
.table-col-20 { width: 20%; }
.table-col-25 { width: 25%; }
.table-col-50 { width: 50%; }

/* Subsection titles */
.subsection-title--tight { margin-bottom: 8px; }

/* Icon spacing */
.icon-mr { margin-right: 0.25rem; }
.icon-mr-1 { margin-right: 4px; }
.icon-ml { margin-left: 0.25rem; }
.icon-ml-1 { margin-left: 4px; }

/* Activation checklist title */
.activation-checklist__title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

.inline-form { display: inline; }

/* Logo */
.logo-text {
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Page header info */
.page-header-info {
  flex: 1;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-contacts {
  margin-top: 12px;
}

/* Card tag variants - colors now inherited from card status */
.card-tag--quote-type {
  font-weight: 600;
}

.card-tag--endorsement-type {
  font-weight: 600;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
}

.card-client-type--draft {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.card-client-type--issued {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
}

.card-client-type--void {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
}

.card-tag-icon {
  opacity: 0.7;
}

/* Coverage type pills on pipeline cards */
.card-coverages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.card-coverage-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-hover);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Form extras */
.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 20px 0 12px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.form-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.form-section-header .form-section-title {
  margin-bottom: 0;
}

.form-section-header .btn-text {
  font-size: 13px;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-weight: 500;
}

.form-section-header .btn-text:hover {
  text-decoration: underline;
}

.form-subsection-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Input Group - for prepending/appending text to inputs */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-input {
  flex: 1;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  min-width: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group--compact .input-group-text {
  padding: 0 8px;
  font-size: 12px;
}

.input-group--compact .form-input {
  padding: 8px 10px;
  font-size: 13px;
}

/* Rate Section Styling */
.rate-section {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.rate-section h5 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

/* Tight form row for rate entries */
.form-row--tight {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.form-row--tight:last-of-type {
  border-bottom: none;
}

.form-group--label {
  margin-bottom: 0;
}

.rate-coverage-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group--rate {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.form-label--sm {
  font-size: 11px;
  color: var(--text-muted);
}

/* Endorsement Item Search Styles */
.search-input-wrapper {
  position: relative;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 350px;
  overflow-y: auto;
}

.search-suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.15s ease;
}

.search-suggestion:hover {
  background: var(--bg-muted);
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.search-suggestion__content {
  flex: 1;
  min-width: 0;
}

.search-suggestion__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.search-suggestion__meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.search-suggestion__badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.search-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
}

.search-badge.on-account {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.search-badge.new-to-account {
  background: rgba(59, 130, 246, 0.15);
  color: var(--status-intake);
}

.search-badge.on-policy {
  background: rgba(234, 179, 8, 0.15);
  color: var(--status-negotiating);
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Selected items list */
.selected-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.selected-item__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.selected-item__info strong {
  color: var(--text-primary);
}

.selected-item__remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
}

.selected-item__remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.form-input-group {
  display: flex;
  gap: 8px;
}

.form-input-group .form-input {
  flex: 1;
}

.form-group-narrow {
  max-width: 200px;
}

/* Item actions */
.item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Item row header (for bulk selection tables) */
.item-row--header {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-default);
  padding: 8px 16px 12px 0;
}

.item-row--header:hover {
  background: transparent;
  margin: 0;
  padding: 8px 16px 12px 0;
}

.item-row--header .item-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.item-row--header .item-meta {
  flex: 0 0 140px;
  text-align: left;
}

.item-row--header .item-meta:last-child {
  flex: 0 0 70px;
  text-align: left;
}

.item-checkbox {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-right: 8px;
}

.item-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

/* Bulk actions bar */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--accent-primary);
}

.bulk-actions-bar[hidden] {
  display: none;
}

.bulk-actions-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.bulk-actions-buttons {
  display: flex;
  gap: 8px;
}

/* Item row with checkbox - flex container for checkbox + link */
.item-row:has(.item-checkbox) {
  display: flex;
  align-items: center;
}

.item-row > .item-meta {
  flex: 0 0 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-row-link {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  padding: 12px 16px 12px 0;
  transition: background var(--duration-fast);
}

.item-row-link:hover {
  background: var(--bg-hover);
}

.item-row-link .item-info {
  flex: 1;
  min-width: 0;
}

.item-row-link .item-meta {
  flex: 0 0 100px;
  text-align: left;
}

.item-row-link .item-meta:last-child {
  flex: 0 0 70px;
}

/* Coverage tags in policy list */
.item-meta--tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.coverage-tag {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.coverage-tag--sm {
  padding: 0 4px;
  font-size: 9px;
  vertical-align: middle;
}

/* Modal Dialog Styles */
.modal-dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0;
  max-width: 600px;
  width: 90vw;
  max-height: 85vh;
  overflow: visible;
  background: var(--bg-surface);
}

.modal-dialog--wide { max-width: 900px; }
.modal-dialog--narrow { max-width: 560px; }

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-dialog[open] {
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

body.modal-open {
  overflow: hidden;
}

.modal-content {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
  min-height: 0;
}

/* When a modal doesn't use an explicit .modal-body wrapper, let the
   non-header child scroll so the fixed header stays pinned and tall
   forms (e.g. document upload with many fields) remain reachable. */
.modal-content > :not(.modal-header):not(.modal-footer) {
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow: visible;
  min-height: 200px;
}

.modal-footer {
  flex: 0 0 auto;
  width: 100%;
}

.modal-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.modal-search-section .search-input-wrapper {
  position: relative;
}

.modal-search-section .search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
}

.modal-search-section .search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-height: 350px;
  overflow-y: auto;
}

.modal-search-section .search-suggestions .search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

.modal-search-section .search-suggestions .search-result-item:last-child {
  border-bottom: none;
}

.modal-search-section .search-suggestions .search-result-item:hover {
  background: var(--bg-hover);
}

.modal-search-section .search-suggestions .search-result-item .asset-indicator,
.modal-search-section .search-suggestions .search-result-item .driver-indicator {
  width: 6px;
  height: 32px;
  border-radius: 3px;
  background: var(--color-success);
  flex-shrink: 0;
}

.modal-search-section .search-suggestions .search-result-item .result-info {
  flex: 1;
  min-width: 0;
}

.modal-search-section .search-suggestions .search-result-item .result-title {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.modal-search-section .search-suggestions .search-result-item .result-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-search-section .search-suggestions .search-result-item .result-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.modal-search-section .search-suggestions .search-result-item .result-badge.new-to-account {
  background: var(--color-info-bg, rgba(59, 130, 246, 0.1));
  color: var(--color-info, #3b82f6);
}

.modal-search-section .search-suggestions .search-result-item .result-badge.on-account {
  background: var(--color-success-bg, rgba(34, 197, 94, 0.1));
  color: var(--color-success, #22c55e);
}

.modal-search-section .search-suggestions .search-result-item--create {
  background: var(--bg-muted);
}

.modal-search-section .search-suggestions .search-result-item--create:hover {
  background: var(--bg-hover);
}

.modal-search-section .search-suggestions .search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.modal-search-section .search-suggestions .search-no-results p {
  margin: 0 0 16px;
}

.modal-form-section {
  animation: fadeIn 0.2s ease;
}

.modal-form-header {
  margin-bottom: 16px;
}

.modal-create-form .form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-create-form .form-group {
  flex: 1;
  min-width: 0;
}

.modal-create-form .form-group--wide {
  flex: 2;
}

.modal-create-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modal-create-form .form-control {
  width: 100%;
}

.modal-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Broker Search Results (shared between portal and admin) */
.portal-search-results__item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.portal-search-results__item:hover {
  background: var(--bg-hover);
}

.portal-search-results__name {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.portal-search-results__detail {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 2px;
}

.portal-search-results__empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.portal-search-results__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.portal-selected-broker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.portal-selected-broker__name {
  font-weight: 500;
  color: var(--text-primary);
}

.portal-selected-broker__address {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Confirm Modal Styles */
.modal-dialog--confirm {
  max-width: 400px;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.modal-dialog--confirm .modal-content {
  padding: 0;
}

.modal-dialog--confirm .modal-header {
  padding: 20px 24px 0;
  border-bottom: none;
}

.modal-dialog--confirm .modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-dialog--confirm .modal-body {
  padding: 12px 24px 24px;
}

.modal-dialog--confirm .confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.modal-dialog--confirm .modal-footer {
  padding: 16px 24px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-content--narrow {
  max-width: 440px;
}

.modal-lead {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.modal-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
}

.modal-checklist__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-checklist__item svg {
  flex-shrink: 0;
  color: var(--color-success);
}

.modal-checklist__item strong {
  color: var(--text-primary);
  font-weight: 500;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-footer .btn {
  min-width: 100px;
}

.modal-footer form {
  margin: 0;
}

/* Inline add section on quote selection */
.add-inline-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.add-inline-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.add-inline-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.add-inline-search .search-input-wrapper {
  position: relative;
  max-width: 500px;
}

.add-inline-search .search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
}

.add-inline-search .search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
}

.add-inline-form {
  animation: fadeIn 0.2s ease;
}

.add-inline-form .form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.add-inline-form .form-header h3 {
  margin: 0;
}

.inline-create-form .form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.inline-create-form .form-group {
  flex: 1;
  min-width: 0;
}

.inline-create-form .form-group--wide {
  flex: 2;
}

.inline-create-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.inline-create-form .form-control {
  width: 100%;
}

.inline-create-form .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Badge styles for search results */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--status-intake);
}

.badge-secondary {
  background: rgba(156, 163, 175, 0.2);
  color: var(--text-secondary);
}

.badge--sm {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 6px;
  vertical-align: middle;
  font-weight: 600;
}

.ml-1 {
  margin-left: 4px;
}

/* Rate display in proposal */
.data-value--sm {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Empty state enhancement */
.empty-state-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Asset search suggestions styling */
.asset-search__suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.asset-search__suggestion:hover {
  background: var(--bg-hover);
}

.asset-search__suggestion--new {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.asset-search__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.asset-search__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asset-search__name {
  font-weight: 500;
  color: var(--text-primary);
}

.asset-search__subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.asset-search__action {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.asset-search__empty {
  padding: 20px;
  text-align: center;
}

.asset-search__empty p {
  margin: 0 0 12px;
  color: var(--text-secondary);
}

/* Section actions (multiple buttons in header) */
.section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Selection toolbar */
.selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.selection-toolbar__left,
.selection-toolbar__right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Import form inline */
.import-form-inline {
  display: inline-flex;
}

.import-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Selection item states */
.selection-item--selected {
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-sm);
}

/* Selection search */
.selection-search {
  margin-bottom: 12px;
}
.selection-search__input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}
.selection-search__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.selection-search__empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-style: italic;
}

/* Import instructions */
.import-instructions {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.import-instructions h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.import-instructions ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.import-instructions li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.import-instructions p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.import-note {
  padding: 10px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--status-intake);
}

/* Import errors display */
.import-errors {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-danger);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 24px;
}

.import-errors h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--accent-danger);
}

.import-errors ul {
  margin: 0;
  padding-left: 20px;
}

.import-errors li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Alert boxes */
.alert {
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.alert h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
}

.alert ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

.alert li {
  font-size: 13px;
  margin-bottom: 4px;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--accent-warning);
}

.alert-warning h4 {
  color: var(--accent-warning);
}

.alert-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin: 8px 0 0;
}

/* Empty state actions */
.empty-state-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.item-row__link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.item-row--clickable {
  cursor: pointer;
}

/* Column empty states */
.column-empty-text {
  font-size: 12px;
  color: var(--text-muted);
}

.column-empty-prompt {
  text-align: center;
  padding: 20px;
}

.column-empty-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Discovery insights */
.discovery-insights {
  margin-top: 16px;
}

/* Data value empty state */
.data-value-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* Card date in list */
.card-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* DQ Card system (legacy support) */
.dq-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dq-card--allow-overflow {
  overflow: visible;
}

.dq-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.dq-card-title {
  font-size: 14px;
  font-weight: 600;
}

.dq-quote-list-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

/* Snapshot system (for company quotes table) */
.snapshot-table-wrapper {
  overflow-x: auto;
}

.snapshot-table {
  width: 100%;
  border-collapse: collapse;
}

.snapshot-table th,
.snapshot-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.snapshot-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.snapshot-table-td--lines {
  max-width: 200px;
}

.snapshot-table-td--actions,
.snapshot-table-th--actions {
  text-align: right;
  width: 60px;
}

.snapshot-status-badge {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.snapshot-menu {
  position: relative;
}

.snapshot-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.snapshot-menu-trigger:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.snapshot-menu-trigger--primary {
  background: var(--accent-primary);
  color: #000;
}

.snapshot-menu-trigger--subtle {
  opacity: 0.5;
}

.snapshot-menu-trigger--subtle:hover {
  opacity: 1;
}

.snapshot-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 140px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 50;
  overflow: hidden;
}

.snapshot-dropdown--fixed {
  position: absolute;
}

.snapshot-dropdown-item {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  transition: background var(--duration-fast);
}

.snapshot-dropdown-item:hover {
  background: var(--bg-hover);
}

.snapshot-dropdown-item--danger {
  color: var(--accent-danger);
}

.snapshot-row-menu {
  position: relative;
}
/* ==========================================================================
   VIEW TRANSITIONS (Fizzy-style)
   Browser-native page transitions for Turbo navigations
   ========================================================================== */

/* Customize the default cross-fade */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 150ms;
  animation-timing-function: var(--ease-out);
}

/* Old view holds steady while new fades in on top — prevents black flash */
::view-transition-old(root) {
  animation: none;
  opacity: 1;
}

::view-transition-new(root) {
  animation-name: fade-in;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS (Fizzy-style)
   ========================================================================== */

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

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

@keyframes slide-up {
  from { transform: translateY(1rem); }
  to { transform: translateY(0); }
}

@keyframes slide-up-fade-in {
  from { 
    transform: translateY(1rem); 
    opacity: 0; 
  }
  to { 
    transform: translateY(0); 
    opacity: 1; 
  }
}

@keyframes slide-down {
  from { transform: translateY(0); }
  to { transform: translateY(1rem); }
}

@keyframes scale-in {
  from { 
    transform: scale(0.95); 
    opacity: 0; 
  }
  to { 
    transform: scale(1); 
    opacity: 1; 
  }
}

@keyframes scale-out {
  from { 
    transform: scale(1); 
    opacity: 1; 
  }
  to { 
    transform: scale(0.95); 
    opacity: 0; 
  }
}

@keyframes pop-in {
  from { 
    transform: scale(0.2); 
    opacity: 0; 
  }
  to { 
    transform: scale(1); 
    opacity: 1; 
  }
}

/* ==========================================================================
   DIALOG ANIMATIONS (Fizzy-style with @starting-style)
   Modern CSS discrete transitions for dialogs
   ========================================================================== */

/* Typed confirm modal with smooth open/close */
.typed-confirm-modal__content,
.arrangement-confirm-dialog__content {
  animation: pop-in var(--dialog-duration) var(--ease-out-overshoot-subtle);
}

/* Card hover lift effect - exclude detail cards */
.card:not(.card--detail) {
  transition: 
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.card:not(.card--detail):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Smooth filter transitions */
.board-filter {
  transition: opacity var(--duration-normal) var(--ease-out);
}
/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn svg {
  flex-shrink: 0;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent-primary) 85%, white);
}

.btn-primary:disabled,
.btn-primary.btn-loading {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: wait;
  opacity: 0.7;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.btn-danger {
  background: var(--accent-danger);
  color: white;
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--accent-danger) 85%, white);
}

.btn-success {
  background: var(--accent-success);
  color: white;
}

.btn-success:hover {
  background: color-mix(in srgb, var(--accent-success) 85%, white);
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-with-icon svg {
  flex-shrink: 0;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Button Group - inline buttons */
.btn-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Disabled button styling */
.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Portal Button Variants */
.btn--outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn--outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn--block {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.btn-icon:hover { opacity: 1; }
.btn-icon--danger:hover { color: var(--accent-danger, #ef4444); }

.btn-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xs);
  opacity: 0.8;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px;
}

.form-section {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.form-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-row-3 {
  grid-template-columns: 1fr 100px 120px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Standalone form groups (not in form-row) need bottom margin */
.form-group:not(.form-row .form-group) {
  margin-bottom: 16px;
}

/* Wrapper divs with controllers should have spacing */
[data-controller] + .form-row,
[data-controller] + .form-group,
[data-controller] + [data-controller] {
  margin-top: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-input--readonly {
  background: var(--bg-secondary);
  cursor: default;
  opacity: 0.8;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

/* Inline form select - smaller for use within data displays */
.form-select--inline {
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  min-width: 200px;
}

/* Compact form select - for use in quote cards and tight spaces */
.form-select--compact {
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  min-width: 160px;
  width: auto;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

/* Pill buttons - inline clickable toggle buttons */
.pill-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-buttons--compact {
  gap: 4px;
}

.pill-button {
  display: inline-block;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

.pill-button button,
button.pill-button {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-family: inherit;
  white-space: nowrap;
}

.pill-buttons--compact .pill-button button,
.pill-buttons--compact button.pill-button {
  padding: 3px 8px;
  font-size: 10px;
}

.pill-button button:hover,
button.pill-button:hover {
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-subtle));
  color: var(--text-secondary);
}

.pill-button--active button,
button.pill-button--active {
  background: color-mix(in srgb, var(--accent-primary) 15%, var(--bg-surface));
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.pill-button--active button:hover,
button.pill-button--active:hover {
  background: color-mix(in srgb, var(--accent-primary) 20%, var(--bg-surface));
}

/* Market selector in data items */
.data-item--market {
  flex: 1;
}

.data-item--market .data-value {
  display: flex;
  align-items: center;
}

.market-selector-form {
  display: inline-flex;
  max-width: 100%;
}

.market-selector-form .form-select--compact {
  max-width: 100%;
  text-overflow: ellipsis;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-hint--warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: var(--warning-subtle, #fef3c7);
  border-radius: var(--radius-sm);
  color: var(--warning-text, #92400e);
  font-size: 13px;
  line-height: 1.4;
}

.form-hint--warning svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Shared autocomplete menu for system-backed text inputs */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.autocomplete-suggestion {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.autocomplete-suggestion:last-child {
  border-bottom: 0;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion:focus {
  outline: none;
  background: var(--bg-hover, #f8fafc);
}

.autocomplete-suggestion--create {
  background: color-mix(in srgb, var(--accent-primary) 7%, var(--bg-elevated));
}

.autocomplete-suggestion--create .autocomplete-suggestion__name {
  color: var(--accent-primary);
}

.autocomplete-suggestion--error {
  cursor: default;
}

.autocomplete-suggestion--error:hover {
  background: transparent;
}

.autocomplete-suggestion__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.autocomplete-suggestion__meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Bulk items section */
.bulk-items-section {
  margin-bottom: 16px;
}

.bulk-items-section[hidden] {
  display: none !important;
}

.bulk-items-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.bulk-items-loading[hidden] {
  display: none !important;
}

/* Bulk endorsement search UI */
.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  padding: 4px 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
}

.search-suggestions[hidden] {
  display: none !important;
}

.search-suggestions-empty {
  padding: 12px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.search-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--duration-fast);
}

.search-suggestion:hover {
  background: var(--bg-surface);
}

.search-suggestion--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.search-suggestion--disabled:hover {
  background: transparent;
}

.search-suggestion__name {
  font-size: 14px;
  color: var(--text-primary);
}

.search-suggestion__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-suggestion__title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.search-suggestion__subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-suggestion__status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-weight: 500;
}

.search-suggestion__status--all {
  background: var(--bg-success-subtle);
  color: var(--text-success);
}

.search-suggestion__status--none {
  background: var(--bg-warning-subtle);
  color: var(--text-warning);
}

.search-suggestion__status--partial {
  background: var(--bg-info-subtle);
  color: var(--text-info);
}

/* Selected items list */
.selected-items-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.selected-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.selected-item__name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.selected-item__title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.selected-item__subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.selected-item__type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.selected-item__policies {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.selected-item__detail {
  font-size: 12px;
  color: var(--text-secondary);
}

.selected-item__remove {
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-danger);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background var(--duration-fast);
}

.selected-item__remove:hover {
  background: var(--bg-danger-subtle);
}

/* Asset selected item — expanded with editable fields */
.selected-item--asset {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.selected-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.selected-item__header .selected-item__info {
  text-align: left;
}

.selected-item__header .selected-item__info strong {
  display: block;
  margin-bottom: 2px;
}

.selected-item__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.selected-item__field {
  display: flex;
  flex-direction: column;
}

.selected-item__field--full {
  grid-column: 1 / -1;
}

.selected-item__field .form-label--tight {
  display: block;
  margin-bottom: 4px;
}

.input-with-prefix--sm {
  display: flex;
  align-items: stretch;
}

.input-with-prefix--sm .input-prefix {
  padding: 4px 8px;
  font-size: 13px;
  min-width: 28px;
}

.input-with-prefix--sm .form-input,
.input-with-prefix--sm .form-input--sm {
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: none;
  flex: 1;
  min-width: 0;
}

.form-input-file {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-input-file::file-selector-button {
  padding: 8px 16px;
  margin-right: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.form-input-file::file-selector-button:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

/* Input with prefix (e.g., $ for currency) */
.input-with-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  min-width: 36px;
  justify-content: center;
}

.input-with-prefix .form-input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: none;
  flex: 1;
  min-width: 0;
}

.input-with-prefix .form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: none;
}

.input-with-prefix:focus-within .input-prefix {
  border-color: var(--accent-primary);
}

/* Input with suffix (e.g., % for percentage) */
.input-with-suffix {
  display: flex;
  align-items: stretch;
}

.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  min-width: 36px;
  justify-content: center;
}

.input-with-suffix .form-input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
  flex: 1;
  min-width: 0;
}

.input-with-suffix .form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: none;
}

.input-with-suffix:focus-within .input-suffix {
  border-color: var(--accent-primary);
}

/* Utility: Hidden */
.hidden {
  display: none !important;
}

/* VIN Lookup */
.vin-input-wrapper {
  position: relative;
}

.vin-input-wrapper .form-input {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 16px;
  letter-spacing: 1px;
}

.vin-decode-btn {
  margin-top: 6px;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
}

.vin-status {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.vin-status--loading {
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.vin-status--success {
  color: var(--status-bound);
  background: rgba(16, 185, 129, 0.1);
}

.vin-status--error {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.vin-status--warning {
  color: var(--accent-warning);
  background: rgba(245, 158, 11, 0.1);
}

/* ==========================================================================
   DRIVER SEARCH - Typeahead autocomplete for adding drivers
   ========================================================================== */

.driver-search {
  max-width: 100%;
}

.driver-search__search {
  position: relative;
}

.driver-search__search.hidden {
  display: none;
}

.driver-search__input {
  width: 100%;
  font-size: 16px;
  padding: 14px 16px;
}

.driver-search__suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
  max-height: 320px;
  overflow-y: auto;
}

.driver-search__suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  transition: background var(--duration-fast) var(--ease-out);
}

.driver-search__suggestion:hover {
  background: var(--bg-hover);
}

.driver-search__suggestion:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.driver-search__suggestion--new {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
}

.driver-search__suggestion--new:hover {
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-surface));
}

.driver-search__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.driver-search__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.driver-search__name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-search__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-search__warning {
  font-size: 11px;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--accent-warning) 20%, transparent);
  color: var(--accent-warning);
  border-radius: var(--radius-sm);
  margin-left: 8px;
}

.driver-search__empty {
  padding: 24px;
  text-align: center;
}

.driver-search__empty p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

.driver-search__selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-surface));
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.driver-search__selected-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.driver-search__selected-info strong {
  font-size: 16px;
}

.driver-search__selected-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

.driver-search__action {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-primary);
  margin-left: auto;
  flex-shrink: 0;
}

.driver-search__back {
  margin-bottom: 16px;
}

.driver-search .form-hint {
  font-size: 13px;
  margin-top: 8px;
}

/* --- Dual inline fields (e.g., UM/UIM per person / per accident) --- */
.form-inline-field--dual {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-inline-separator {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

/* --- Contact-Driver Link (inline in contact form) --- */
.contact-driver-link__search {
  position: relative;
}

.contact-driver-link__linked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 30%, transparent);
  border-radius: var(--radius-md);
}

.contact-driver-link__linked-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.contact-driver-link__linked-icon {
  color: var(--accent-primary);
  display: flex;
}

.contact-driver-link__new-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* -----------------------------------------------------------------------------
   VEHICLE SEARCH - Typeahead autocomplete for adding vehicles
   (mirrors driver-search styles)
----------------------------------------------------------------------------- */

.vehicle-search {
  position: relative;
}

.vehicle-search__search {
  position: relative;
}

.vehicle-search__search.hidden {
  display: none;
}

.vehicle-search__input {
  width: 100%;
}

.vehicle-search__suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
  max-height: 320px;
  overflow-y: auto;
}

.vehicle-search__suggestion {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.vehicle-search__suggestion:hover {
  background: var(--bg-hover, #2c2c32);
}

.vehicle-search__suggestion:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle, #333338);
}

.vehicle-search__suggestion--new {
  background: var(--bg-elevated, #242429);
  border-top: 2px solid var(--border-default, #44444a);
}

.vehicle-search__suggestion--new:hover {
  background: var(--bg-hover, #2c2c32);
}

.vehicle-search__suggestion--exists {
  opacity: 0.6;
}

.vehicle-search__icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.vehicle-search__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vehicle-search__name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-search__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-search__warning {
  padding: 16px;
  background: var(--accent-warning, #f59e0b);
  color: var(--text-primary, #0f172a);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vehicle-search__empty {
  padding: 16px;
  text-align: center;
}

.vehicle-search__empty p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.vehicle-search__vin-warning {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-warning);
  border-radius: 6px;
  font-size: 14px;
}

.vehicle-search__empty button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vehicle-search__back {
  margin-bottom: 16px;
}

.vehicle-search__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--text-secondary);
}

/* Asset Search (alias for vehicle-search) */
.asset-search { position: relative; }
.asset-search__search { position: relative; }
.asset-search__search.hidden { display: none; }
.asset-search__input { width: 100%; }
.asset-search__suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
  max-height: 320px;
  overflow-y: auto;
}
.asset-search__suggestion {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.asset-search__suggestion:hover { background: var(--bg-hover, #2c2c32); }
.asset-search__suggestion:not(:last-child) { border-bottom: 1px solid var(--border-subtle, #333338); }
.asset-search__suggestion--new {
  background: var(--bg-elevated, #242429);
  border-top: 2px solid var(--border-default, #44444a);
}
.asset-search__suggestion--new:hover { background: var(--bg-hover, #2c2c32); }
.asset-search__suggestion--exists { opacity: 0.6; }
.asset-search__icon { color: var(--text-muted); flex-shrink: 0; }
.asset-search__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.asset-search__name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-search__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-search__warning {
  padding: 16px;
  background: var(--accent-warning, #f59e0b);
  color: var(--text-primary, #0f172a);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.asset-search__empty { padding: 16px; text-align: center; }
.asset-search__empty p { margin-bottom: 12px; color: var(--text-secondary); }
.asset-search__vin-warning {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-warning);
  border-radius: 6px;
  font-size: 14px;
}
.asset-search__empty button:disabled { opacity: 0.5; cursor: not-allowed; }
.asset-search__back { margin-bottom: 16px; }
.asset-search__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--text-secondary);
}

.vehicle-search__loading .spinner {
  width: 20px;
  height: 20px;
}

.vehicle-search .form-hint {
  font-size: 13px;
  margin-top: 8px;
}

.form-file-current {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.form-file-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-file-link {
  font-size: 13px;
  color: var(--accent-primary);
}

.form-file-link:hover {
  text-decoration: underline;
}

.form-checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  cursor: pointer;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.form-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-checkbox-group .form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-hint-inline {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* Toggle Switch */
.form-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.form-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-switch__track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-muted);
  border-radius: 12px;
  transition: background var(--duration-fast);
}

.form-switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--bg-base);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast);
}

.form-switch__input:checked + .form-switch__track {
  background: var(--accent-primary);
}

.form-switch__input:checked + .form-switch__track::after {
  transform: translateX(20px);
}

.form-switch__input:focus + .form-switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-switch__label {
  font-size: 14px;
  color: var(--text-primary);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.form-errors {
  background: color-mix(in srgb, var(--accent-danger) 10%, transparent);
  border: 1px solid var(--accent-danger);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.form-errors-title {
  font-weight: 600;
  color: var(--accent-danger);
  margin: 0 0 8px 0;
}

.form-errors-list {
  margin: 0;
  padding-left: 18px;
  color: var(--accent-danger);
  font-size: 13px;
}

/* ==========================================================================
   CARGO PROFILE SELECTOR
   Category chips and item selection for Dynamic App cargo distribution
   ========================================================================== */

/* Category chip colors matching the screenshot */
.cargo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cargo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.cargo-chip__remove {
  font-size: 14px;
  opacity: 0;
  margin-left: 2px;
  transition: opacity var(--duration-fast);
}

.cargo-chip.selected {
  border-color: var(--accent-primary);
}

.cargo-chip.selected .cargo-chip__remove {
  opacity: 0.6;
}

.cargo-chip:hover .cargo-chip__remove {
  opacity: 1;
}

/* Chip color variants */
.cargo-chip--blue {
  background: #dbeafe;
  color: #1e40af;
}

.cargo-chip--yellow {
  background: #fef3c7;
  color: #92400e;
}

.cargo-chip--gray {
  background: #f3f4f6;
  color: #374151;
}

.cargo-chip--green {
  background: #d1fae5;
  color: #065f46;
}

.cargo-chip--orange {
  background: #ffedd5;
  color: #9a3412;
}

.cargo-chip--purple {
  background: #ede9fe;
  color: #5b21b6;
}

.cargo-chip--teal {
  background: #ccfbf1;
  color: #115e59;
}

.cargo-chip--pink {
  background: #fce7f3;
  color: #9d174d;
}

.cargo-chip--cyan {
  background: #cffafe;
  color: #155e75;
}

.cargo-chip--indigo {
  background: #e0e7ff;
  color: #3730a3;
}

.cargo-chip.selected {
  box-shadow: 0 0 0 2px var(--accent-primary);
}

/* Category items container */
.cargo-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.cargo-category {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: hidden;
}

.cargo-category__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.cargo-category__items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Radio card - selectable option cards */
.form-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.form-radio-card:hover {
  background: var(--bg-hover);
}

.form-radio-card:has(.form-radio-card__input:checked) {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}

.form-radio-card__input {
  margin-top: 3px;
  accent-color: var(--accent-primary);
}

.form-radio-card__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-radio-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-radio-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.form-group-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin: 16px 0 6px;
}
.form-group-heading:first-child {
  margin-top: 0;
}

/* Read-only field display (for values that shouldn't be edited here) */
.form-static-value {
  padding: 8px 12px;
  background: var(--bg-muted, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  font-size: 14px;
  color: var(--text-primary);
}

.form-static-value .form-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-not_now { background: color-mix(in srgb, var(--status-not-now) 20%, transparent); color: var(--status-not-now); }
.badge-intake { background: color-mix(in srgb, var(--status-intake) 20%, transparent); color: var(--status-intake); }
.badge-with_underwriters { background: color-mix(in srgb, var(--status-underwriters) 20%, transparent); color: var(--status-underwriters); }
.badge-quoted { background: color-mix(in srgb, var(--status-quoted) 20%, transparent); color: var(--status-quoted); }
.badge-presented { background: color-mix(in srgb, var(--status-presented) 20%, transparent); color: var(--status-presented); }
.badge-bound { background: color-mix(in srgb, var(--status-bound) 20%, transparent); color: var(--status-bound); }
.badge-not_taken { background: color-mix(in srgb, var(--status-not-taken) 20%, transparent); color: var(--status-not-taken); }

/* Proposal status badges */
.badge-draft { background: color-mix(in srgb, var(--status-not-now) 20%, transparent); color: var(--status-not-now); }
.badge-sent { background: color-mix(in srgb, var(--status-intake) 20%, transparent); color: var(--status-intake); }
.badge-accepted { background: color-mix(in srgb, var(--status-bound) 20%, transparent); color: var(--status-bound); }
.badge-declined { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }
.badge-no-markets { background: color-mix(in srgb, var(--status-not-taken) 20%, transparent); color: var(--status-not-taken); }

/* Discovery session badges */
.badge-pending { background: color-mix(in srgb, var(--status-underwriters) 20%, transparent); color: var(--status-underwriters); }
.badge-transcribing { background: color-mix(in srgb, var(--status-intake) 20%, transparent); color: var(--status-intake); }
.badge-ready { background: color-mix(in srgb, var(--status-bound) 20%, transparent); color: var(--status-bound); }
.badge-failed { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }
.badge-default { background: var(--bg-elevated); color: var(--text-muted); }

/* Generic badge modifiers (BEM style) */
.badge--success { background: color-mix(in srgb, var(--accent-success) 15%, transparent); color: var(--accent-success); }
.badge--warning { background: color-mix(in srgb, var(--accent-warning) 15%, transparent); color: var(--accent-warning); }
.badge--danger { background: color-mix(in srgb, var(--accent-danger) 15%, transparent); color: var(--accent-danger); }
.badge--info { background: color-mix(in srgb, var(--accent-primary) 15%, transparent); color: var(--accent-primary); }
.badge--neutral { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-default); }
.badge--muted { background: var(--bg-elevated); color: var(--text-muted); font-size: 12px; padding: 2px 8px; }

/* Policy status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.status-badge--processing { background: color-mix(in srgb, var(--status-underwriters) 20%, transparent); color: var(--status-underwriters); }
.status-badge--active { background: color-mix(in srgb, var(--accent-success) 20%, transparent); color: var(--accent-success); }
.status-badge--renew { background: color-mix(in srgb, var(--accent-warning) 20%, transparent); color: var(--accent-warning); }
.status-badge--expired { background: color-mix(in srgb, var(--text-muted) 18%, transparent); color: var(--text-secondary); border: 1px solid color-mix(in srgb, var(--text-muted) 30%, transparent); }
.status-badge--cancelled { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }
.status-badge--noic { background: color-mix(in srgb, var(--accent-warning) 20%, transparent); color: var(--accent-warning); }
.status-badge--noc { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }

/* Quote status badges */
.status-badge--not_now { background: color-mix(in srgb, var(--status-not-now) 20%, transparent); color: var(--status-not-now); }
.status-badge--with_underwriters { background: color-mix(in srgb, var(--status-underwriters) 20%, transparent); color: var(--status-underwriters); }
.status-badge--quoted { background: color-mix(in srgb, var(--status-quoted) 20%, transparent); color: var(--status-quoted); }
.status-badge--presented { background: color-mix(in srgb, var(--status-presented) 20%, transparent); color: var(--status-presented); }
.status-badge--bound { background: color-mix(in srgb, var(--status-bound) 20%, transparent); color: var(--status-bound); }
.status-badge--not_taken { background: color-mix(in srgb, var(--status-not-taken) 20%, transparent); color: var(--status-not-taken); }
.status-badge--ready_for_markets { background: color-mix(in srgb, var(--status-quoted) 20%, transparent); color: var(--status-quoted); }

/* Market submission status badges */
.status-badge--not_sent,
.status-badge--no_markets { background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-secondary); border: 1px solid color-mix(in srgb, var(--text-muted) 30%, transparent); }
.status-badge--missing_data { background: color-mix(in srgb, var(--accent-warning) 18%, transparent); color: var(--accent-warning); border: 1px solid color-mix(in srgb, var(--accent-warning) 35%, transparent); }
.status-badge--submitted,
.status-badge--sent,
.status-badge--under_review { background: color-mix(in srgb, var(--status-underwriters) 18%, transparent); color: var(--status-underwriters); }
.status-badge--received,
.status-badge--shared { background: color-mix(in srgb, var(--status-presented) 18%, transparent); color: var(--status-presented); }
.status-badge--declined,
.status-badge--blocked_by_us,
.status-badge--blocked_by_agent { background: color-mix(in srgb, var(--accent-danger) 16%, transparent); color: var(--accent-danger); }

/* Endorsement status badges */
.status-badge--draft { background: color-mix(in srgb, var(--status-draft) 20%, transparent); color: var(--status-draft); }
.status-badge--intake { background: color-mix(in srgb, var(--status-intake) 20%, transparent); color: var(--status-intake); }
.status-badge--pending { background: color-mix(in srgb, var(--status-pending-bg) 20%, transparent); color: var(--status-pending); }
.status-badge--processing { background: color-mix(in srgb, var(--status-underwriters) 20%, transparent); color: var(--status-underwriters); }
.status-badge--on_hold { background: color-mix(in srgb, var(--status-on-hold-bg) 20%, transparent); color: var(--status-on-hold); }
.status-badge--issued { background: color-mix(in srgb, var(--status-bound) 20%, transparent); color: var(--status-bound); }
.status-badge--void { background: color-mix(in srgb, var(--status-void) 20%, transparent); color: var(--status-void); }

/* Processing progress badges (used on processing board) */
.status-badge--in-take { background: color-mix(in srgb, var(--status-intake) 20%, transparent); color: var(--status-intake); }
.status-badge--waiting-on-insured { background: color-mix(in srgb, var(--status-waiting-on-insured-bg) 20%, transparent); color: var(--status-waiting-on-insured); }
.status-badge--submitted { background: color-mix(in srgb, var(--status-submitted-bg) 20%, transparent); color: var(--status-submitted); }
.status-badge--escalated { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }
.status-badge--closed { background: color-mix(in srgb, var(--status-closed) 20%, transparent); color: var(--status-closed); }
.status-badge--resolved { background: color-mix(in srgb, var(--accent-success) 20%, transparent); color: var(--accent-success); }

/* Claim status badges */
.status-badge--open { background: color-mix(in srgb, var(--status-intake) 20%, transparent); color: var(--status-intake); }
.status-badge--on_going { background: color-mix(in srgb, var(--status-on-going-bg) 20%, transparent); color: var(--status-on-going); }
.status-badge--unknown { background: color-mix(in srgb, var(--status-unknown) 20%, transparent); color: var(--status-unknown); }

/* Endorsement type badges — neutral, no color coding */
.status-badge--new-business,
.status-badge--add-driver,
.status-badge--add-asset,
.status-badge--add-asset-and-driver,
.status-badge--add-coverage,
.status-badge--delete-driver,
.status-badge--delete-asset,
.status-badge--delete-asset-and-driver,
.status-badge--delete-coverage,
.status-badge--cancellation,
.status-badge--swap,
.status-badge--correction,
.status-badge--premium-adjustments,
.status-badge--mixed,
.status-badge--additional-insured,
.status-badge--binding { background: var(--bg-secondary, var(--bg-muted)); color: var(--color-text-secondary, var(--text-secondary)); }

/* Void endorsement row */
.data-table__row--void { opacity: 0.5; }

/* Policy driver/asset status badges */
.status-badge--excluded { background: color-mix(in srgb, var(--accent-danger) 15%, transparent); color: var(--accent-danger); border: 1px solid color-mix(in srgb, var(--accent-danger) 30%, transparent); }
.status-badge--terminated { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }
.status-badge--pending_add { background: color-mix(in srgb, var(--accent-primary) 20%, transparent); color: var(--accent-primary); }
.status-badge--pending_remove { background: color-mix(in srgb, var(--accent-warning) 20%, transparent); color: var(--accent-warning); }

/* Accounting status badges */
.status-badge--mga_pending,
.status-badge--mga-pending { background: color-mix(in srgb, var(--status-mga-pending) 20%, transparent); color: var(--status-mga-pending); }
.status-badge--no_charge,
.status-badge--no-charge { background: color-mix(in srgb, var(--status-not-now) 20%, transparent); color: var(--status-not-now); }
.status-badge--unpaid { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }
.status-badge--billed { background: color-mix(in srgb, var(--status-quoted) 20%, transparent); color: var(--status-quoted); }
.status-badge--direct { background: color-mix(in srgb, var(--status-presented) 20%, transparent); color: var(--status-presented); }
.status-badge--archived { background: color-mix(in srgb, var(--status-not-taken) 20%, transparent); color: var(--status-not-taken); }

/* Mileage report status badges */
.status-badge--reported { background: color-mix(in srgb, var(--status-intake) 20%, transparent); color: var(--status-intake); }
.status-badge--invoiced { background: color-mix(in srgb, var(--status-underwriters) 20%, transparent); color: var(--status-underwriters); }
.status-badge--paid { background: color-mix(in srgb, var(--accent-success) 20%, transparent); color: var(--accent-success); }
.status-badge--under-review { background: color-mix(in srgb, var(--status-quoted) 20%, transparent); color: var(--status-quoted); }
.status-badge--partially-paid { background: color-mix(in srgb, var(--accent-warning) 20%, transparent); color: var(--accent-warning); }
.status-badge--revised { background: color-mix(in srgb, var(--status-underwriters) 20%, transparent); color: var(--status-underwriters); }
.status-badge--adjusted { background: color-mix(in srgb, var(--status-presented) 20%, transparent); color: var(--status-presented); }
.status-badge--voided { background: color-mix(in srgb, var(--status-void) 20%, transparent); color: var(--status-void); }

.status-badge--sm {
  padding: 1px 7px;
  font-size: 11px;
}

.status-badge--large {
  padding: 4px 12px;
  font-size: 13px;
}

.status-badge--muted {
  background: var(--status-muted-bg);
  color: var(--status-muted);
}

.status-badge--inactive {
  background: var(--status-muted-bg);
  color: var(--status-muted);
}

.status-badge--success {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.status-badge--warning {
  background: color-mix(in srgb, var(--accent-warning) 20%, transparent);
  color: var(--accent-warning);
}

.status-badge--danger {
  background: color-mix(in srgb, var(--accent-danger) 20%, transparent);
  color: var(--accent-danger);
}

.archived-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

.archived-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentcolor;
  opacity: 0.65;
}

/* Filter Tabs - for status filtering */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.filter-tab--active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: var(--accent);
}

/* Admin Tabs - for settings navigation */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--duration-fast);
}

.admin-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.admin-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Status Actions - inline status buttons */
.status-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.status-actions__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-right: 8px;
}

.status-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.status-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.status-action-btn--active:hover { color: var(--accent-success); border-color: var(--accent-success); }
.status-action-btn--processing:hover { color: var(--status-underwriters); border-color: var(--status-underwriters); }
.status-action-btn--renew:hover { color: var(--accent-warning); border-color: var(--accent-warning); }
.status-action-btn--cancelled:hover { color: var(--accent-danger); border-color: var(--accent-danger); }
.status-action-btn--noic:hover { color: var(--accent-warning); border-color: var(--accent-warning); }
.status-action-btn--noc:hover { color: var(--accent-danger); border-color: var(--accent-danger); }

/* Detail List - key/value pairs in cards */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.detail-list__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-list__item:last-child {
  border-bottom: none;
}

.detail-list__item dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.detail-list__item dd {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  margin: 0;
}

.detail-list__item--form {
  align-items: center;
  gap: 16px;
}

.detail-list__item--form dd {
  flex: 1 1 280px;
  max-width: 420px;
  text-align: left;
}

.detail-list__item dd a {
  color: var(--accent-primary, #2563eb);
  text-decoration: none;
}

.detail-list__item dd a:hover {
  text-decoration: underline;
}

.detail-list--compact .detail-list__item {
  padding: 6px 0;
}

.detail-list--compact .detail-list__item dt,
.detail-list--compact .detail-list__item dd {
  font-size: 12px;
}

/* Coverage limit tags below coverage name */
.coverage-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.coverage-limit-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-muted, #f0f0f0);
  color: var(--text-secondary, #666);
  white-space: nowrap;
}

.coverage-limit-tag--accent {
  background: color-mix(in srgb, var(--accent-primary, #2563eb) 15%, transparent);
  color: var(--accent-primary, #2563eb);
  font-weight: 600;
}

/* Endorsement delta shown under premium amount */
.endorsement-delta {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

/* Info Grid — compact key/value pairs in a responsive grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px 24px;
}

.info-grid__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-grid__item--full {
  grid-column: 1 / -1;
}

.info-grid__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-grid__value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.info-grid__value a {
  color: var(--accent-primary, #2563eb);
  text-decoration: none;
}

.info-grid__value a:hover {
  text-decoration: underline;
}

.info-grid__fees {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Premium Total - highlighted premium display */
.premium-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  margin-bottom: 18px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
}

.premium-total__primary {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.premium-total__label {
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-secondary);
}

.premium-total__value {
  display: block;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 0;
  white-space: nowrap;
}

.premium-total__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  text-align: right;
}

.premium-total__delta,
.premium-total__meta {
  display: grid;
  gap: 2px;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.premium-total__delta strong,
.premium-total__meta strong {
  display: block;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.premium-total__delta.text-success,
.premium-total__delta.text-success strong {
  color: #15803d;
}

.premium-total__delta.text-danger,
.premium-total__delta.text-danger strong {
  color: #b91c1c;
}

.premium-reconciliation-warning {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin: 4px 0 24px;
  padding: 18px 20px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.35;
}

.premium-reconciliation-warning__icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: #f59e0b;
}

.premium-reconciliation-warning__body {
  display: grid;
  gap: 12px;
}

.premium-reconciliation-warning__body strong {
  color: #92400e;
  font-size: 17px;
}

.premium-reconciliation-warning__body dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.premium-reconciliation-warning__body div {
  display: grid;
  grid-template-columns: minmax(120px, auto) auto;
  justify-content: start;
  gap: 18px;
}

.premium-reconciliation-warning__body dt,
.premium-reconciliation-warning__body dd {
  margin: 0;
}

.premium-reconciliation-warning__body dt {
  color: #b45309;
  font-weight: 600;
}

.premium-reconciliation-warning__body dd {
  color: #92400e;
  font-weight: 700;
}

.premium-total--grand {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 10px;
  margin-bottom: 0;
  padding: 24px 0 0;
  background: transparent;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
}

.premium-total--grand .premium-total__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.premium-total--grand .premium-total__value {
  font-size: 36px;
}

@media (max-width: 520px) {
  .premium-total {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .premium-total__stack {
    align-items: flex-start;
    text-align: left;
  }

  .premium-total__value,
  .premium-total__delta,
  .premium-total__meta {
    white-space: normal;
  }

  .premium-total__value {
    font-size: 28px;
  }

  .premium-reconciliation-warning__body div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.premium-commission-note {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}
/* ==========================================================================
   CARDS - Quote Cards on Board
   Fizzy-style: Set --card-color and derive all other colors via color-mix()
   ========================================================================== */

.card {
  /* --card-color is set via inline style on each card element (Fizzy pattern) */
  --card-color: var(--status-intake);
  
  /* Derived colors using color-mix (Fizzy pattern) */
  --card-bg-color: color-mix(in srgb, var(--card-color) 8%, var(--bg-surface));
  --card-border-color: color-mix(in srgb, var(--card-color) 25%, var(--bg-surface));
  --card-text-color: color-mix(in srgb, var(--card-color) 85%, var(--text-primary));
  --card-accent-bg: color-mix(in srgb, var(--card-color) 15%, var(--bg-surface));
  
  position: relative;
  display: block;
  padding: 18px 22px 24px;
  background-color: var(--card-bg-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s var(--ease-out), background-color 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Status-colored cards — set --card-color so color-mix() derivations in .card work correctly */
.card--not_now        { --card-color: var(--status-not-now); }
.card--intake         { --card-color: var(--status-intake); }
.card--with_underwriters { --card-color: var(--status-underwriters); }
.card--quoted         { --card-color: var(--status-quoted); }
.card--presented      { --card-color: var(--status-presented); }
.card--bound          { --card-color: var(--status-bound); }
.card--not_taken      { --card-color: var(--status-not-taken); }
.card--void           { --card-color: var(--status-void); }

/* Endorsement / processing-policy status aliases */
.card--pending        { --card-color: var(--status-quoted); }
.card--processing     { --card-color: var(--status-underwriters); }
.card--on_hold        { --card-color: var(--status-not-now); }
.card--draft          { --card-color: var(--status-not-now); }
.card--issued         { --card-color: var(--status-bound); }
.card--closed         { --card-color: var(--status-bound); }
.card--escalated      { --card-color: var(--accent-danger); }
.card--submitted      { --card-color: var(--status-quoted); }

/* Accounting invoice status aliases (both underscore + hyphen for JS compat) */
.card--no_charge,
.card--no-charge      { --card-color: var(--status-not-now); }
.card--unpaid         { --card-color: var(--accent-danger); }
.card--mga_pending,
.card--mga-pending    { --card-color: var(--status-mga-pending); }
.card--billed         { --card-color: var(--status-quoted); }
.card--paid           { --card-color: var(--status-bound); }
.card--direct         { --card-color: var(--status-presented); }

/* Locked cards (finalized or voided - cannot be dragged) */
.card--locked {
  cursor: default;
}
.card--locked::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='%2394a3b8'%3E%3Cpath d='M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.5;
}

/* Processing board status cards — set --card-color for color-mix() derivation */
.card--in-take            { --card-color: var(--status-intake); }
.card--waiting-on-insured { --card-color: var(--status-underwriters); }
.card--submitted          { --card-color: var(--status-quoted); }
.card--escalated          { --card-color: var(--accent-danger); }
.card--closed             { --card-color: var(--status-bound); }

/* Dark mode card styles now handled automatically via OKLCH + color-mix() */
/* The --card-color variable + color-mix() derives appropriate bg/border */
/* for both light and dark modes without needing per-status overrides */

.card-link {
  display: block;
  -webkit-user-drag: none;
  /* Allow drag events to pass through to parent card */
  pointer-events: none;
}

/* Re-enable pointer events for actual clicking when not dragging */
.card:not(.arrangement-item--dragging) .card-link {
  pointer-events: auto;
}

/* Prevent nested elements from being drag targets */
.card img,
.card svg {
  -webkit-user-drag: none;
}

/* Card header row with Q-ID and client type */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.card-link--header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.card-quote-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 4px;
}

.card-client-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
  /* Fizzy-style: derive from --card-color */
  background: var(--card-accent-bg);
  color: var(--card-text-color);
}

.card-dot {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.card-dot::before {
  content: "· ";
}

/* Legacy status-specific client type colors - kept for backward compatibility */
/* These can be removed once all cards use style="--card-color: ..." */
.card--not_now .card-client-type {
  background: #e2e8f0;
  color: #475569;
}
.card--intake .card-client-type {
  background: #dbeafe;
  color: #1e40af;
}
.card--with_underwriters .card-client-type {
  background: #fef3c7;
  color: #92400e;
}
.card--quoted .card-client-type {
  background: #ede9fe;
  color: #5b21b6;
}
.card--presented .card-client-type {
  background: #fce7f3;
  color: #9d174d;
}
.card--bound .card-client-type {
  background: #d1fae5;
  color: #065f46;
}
.card--not_taken .card-client-type {
  background: #f3f4f6;
  color: #6b7280;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  /* Fizzy-style: derive from --card-color */
  background: var(--card-accent-bg);
  color: var(--card-text-color);
  border: 1px solid var(--card-border-color);
}

/* Legacy status-specific tag colors - kept for backward compatibility */
/* These can be removed once all cards use style="--card-color: ..." */
.card--not_now .card-tag {
  background: #e2e8f0;
  color: #475569;
  border-color: #94a3b8;
}
.card--intake .card-tag {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.card--with_underwriters .card-tag {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.card--quoted .card-tag {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}
.card--presented .card-tag {
  background: #fce7f3;
  color: #9d174d;
  border-color: #f9a8d4;
}
.card--bound .card-tag {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.card--not_taken .card-tag {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

/* Dark mode tag styles now handled via --card-color + color-mix() */

/* Processing/Risk Assessment board status tag colors - Light mode */
.card--in-take .card-tag {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.card--waiting-on-insured .card-tag {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.card--submitted .card-tag {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}
.card--escalated .card-tag {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.card--closed .card-tag {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

/* Processing/Risk Assessment board status tag colors - Dark mode */
[data-theme="dark"] .card--in-take .card-tag {
  background: #1e2530;
  color: #7dacf0;
  border-color: #2d3a4d;
}
[data-theme="dark"] .card--waiting-on-insured .card-tag {
  background: #262118;
  color: #d4a85a;
  border-color: #3d3428;
}
[data-theme="dark"] .card--submitted .card-tag {
  background: #231e2a;
  color: #b89cdc;
  border-color: #352d42;
}
[data-theme="dark"] .card--escalated .card-tag {
  background: #2a1e1e;
  color: #e87c7c;
  border-color: #3d2828;
}
[data-theme="dark"] .card--closed .card-tag {
  background: #1c2620;
  color: #6dc98a;
  border-color: #2d3d32;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-subtitle--address {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -8px;
  font-size: 12px;
}

.card-subtitle-icon {
  flex-shrink: 0;
  opacity: 0.6;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.card-meta {
  display: flex;
  gap: 12px;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-meta-item--positive {
  color: var(--accent-primary);
}

.card-meta-item--negative {
  color: var(--accent-danger);
}

.card-meta-item--warning {
  color: var(--accent-warning);
}

.card-checklist-progress {
  flex: 1;
  min-width: 60px;
  max-width: 120px;
}

.card-checklist-progress__bar {
  height: 4px;
  background: var(--border-default);
  border-radius: 2px;
  overflow: hidden;
}

.card-checklist-progress__fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.card-checklist-progress__fill--complete {
  background: var(--accent-success);
}

.card-timestamp {
  font-size: 12px;
  color: var(--text-muted);
}

.card-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-assignee {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #0d9488);
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-assignee--unassigned {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px dashed var(--border-default);
}

/* Coverage abbreviation pills on endorsement cards */
.card-coverage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.card-coverage-pill {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Company name link on board cards */
.card-company-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.card-company-link:hover {
  text-decoration: underline;
  color: var(--accent-primary-hover, #0b7f74);
}

/* Secondary card link area (below company name) */
.card-link--lower {
  display: block;
}

/* Card header menu (three-dot dropdown) */
.card-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.card-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast), background var(--duration-fast);
}

.card:hover .card-menu-btn,
.card-menu-btn:focus {
  opacity: 1;
}

.card-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.card-menu .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  min-width: 140px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}

/* button_to generates <form class="dropdown-item">…<button>…</button></form> */
.card-menu .dropdown-item {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

.card-menu .dropdown-item > button,
.card-menu .dropdown-item > a,
.card-menu a.dropdown-item,
.card-menu button.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}

.card-menu .dropdown-item > button:hover,
.card-menu .dropdown-item > a:hover,
.card-menu a.dropdown-item:hover,
.card-menu button.dropdown-item:hover {
  background: var(--bg-hover);
}

/* Card action buttons */
.card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.card-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 6px 12px;
}

/* ==========================================================================
   QUOTE CARDS INDEX VIEW
   ========================================================================== */

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header__nav {
  margin-bottom: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.back-link:hover {
  color: var(--accent-primary);
}

.page-header__main {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.page-header__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.page-header__count {
  font-size: 14px;
  color: var(--text-muted);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cards Grid (reusable for quote lists) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Badge outline variant */
.badge--outline {
  background: transparent;
  border: 1px solid currentColor;
}

/* Info List (for detail views) */
.info-list {
  display: grid;
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item dt {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.info-item dd {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
}

/* Activity Log */
.activity-log {
  padding: 16px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 50%;
  color: var(--text-secondary);
}

.activity-icon--created {
  background: rgba(13, 148, 136, 0.15);
  color: #0d9488;
}

.activity-icon--license,
.activity-icon--document {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.activity-icon--employment,
.activity-icon--linked {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.activity-icon--employment_end,
.activity-icon--status_change {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.activity-icon--quote {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-description {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
}
/* ==========================================================================
   BIND QUOTE MODAL - Shared modal for binding quotes to policies
   ========================================================================== */

.bind-quote-modal .modal-body {
  max-height: 65vh;
  overflow-y: auto;
}

/* Quote info header */
.bind-quote-info {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.bind-quote-info__primary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bind-quote-info__id {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.bind-quote-info__company {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.bind-quote-info__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Modal divider */
.modal-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

/* Modal section title */
.modal-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

/* Bind settings grid variants */
.bind-settings-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.bind-settings-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
  .bind-settings-grid--2col,
  .bind-settings-grid--3col {
    grid-template-columns: 1fr;
  }
}

/* Input with prefix - styles defined in main form styles section */

/* Readonly input style */
.form-input--readonly {
  background: var(--bg-muted);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Link button */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--accent-primary-hover);
}

/* Premium fields section */
.bind-quote-premium-fields {
  margin-top: 16px;
}

/* Collapsible details sections */
.bind-quote-details {
  margin-top: 12px;
}

.bind-quote-details__summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
  transition: all 0.15s ease;
}

.bind-quote-details__summary::-webkit-details-marker {
  display: none;
}

.bind-quote-details__summary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.bind-quote-details__summary svg {
  transition: transform 0.2s ease;
}

.bind-quote-details[open] .bind-quote-details__summary svg {
  transform: rotate(180deg);
}

.bind-quote-details__content {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-top: -1px;
}

/* File preview status variants */
.file-preview__status--error {
  color: var(--accent-danger);
}

/* Spinner animation for loading state */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Spinner */
.spinner--sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* ==========================================================================
   FULL SCREEN LOADING OVERLAY
   ========================================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.loading-overlay__logo {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  animation: loading-pulse 2s ease-in-out infinite;
}

.loading-overlay__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes loading-pulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.loading-overlay__spinner {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
}

.loading-overlay__spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--border-subtle, #e5e7eb);
  border-top-color: var(--accent-primary, #0d9488);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-overlay__spinner-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
}

.loading-overlay__spinner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loading-overlay__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 8px 0;
}

.loading-overlay__message {
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  margin: 0;
  text-align: center;
  max-width: 300px;
}

.loading-overlay__progress {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loading-overlay__progress-bar {
  width: 200px;
  height: 4px;
  background: var(--border-subtle, #e5e7eb);
  border-radius: 2px;
  overflow: hidden;
}

.loading-overlay__progress-fill {
  height: 100%;
  background: var(--accent-primary, #0d9488);
  border-radius: 2px;
  animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.loading-overlay__steps {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
}

.loading-overlay__step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-overlay__step--active {
  color: var(--accent-primary, #0d9488);
  font-weight: 500;
}

.loading-overlay__step--complete {
  color: var(--accent-success, #059669);
}

.loading-overlay__step-icon {
  width: 16px;
  height: 16px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .loading-overlay {
    background: rgba(17, 24, 39, 0.97);
  }
}

/* Alert Success */
.alert-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md, 8px);
  color: var(--text-primary);
}

.alert-success svg {
  color: #22c55e;
  flex-shrink: 0;
}

.alert-success .alert-link {
  color: #22c55e;
  text-decoration: none;
  font-weight: 500;
}

.alert-success .alert-link:hover {
  text-decoration: underline;
}

.data-grid--compact {
  gap: 8px;
}

.data-grid--compact .data-item {
  gap: 1px;
}

.data-grid--compact .data-label {
  font-size: 11px;
}

.data-grid--compact .data-value {
  font-size: 13px;
}

.card__stats {
  display: flex;
  gap: 24px;
}

.card__stat {
  text-align: center;
}

.card__stat--link {
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.card__stat--link:hover {
  background: var(--bg-elevated);
}

.card__stat-number {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.card__stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.card__stat-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card__stat-download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--duration-fast), color var(--duration-fast);
}

.card__stat-download:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.card__stat-download svg {
  flex-shrink: 0;
}

.card__empty {
  color: var(--text-muted);
  font-size: 14px;
}

/* Status selector */
.card__stages {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

/* Desktop/Mobile visibility */
.card__stages--mobile {
  display: none;
}

.card__column-name {
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.card__column-name:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.card__column-name--current {
  background: var(--accent-primary);
  color: white;
}

.card__column-name--current:hover {
  background: var(--accent-primary);
  color: white;
}

/* Status-specific current button colors */
.card__column-name--not_now.card__column-name--current {
  background: #94a3b8;
}
.card__column-name--intake.card__column-name--current {
  background: #3b82f6;
}
.card__column-name--with_underwriters.card__column-name--current {
  background: #f59e0b;
}
.card__column-name--quoted.card__column-name--current {
  background: #a855f7;
}
.card__column-name--presented.card__column-name--current {
  background: #ec4899;
}
.card__column-name--bound.card__column-name--current {
  background: #22c55e;
}
.card__column-name--not_taken.card__column-name--current {
  background: #6b7280;
}

/* Accounting invoice status colors */
.card__column-name--no_charge.card__column-name--current {
  background: #94a3b8;
}
.card__column-name--unpaid.card__column-name--current {
  background: #ef4444;
}
.card__column-name--mga_pending.card__column-name--current {
  background: #f97316;
}
.card__column-name--billed.card__column-name--current {
  background: #a855f7;
}
.card__column-name--paid.card__column-name--current {
  background: #22c55e;
}
.card__column-name--archived.card__column-name--current {
  background: #6b7280;
}

.card__footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid color-mix(in srgb, var(--card-color) 30%, var(--border-subtle));
}

/* Fizzy-style Status List (mobile card-in-card) */
.status-list {
  background: color-mix(in srgb, var(--card-color) 8%, var(--bg-base));
  border: 1px solid color-mix(in srgb, var(--card-color) 30%, var(--border-subtle));
  border-radius: var(--radius-md);
  overflow: hidden;
}

.status-list__item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--card-color) 15%, var(--border-subtle));
  color: var(--card-color);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.status-list__item:last-child {
  border-bottom: none;
}

.status-list__item:hover {
  background: color-mix(in srgb, var(--card-color) 12%, transparent);
}

.status-list__item--current {
  background: var(--card-color);
  color: #fff;
}

.status-list__item--current:hover {
  background: var(--card-color);
}

/* Mobile Fizzy-style action bar */
.mobile-action-group {
  display: flex;
  gap: 8px;
}

.mobile-action-group--center {
  gap: 12px;
}

.mobile-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--duration-fast);
}

.mobile-action-btn:hover,
.mobile-action-btn:active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mobile-action-btn--primary {
  background: var(--card-color);
  border-color: var(--card-color);
  color: #fff;
}

.mobile-action-btn--primary:hover,
.mobile-action-btn--primary:active {
  background: color-mix(in srgb, var(--card-color) 85%, white);
  border-color: color-mix(in srgb, var(--card-color) 85%, white);
  color: #fff;
}

.mobile-action-btn--success {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.mobile-action-btn--success:hover,
.mobile-action-btn--success:active {
  background: #16a34a;
  border-color: #16a34a;
}

.mobile-action-btn--muted {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-muted);
}

.mobile-action-btn--muted:hover,
.mobile-action-btn--muted:active {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* Mobile close button - top right of card */
.mobile-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all var(--duration-fast);
}

.mobile-close-btn:hover,
.mobile-close-btn:active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Fizzy-style assignment bar */
.card__assignment {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.card__assigned {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.card__assigned-divider {
  color: var(--text-muted);
  opacity: 0.5;
}

.card__assigned-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card__assigned-label {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--card-color);
}

.card__assigned-label strong {
  font-weight: 700;
}

.card__assigned-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--card-color);
}

.card__assigned-icon {
  color: var(--card-color);
}

.card__assigned--empty {
  opacity: 0.6;
}

/* Avatar variants for assignment */
.avatar--internal {
  background: var(--card-color);
  color: #000;
  font-weight: 700;
}

.avatar--contact {
  background: var(--bg-elevated);
  border: 2px solid var(--card-color);
  color: var(--text-primary);
}

.avatar--placeholder {
  background: var(--bg-elevated);
  border: 2px dashed var(--border-default);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Clickable contact link in footer */
.card__assigned--link {
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background var(--duration-fast);
}
.card__assigned--link:hover {
  background: color-mix(in srgb, var(--card-color) 10%, transparent);
}

/* Delete button in footer — icon-only, subtle */
.card__delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  align-self: stretch;
  margin: -8px 0;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.card__delete-btn:hover {
  background: color-mix(in srgb, var(--accent-danger) 12%, transparent);
  color: var(--accent-danger);
}

/* Legacy meta styles (keep for other uses) */
.card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card__meta-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* Bottom action bar */
.card-perma__notch {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding-bottom: 24px;
}

/* Hide mobile notch on desktop */
.card-perma__notch--mobile {
  display: none;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid color-mix(in srgb, var(--card-color) 40%, var(--border-default));
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-action:hover {
  background: color-mix(in srgb, var(--card-color) 15%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--card-color) 60%, var(--border-default));
}

.btn-action kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  font-size: 11px;
  padding: 0 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

.btn-action--primary {
  background: var(--card-color);
  border-color: var(--card-color);
  color: #fff;
}

.btn-action--primary:hover {
  background: color-mix(in srgb, var(--card-color) 85%, white);
}

/* ==========================================================================
   PROPOSAL SELECTOR MODAL
   ========================================================================== */

.proposal-selector-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.proposal-selector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--duration-fast);
}

.proposal-selector-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.proposal-selector-item__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proposal-selector-item__title {
  font-size: 14px;
  font-weight: 600;
}

.proposal-selector-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.proposal-selector-item__arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.proposal-selector-item:hover .proposal-selector-item__arrow {
  color: var(--accent-primary);
}

.btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
}

.empty-state--compact {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Payment flow modal ───────────────────────────────────────────── */

.payment-hero {
  text-align: center;
  margin-bottom: 20px;
}

.payment-hero__amount {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.payment-hero__label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.payment-method {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-family: inherit;
}

.payment-method:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.payment-method--active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-surface));
  font-weight: 600;
}

.payment-type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.payment-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  color: var(--text-primary);
}

.payment-type-card:hover {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 5%, var(--bg-surface));
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.payment-type-card__title {
  font-size: 15px;
  font-weight: 600;
}

.payment-type-card__desc {
  font-size: 12px;
  color: var(--text-muted);
}

.payment-type-cards--refund {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-type-cards--refund .payment-type-card {
  align-items: flex-start;
  min-height: 118px;
  padding: 16px;
  text-align: left;
}

.payment-type-cards--refund .payment-type-card svg {
  width: 22px;
  height: 22px;
}

.payment-type-cards--refund .payment-type-card__title {
  font-size: 14px;
}

.payment-type-cards--refund .payment-type-card__desc {
  line-height: 1.35;
}

@media (max-width: 720px) {
  .payment-type-cards,
  .payment-type-cards--refund {
    grid-template-columns: 1fr;
  }
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s;
  flex-shrink: 0;
}

.btn-back:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.file-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  border: 2px dashed var(--border-default);
  border-radius: 10px;
  background: var(--bg-elevated);
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
}

.file-dropzone[hidden] {
  display: none;
}

.file-dropzone--active {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 5%, var(--bg-elevated));
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  margin-top: 12px;
}

.file-preview[hidden] {
  display: none;
}

.parse-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.parse-loading-state[hidden] {
  display: none;
}

.parse-error {
  padding: 12px;
  background: color-mix(in srgb, var(--accent-danger) 10%, transparent);
  border-radius: 8px;
  color: var(--accent-danger);
  font-size: 13px;
  margin-top: 12px;
}

.parse-loading-state__icon {
  margin-bottom: 20px;
}

.parse-loading-state__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.parse-loading-state__desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Finance row in payments table ───────────────────────────────── */

.finance-row {
  border-top: 1px dashed var(--border-default);
}

.finance-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1.5px solid var(--border-default);
  border-radius: 5px;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.finance-toggle:hover {
  border-color: var(--accent-success);
  color: var(--accent-success);
  background: color-mix(in srgb, var(--accent-success) 8%, var(--bg-surface));
}

.finance-toggle--received {
  border-color: var(--accent-success);
  background: var(--accent-success);
  color: #fff;
}

.finance-toggle--received:hover {
  background: color-mix(in srgb, var(--accent-success) 80%, black);
  border-color: color-mix(in srgb, var(--accent-success) 80%, black);
  color: #fff;
}
/* ==========================================================================
   EMPTY STATES
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 32px 20px;
}

.empty-state-text {
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

/* ==========================================================================
   DATA DISPLAY
   ========================================================================== */

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.data-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.data-label {
  font-size: 12px;
  color: var(--text-muted);
}

.data-value {
  font-size: 14px;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

/* ==========================================================================
   FLASH MESSAGES - Toast Notifications
   ========================================================================== */

.flash {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
  animation: flashSlideIn 0.3s ease-out;
  max-width: 440px;
}

.flash--leaving {
  animation: flashSlideOut 0.25s ease-in forwards;
}

@keyframes flashSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes flashSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

.flash__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.flash__text {
  flex: 1;
  line-height: 1.4;
}

.flash__dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.flash__dismiss:hover {
  color: #fff;
}

.flash-notice {
  background: var(--status-bound);
  color: #fff;
  border: none;
}

.flash-alert {
  background: var(--accent-danger);
  color: #fff;
  border: none;
}

/* ==========================================================================
   AVATARS & CONTACTS
   ========================================================================== */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: white;
  background: var(--accent-primary);
}

.contact-avatars {
  display: flex;
}

.contact-avatars > * {
  margin-left: -8px;
}

.contact-avatars > *:first-child {
  margin-left: 0;
}

.contact-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: white;
  border: 2px solid var(--bg-surface);
  transition: transform var(--duration-fast);
}

.contact-avatar:hover {
  transform: scale(1.1);
  z-index: 1;
}

.contact-avatar--add {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border-default);
}

/* Avatar color variants */
.contact-avatar--1, .contacts-strip__avatar.contact-avatar--1 { background: #f59e0b; }
.contact-avatar--2, .contacts-strip__avatar.contact-avatar--2 { background: #0d9488; }
.contact-avatar--3, .contacts-strip__avatar.contact-avatar--3 { background: #3b82f6; }
.contact-avatar--4, .contacts-strip__avatar.contact-avatar--4 { background: #ec4899; }

/* Contact info next to avatars */
.contact-info {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 13px;
}

.contact-name {
  font-weight: 500;
  color: var(--text-primary);
}

.contact-role {
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW TABS - Tab switcher for in-page content switching
   ========================================================================== */

.view-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 8px;
  width: fit-content;
}

.view-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-tab:hover {
  color: #374151;
  background: #e5e7eb;
}

.view-tab--active {
  color: #111827;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-tab svg {
  opacity: 0.6;
}

.view-tab--active svg {
  opacity: 1;
}

.view-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #e5e7eb;
  border-radius: 10px;
}

.view-tab--active .view-tab__count {
  background: #3b82f6;
  color: white;
}

/* Tab content animations */
.tab-content {
  animation: tabFadeIn 0.2s ease;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ============================================
   Generic Dropdown
   ============================================ */

.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 50;
  overflow: hidden;
}

.dropdown-menu--right {
  left: auto;
  right: 0;
}

.dropdown-menu[hidden] {
  display: none;
}

.dropdown-menu .dropdown-item + .dropdown-item {
  border-top: 1px solid var(--border-subtle);
}

/* button_to generates <form class="dropdown-item"><input type="hidden">…<button>…</button></form> */
.dropdown-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

.dropdown-item input[type="hidden"] {
  display: none;
}

.dropdown-item > button,
.dropdown-item > a,
a.dropdown-item,
button.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  margin: 0;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast);
  text-decoration: none;
  line-height: 1.4;
}

.dropdown-item > button:hover,
.dropdown-item > a:hover,
a.dropdown-item:hover,
button.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item .badge {
  flex-shrink: 0;
}

.dropdown-item__count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==========================================================================
   ENDORSEMENT PICKER (accounting invoice creation)
   ========================================================================== */

.endorsement-picker__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.endorsement-picker__search {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-default);
  color: var(--text-primary);
  font-size: 13px;
}

.endorsement-picker__count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.endorsement-picker__company-group {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.endorsement-picker__company-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  font-size: 14px;
}

.endorsement-picker__policy-group {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.endorsement-picker__policy-header {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  font-size: 13px;
}

.endorsement-picker__policy-header--sub {
  padding: 6px 14px;
  background: var(--bg-default);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.endorsement-picker__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s;
}

.endorsement-picker__item:last-child {
  border-bottom: none;
}

.endorsement-picker__item:hover {
  background: var(--bg-hover);
}

.endorsement-picker__checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.endorsement-picker__details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.endorsement-picker__number {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.endorsement-picker__type {
  color: var(--text-secondary);
  white-space: nowrap;
}

.endorsement-picker__date {
  color: var(--text-muted);
  white-space: nowrap;
}

.endorsement-picker__ext-ref {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.endorsement-picker__amount {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.text-negative {
  color: var(--color-danger, #ef4444);
}

.form-section {
  margin-bottom: 24px;
}

.form-section__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.form-section__hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

.btn-sm {
  font-size: 12px;
  padding: 4px 10px;
}

/* Invoice flags (premium checkboxes) */
.invoice-flags {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-flags__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Invoice modal */
.invoice-modal-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(960px, 92vw);
  max-height: 88vh;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.invoice-modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.invoice-modal-content {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}

.invoice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.invoice-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.invoice-modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ==========================================================================
   COMMENTS
   ========================================================================== */

.comments-section {
  margin-top: 36px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 30px;
}

.comments-section--themed {
  background: color-mix(in srgb, var(--card-color, var(--accent-primary)) 8%, var(--bg-surface));
}

/* Themed button inside comments uses status color */
.comments-section--themed .btn-primary {
  background: var(--card-color);
  color: #fff;
}

.comments-section--themed .btn-primary:hover {
  background: color-mix(in srgb, var(--card-color) 85%, white);
}

.comments-header {
  margin-bottom: 16px;
}

.comments-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.comment {
  display: flex;
  gap: 12px;
}

.comment-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-body {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  font-size: 12px;
  color: var(--text-muted);
}

.comment-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.comment-content p {
  margin: 0 0 8px 0;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.comment-form {
  display: flex;
  gap: 12px;
}

.comment-form-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-form-input {
  flex: 1;
}

.comment-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: vertical;
  min-height: 80px;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.comment-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  margin-left: auto;
  align-self: center;
  line-height: 1;
}

.comment:hover .comment-edit-btn {
  opacity: 1;
}

.comment-edit-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-elevated);
}

.comment-edited {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.comment-edit-form {
  margin-top: 8px;
}

.comment-edit-form .comment-textarea {
  min-height: 60px;
}

.comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* Documents quick-actions bar */
.documents-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  margin-bottom: 16px;
}

.documents-bar__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: auto;
}

.documents-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s;
}

.documents-bar__link:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--bg-surface);
}

.documents-bar__link--active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.documents-bar__link svg {
  flex-shrink: 0;
}


/* ==========================================================================
   NOTES SECTION (always-visible composer card sitting above the timeline)
   ========================================================================== */

.notes-section {
  margin-top: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: visible;
}

.notes-section__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: inherit;
}

.notes-section__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.notes-section__body {
  padding: 16px 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: inherit;
}

/* ==========================================================================
   TIMELINE SECTION (collapsible feed of notes + system events)
   Uses design tokens so it matches the rest of the dashboard.
   ========================================================================== */

.timeline-section {
  margin-top: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.timeline-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms;
}

.timeline-section[data-disclosure-open-value="true"] .timeline-section__header {
  border-bottom-color: var(--border-subtle);
}

.timeline-section__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
}

.timeline-section__chevron {
  color: var(--text-muted);
  transform: rotate(-90deg);
  transition: transform 150ms;
}

.timeline-section[data-disclosure-open-value="true"] .timeline-section__chevron {
  transform: rotate(0deg);
}

.timeline-section__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.timeline-section__count.badge {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.timeline-section__filter {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-section__panel {
  padding: 20px 24px 24px;
}

.timeline-section__empty {
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  list-style: none;
}

/* The empty-state lives inside the timeline <ol> so it can be a stable
   Turbo Stream target; hide it automatically once a real note gets
   prepended in front of it so we don't show "No notes yet" above the
   note the user just posted. */
.timeline-feed > li:not([data-timeline-empty]) ~ .timeline-section__empty {
  display: none;
}
.timeline-feed:has(> li:not([data-timeline-empty])) > .timeline-section__empty {
  display: none;
}

/* Same trick for the legacy .comments-list container used on policies and
   risk issues: the #comments-list div is always rendered so Turbo Stream
   can append a new comment; the empty-state nested inside it must hide as
   soon as a real .comment lands, otherwise "No notes yet" renders above
   the note the user just posted. */
.comments-list > .comment ~ [data-comments-empty] {
  display: none;
}
.comments-list:has(> .comment) > [data-comments-empty] {
  display: none;
}

.timeline-section__composer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Override the connecting-line position so notes line up with the avatar */
.timeline-section .timeline-feed {
  list-style: none;
  margin: 0;
  padding-left: 24px;
}

.timeline-section .timeline-feed::before {
  left: 7px;
}

/* Note-style entries: avatar inline in the title row */
.timeline-entry--note .timeline-entry__heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-entry__heading {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-entry__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.timeline-entry--activity .timeline-entry__dot {
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

.timeline-entry--note .timeline-entry__dot {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 25%, var(--bg-surface));
}

.timeline-entry__system-badge.badge {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-entry__author {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   COMPOSER (note input)
   ========================================================================== */

.timeline-composer__form {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.timeline-composer__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.timeline-composer__main {
  flex: 1;
  min-width: 0;
}

.timeline-composer__textarea-wrapper {
  position: relative;
}

.timeline-composer__textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  /* `resize: none` keeps the browser from painting a corner grip
     that visually bleeds into the suggestions panel anchored at
     the textarea's bottom edge. */
  resize: none;
  min-height: 60px;
  line-height: 1.5;
}

.timeline-composer__textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 15%, transparent);
}

.timeline-composer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.timeline-composer__hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.timeline-composer__hint code {
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--text-secondary);
}

/* ==========================================================================
   @-MENTION AUTOCOMPLETE
   ========================================================================== */

.mention-suggestions-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin-top: 4px;
}

.mention-suggestion {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.mention-suggestion:last-child { border-bottom: none; }
.mention-suggestion:hover,
.mention-suggestion.is-active {
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-surface));
}

.mention-suggestion__kind {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
}

.mention-suggestion--department .mention-suggestion__kind { background: color-mix(in srgb, var(--accent-primary) 18%, var(--bg-surface)); color: var(--accent-primary); }
.mention-suggestion--visibility .mention-suggestion__kind { background: color-mix(in srgb, var(--accent-warning) 18%, var(--bg-surface)); color: var(--accent-warning); }
.mention-suggestion--user       .mention-suggestion__kind { background: color-mix(in srgb, var(--accent-success) 18%, var(--bg-surface)); color: var(--accent-success); }
.mention-suggestion--record     .mention-suggestion__kind { background: var(--bg-elevated); color: var(--text-secondary); }

.mention-suggestion__label    { color: var(--text-primary); font-weight: 500; }
.mention-suggestion__sublabel { color: var(--text-muted); font-size: 12px; grid-column: 2; }
.mention-suggestion__token    { color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; }

/* ==========================================================================
   @-MENTION CHIPS (inline in rendered note bodies and entry headers)
   ========================================================================== */

.mention-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin: 0 1px;
}

.mention-chip--department { background: color-mix(in srgb, var(--accent-primary) 14%, var(--bg-surface)); color: var(--accent-primary); }
.mention-chip--visibility { background: color-mix(in srgb, var(--accent-warning) 18%, var(--bg-surface)); color: var(--accent-warning); }
.mention-chip--user       { background: color-mix(in srgb, var(--accent-success) 14%, var(--bg-surface)); color: var(--accent-success); }
.mention-chip--record     { background: var(--bg-elevated); color: var(--text-secondary); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 10px; }

/* !-flag link chip: rendered as an <a>, lays out as "[Flag Name · host]" */
.mention-chip--link {
  background: color-mix(in srgb, var(--accent-info, #0ea5e9) 14%, var(--bg-surface));
  color: var(--accent-info, #0ea5e9);
  text-decoration: none;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
}
.mention-chip--link:hover { text-decoration: underline; }
.mention-chip--link .mention-chip__host {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mention-chip--link-unknown {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* Flag picker suggestion header + URL-entry step shown inside the suggestions panel */
.mention-suggestion__header {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
}
.mention-suggestion__hint {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}
.mention-suggestion--flag {
  grid-template-columns: 1fr auto;
}
.mention-suggestion__ctxtag {
  color: var(--accent-primary);
  margin-left: 4px;
}
.link-flag-picker__url-row {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
}
.link-flag-picker__input {
  flex: 1 1 auto;
  min-width: 0;
}

/* Rollup-only: subject link appears beneath each entry */
.timeline-entry__subject {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-entry__subject-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.timeline-entry__subject-link:hover {
  text-decoration: underline;
}

.timeline-feed--rollup {
  list-style: none;
  margin: 0;
  padding-left: 24px;
}

.timeline-feed--rollup::before {
  left: 7px;
}
/* ==========================================================================
   ACTIVITY LOG
   ========================================================================== */

.activity-log {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.activity-entry {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-entry:last-child {
  border-bottom: none;
}

.activity-entry:nth-child(even) {
  background: var(--bg-elevated);
}

.activity-entry-content {
  font-size: 14px;
  color: var(--text-primary);
}

.activity-entry-time {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-log-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ==========================================================================
   ACTIVITY TIMELINE - Connected dot style
   ========================================================================== */

.activity-timeline {
  padding: 20px 20px 20px 28px;
  position: relative;
}

/* The connecting line */
.activity-timeline::before {
  content: "";
  position: absolute;
  left: 34px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: var(--border-subtle);
}

.activity-timeline__item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 20px;
}

.activity-timeline__item:last-child {
  padding-bottom: 0;
}

/* The colored dot marker */
.activity-timeline__marker {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  position: relative;
  z-index: 1;
  margin-top: 4px;
}

/* Marker color variants */
.activity-timeline__marker--created {
  background: #0d9488;
  border-color: #0d9488;
}

.activity-timeline__marker--license,
.activity-timeline__marker--document {
  background: #3b82f6;
  border-color: #3b82f6;
}

.activity-timeline__marker--employment,
.activity-timeline__marker--linked {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

.activity-timeline__marker--employment_end,
.activity-timeline__marker--status_change {
  background: #f59e0b;
  border-color: #f59e0b;
}

.activity-timeline__marker--quote {
  background: #ec4899;
  border-color: #ec4899;
}

.activity-timeline__content {
  flex: 1;
  min-width: 0;
}

.activity-timeline__text {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  line-height: 1.4;
}

.activity-timeline__time {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-timeline__link {
  color: var(--accent-primary);
  text-decoration: none;
}

.activity-timeline__link:hover {
  text-decoration: underline;
}

/* Two-column timeline for full width */
.activity-timeline--two-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 24px;
  justify-content: center;
}

.activity-timeline--two-col::before {
  display: none; /* Hide single line in multi-col mode */
}

.activity-timeline--two-col .activity-timeline__item {
  padding-left: 20px;
  border-left: 2px solid var(--border-subtle);
  padding-bottom: 0;
}

.activity-timeline--two-col .activity-timeline__marker {
  position: absolute;
  left: -7px;
}

/* ==========================================================================
   TIMELINE FEED
   Uses design system: single-page, page-header, detail-section, badge
   Only custom styles are the feed layout and entry dots
   ========================================================================== */

.timeline-feed {
  position: relative;
  padding-left: 20px;
}

.timeline-feed::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-entry {
  position: relative;
  padding-bottom: 20px;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-entry__dot {
  position: absolute;
  left: -20px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  background: var(--bg-surface);
  z-index: 1;
}

.timeline-entry--policy .timeline-entry__dot {
  border-color: var(--status-intake);
  background: color-mix(in srgb, var(--status-intake) 25%, var(--bg-surface));
}

.timeline-entry--company .timeline-entry__dot {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 25%, var(--bg-surface));
}

.timeline-entry--employment .timeline-entry__dot {
  border-color: var(--status-quoted);
  background: color-mix(in srgb, var(--status-quoted) 25%, var(--bg-surface));
}

.timeline-entry--coverage .timeline-entry__dot {
  border-color: var(--accent-success);
  background: color-mix(in srgb, var(--accent-success) 25%, var(--bg-surface));
}

.timeline-entry--license .timeline-entry__dot {
  border-color: var(--accent-warning);
  background: color-mix(in srgb, var(--accent-warning) 25%, var(--bg-surface));
}

.timeline-entry--document .timeline-entry__dot {
  border-color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 25%, var(--bg-surface));
}

.timeline-entry--incident .timeline-entry__dot {
  border-color: var(--accent-danger);
  background: color-mix(in srgb, var(--accent-danger) 25%, var(--bg-surface));
}

.timeline-entry--asset_added_to_policy .timeline-entry__dot {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 24%, var(--bg-surface));
}

.timeline-entry__content {
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color 150ms;
}

.timeline-entry__content:hover {
  border-color: var(--border-default);
}

.timeline-entry--asset_added_to_policy .timeline-entry__content {
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-subtle));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent-primary) 5%, var(--bg-surface)) 0%,
    var(--bg-surface) 42%
  );
}

.timeline-entry__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-entry__header .badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-entry__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.timeline-entry__date {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.timeline-entry__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.timeline-entry__actions form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.timeline-entry__delete,
.timeline-entry__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms, color 150ms, background 150ms;
}

.timeline-entry__content:hover .timeline-entry__delete,
.timeline-entry__content:hover .timeline-entry__edit {
  opacity: 1;
}

.timeline-entry__edit:hover {
  background: var(--bg-elevated);
  color: var(--accent-primary);
}

.timeline-entry__delete:hover {
  background: var(--bg-danger-subtle, #fef2f2);
  color: var(--text-danger, #dc2626);
}

.timeline-entry__edit-form {
  margin-top: 10px;
}

.timeline-entry__details {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 8px 0 0;
}

.timeline-entry__meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.timeline-entry__meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.timeline-entry__meta-item dt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-entry__meta-item dd {
  font-size: 13px;
  color: var(--text-primary);
  margin: 0;
}

.timeline-entry__content > .timeline-entry__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.timeline-entry__event-meta {
  display: grid;
  grid-template-columns: minmax(140px, max-content) minmax(90px, max-content) minmax(120px, max-content);
  gap: 10px;
  align-items: stretch;
  margin: 12px 0 0;
  padding: 0;
}

.timeline-entry__event-meta-item {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-elevated) 65%, var(--bg-surface));
}

.timeline-entry__event-meta-item dt {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.timeline-entry__event-meta-item dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.timeline-entry__event-meta-item--value {
  border-color: color-mix(in srgb, var(--accent-primary) 30%, var(--border-default));
  background: color-mix(in srgb, var(--accent-primary) 9%, var(--bg-surface));
}

.timeline-entry__event-meta-item--value dd {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .timeline-entry__event-meta {
    grid-template-columns: 1fr;
  }
}

/* Empty state (shared pattern) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

.empty-state__icon {
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.empty-state__description {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
/* ==========================================================================
   AI COMPONENTS
   ========================================================================== */

.ai-summary-box {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
  border-left: 3px solid var(--accent-primary);
}

.ai-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-icon {
  font-size: 16px;
}

.ai-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ai-summary-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ai-summary-content p {
  margin: 0 0 8px 0;
}

.ai-suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ai-suggestions li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-suggestions li:last-child {
  border-bottom: none;
}

/* AI Insights with timestamps */
.insights-list {
  display: grid;
  gap: 12px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.insight-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  border-left: 4px solid var(--accent-primary);
}

.insight-card--coverage_need { border-left-color: #3b82f6; }
.insight-card--risk_factor { border-left-color: #ef4444; }
.insight-card--business_info { border-left-color: #0d9488; }
.insight-card--follow_up { border-left-color: #f59e0b; }
.insight-card--opportunity { border-left-color: #8b5cf6; }

.insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.insight-category {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.insight-timestamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
  background: none;
  border: 1px solid var(--accent-primary);
  border-radius: 12px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.insight-timestamp:hover {
  background: var(--accent-primary);
  color: white;
}

.insight-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.insight-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Processing spinner */
.processing-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  gap: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   AUDIO PLAYER
   ========================================================================== */

.audio-player {
  width: 100%;
  height: 40px;
}

/* ==========================================================================
   GLOBAL AI CHAT
   ========================================================================== */

.global-chat-trigger {
  width: auto;
  min-width: 92px;
  gap: 8px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 600;
}

.global-chat-trigger__label {
  line-height: 1;
}

.global-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 209;
  background: rgba(15, 23, 42, 0.18);
}

.global-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 210;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(460px, 100vw);
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 180ms var(--ease-out);
}

.global-chat-panel--open {
  transform: translateX(0);
}

.global-chat-open {
  overflow: hidden;
}

.global-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.global-chat-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
}

.global-chat-panel__meta {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.global-chat-panel__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.global-chat-panel__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.global-chat-panel__body {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  min-height: 0;
  padding: 16px;
  gap: 14px;
}

.global-chat-context {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  color: var(--text-primary);
}

.global-chat-context__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.global-chat-context__title {
  display: block;
  max-width: 330px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-chat-context__url {
  display: block;
  max-width: 330px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-chat-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.global-chat-prompt {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.global-chat-prompt:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.global-chat-compare {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.global-chat-compare[hidden] {
  display: none;
}

.global-chat-compare__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.global-chat-compare__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.global-chat-compare__copy {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.global-chat-compare__close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.global-chat-compare__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.global-chat-compare__options {
  display: grid;
  gap: 8px;
}

.global-chat-compare__option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.global-chat-compare__option input {
  flex: 0 0 auto;
}

.global-chat-compare__empty {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
}

.global-chat-compare__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.global-chat-compare__start {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.global-chat-compare__start {
  background: var(--text-primary);
  color: var(--bg-surface);
}

.global-chat-selected-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--text-primary);
  font-size: 12px;
}

.global-chat-selected-context[hidden] {
  display: none;
}

.global-chat-selected-context__label {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-weight: 700;
}

.global-chat-selected-context__items {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.global-chat-selected-context__clear {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.global-chat-selected-context__clear:hover {
  color: var(--text-primary);
}

.global-chat-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 12px;
}

.global-chat-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.global-chat-empty__title {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 700;
}

.global-chat-empty__copy {
  max-width: 300px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.global-chat-message {
  margin: 0 0 14px;
}

.global-chat-message__label {
  margin: 0 0 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.global-chat-message__body {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.global-chat-message--user .global-chat-message__body {
  margin-left: 40px;
  background: var(--accent-subtle);
}

.global-chat-message--assistant .global-chat-message__body {
  margin-right: 40px;
  background: var(--bg-muted);
}

.global-chat-composer {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.global-chat-composer__box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.global-chat-composer textarea {
  min-height: 48px;
  max-height: 140px;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  line-height: 1.45;
}

.global-chat-composer textarea::placeholder {
  color: var(--text-muted);
}

.global-chat-composer__send {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--text-primary);
  color: var(--bg-surface);
  font-size: 22px;
  line-height: 1;
}

.global-chat-composer__send:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 640px) {
  .global-chat-trigger {
    min-width: 44px;
    padding: 0;
  }

  .global-chat-trigger__label {
    display: none;
  }

  .global-chat-panel {
    width: 100vw;
  }
}
/* ==========================================================================
   COMMAND PALETTE - Fizzy Quick Menu
   ========================================================================== */

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}

.command-palette[hidden] {
  display: none;
}

.command-palette__backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease-out;
}

.command-palette__dialog {
  position: fixed;
  top: 8vh;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: 75vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 20px 40px -8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: paletteIn 0.2s var(--ease-out);
}

.command-palette__dialog--find-mode {
  border: 2px solid transparent;
  background: 
    linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    linear-gradient(135deg, var(--accent-primary), #22d3ee) border-box;
  box-shadow: 
    0 0 20px rgba(16, 185, 129, 0.3),
    0 0 40px rgba(34, 211, 238, 0.15),
    0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes paletteIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Search Input */
.command-palette__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.command-palette__search--find-mode {
  background: transparent;
}

.command-palette__ff-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--accent-primary), #22d3ee);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  flex-shrink: 0;
  animation: pill-appear 0.15s ease-out;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.command-palette__ff-pill svg {
  opacity: 0.9;
}

.command-palette__ff-pill--timeline {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.command-palette__ff-pill--lookup {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.command-palette__dialog--lookup-mode {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    linear-gradient(135deg, #f59e0b, #d97706) border-box;
  box-shadow:
    0 0 20px rgba(245, 158, 11, 0.3),
    0 0 40px rgba(217, 119, 6, 0.15),
    0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes pill-appear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.command-palette__search-icon {
  display: none;
}

.command-palette__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
}

.command-palette__input::placeholder {
  color: var(--text-muted);
}

/* Search hint when in find mode with no query */
.command-palette__search-hint {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Content */
.command-palette__content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

/* Sections */
.command-palette__section {
  margin-bottom: 4px;
}

.command-palette__section:last-child {
  margin-bottom: 0;
}

.command-palette__section-header {
  padding: 10px 8px 6px;
}

.command-palette__section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
}

/* Items */
.command-palette__items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.command-palette__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--duration-fast);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}

.command-palette__item:hover,
.command-palette__item--selected {
  background: var(--bg-hover);
}

.command-palette__item-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 8px;
  color: var(--text-secondary);
}

.command-palette__item-icon--green {
  background: var(--accent-primary);
  color: white;
}

.command-palette__item-icon--blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.command-palette__item-icon--purple {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.command-palette__item-icon--add {
  background: transparent;
  color: var(--text-muted);
}

.command-palette__item-label {
  flex: 1;
}

.command-palette__kbd {
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

.command-palette__empty {
  padding: 12px 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Quick Action Buttons - Fizzy Style */
.command-palette__quick-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.command-palette__quick-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.command-palette__quick-btn svg {
  width: 24px;
  height: 24px;
}

.command-palette__quick-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.command-palette__quick-btn--active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.command-palette__quick-btn--active:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: white;
}

.command-palette__quick-kbd {
  position: absolute;
  top: 4px;
  right: 6px;
  padding: 1px 4px;
  font-size: 9px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  color: inherit;
  opacity: 0.7;
}

.command-palette__quick-btn:not(.command-palette__quick-btn--active) .command-palette__quick-kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

/* Collapsible Sections */
.command-palette__section--collapsible .command-palette__section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.command-palette__section--collapsible .command-palette__section-header:hover {
  background: var(--bg-hover);
  border-radius: 6px;
}

.command-palette__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--duration-fast);
}

.command-palette__section--collapsible[data-expanded="false"] .command-palette__chevron {
  transform: rotate(-90deg);
}

.command-palette__section--collapsible[data-expanded="false"] .command-palette__items {
  display: none;
}

/* Search Results Styles */
.command-palette__results-group {
  margin-bottom: 4px;
}

.command-palette__results-group:last-child {
  margin-bottom: 0;
}

.command-palette__results-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 12px 12px 6px;
  margin-bottom: 0;
}

.command-palette__results-group .command-palette__item {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 4px;
}

.command-palette__results-group .command-palette__item:hover {
  background: var(--bg-hover);
}

.command-palette__results-group .command-palette__item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--bg-surface);
}

.command-palette__item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.command-palette__item-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-palette__cov-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-elevated, #f1f5f9);
  color: var(--text-secondary);
  margin-left: 4px;
  vertical-align: middle;
}

.command-palette__status {
  font-weight: 500;
}
.command-palette__status--active { color: var(--accent-success, #16a34a); }
.command-palette__status--renew { color: var(--accent-warning, #d97706); }
.command-palette__status--cancelled { color: var(--accent-danger, #dc2626); }
.command-palette__status--expired { color: var(--text-muted, #94a3b8); }

.command-palette__section--dynamic {
  padding: 0;
}

.command-palette__section--dynamic .command-palette__section-header {
  display: none;
}

.command-palette__section--dynamic .command-palette__items {
  padding: 0;
}

.command-palette__no-results {
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* Footer */
.command-palette__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  border-radius: 0 0 16px 16px;
}

.command-palette__hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.command-palette__hint kbd {
  padding: 3px 8px;
  font-size: 11px;
  font-family: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

/* Make logo clickable button style */
.app-logo {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ==========================================================================
   FILTER BAR
   ========================================================================== */

.dq-filter-bar {
  margin-bottom: 16px;
}

/* Collapsed state */
.dq-filter-bar__collapsed {
  display: flex;
  justify-content: center;
  padding: 8px;
}

.dq-filter-bar__collapsed[hidden] {
  display: none;
}

.dq-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.dq-filter-trigger:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.dq-filter-trigger svg {
  opacity: 0.7;
}

.dq-filter-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: inherit;
  color: var(--text-tertiary);
}

/* Expanded state */
.dq-filter-bar__expanded {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

.dq-filter-bar__expanded[hidden] {
  display: none;
}

.dq-filter-form {
  margin: 0;
}

.dq-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Filter pills */
.dq-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.dq-filter-pill--search {
  flex: 1;
  min-width: 150px;
  max-width: 280px;
}

.dq-filter-pill__icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.dq-filter-pill__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.dq-filter-pill__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
}

.dq-filter-pill__input::placeholder {
  color: var(--text-tertiary);
}

.dq-filter-pill__select {
  padding: 0;
  padding-right: 16px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right center;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.dq-filter-pill__select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Submit button */
.dq-filter-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.dq-filter-submit:hover {
  background: #0d9488;
}

/* Clear all link */
.dq-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.dq-filter-clear:hover {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
  color: white;
}

/* Collapse button */
.dq-filter-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  margin-left: auto;
}

.dq-filter-collapse:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .dq-filter-pill--search {
    flex: 1 1 100%;
    max-width: none;
  }
  
  .dq-filter-controls {
    gap: 6px;
  }
  
  .dq-filter-pill {
    padding: 5px 8px;
    font-size: 12px;
  }
  
  .dq-filter-pill__label {
    display: none;
  }
}

/* ==========================================================================
   BATCH ACTION BAR
   ========================================================================== */

.dq-batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--bg-elevated);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
}

.dq-batch-bar[hidden] {
  display: none;
}

.dq-batch-bar__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
}

.dq-batch-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dq-batch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.dq-batch-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.dq-batch-btn--primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.dq-batch-btn--primary:hover {
  background: #0d9488;
}

.dq-batch-btn--clear {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.dq-batch-btn--clear:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

/* Table with selection checkboxes */
.dq-table--selectable th:first-child,
.dq-table--selectable td:first-child {
  width: 40px;
  padding-right: 0;
}

.dq-table--selectable input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

/* Responsive batch bar */
@media (max-width: 640px) {
  .dq-batch-bar {
    flex-wrap: wrap;
    padding: 8px 12px;
  }
  
  .dq-batch-bar__count {
    flex: 1 1 100%;
    margin-bottom: 4px;
  }
}


/* ==========================================================================
   BOARD FILTER BAR (Fizzy-style)
   ========================================================================== */

.board-filter {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px 16px;
  background: var(--bg-base);
}

/* Header with title */
.board-filter__header {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.board-filter__header::before,
.board-filter__header::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 1px;
  background: var(--border-subtle);
  width: calc(50% - 80px);
}

.board-filter__header::before {
  left: 0;
}

.board-filter__header::after {
  right: 0;
}

.board-filter__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  padding: 0 16px;
  background: var(--bg-base);
  position: relative;
  z-index: 1;
}

/* Controls row - always visible */
.board-filter__row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
}

.board-filter__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Search input - subtle rounded pill */
.board-filter__search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 280px;
}

.board-filter__search-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.board-filter__search-input::placeholder {
  color: var(--text-tertiary);
}

.board-filter__search-input:focus {
  border-color: var(--border-default);
  background: var(--bg-elevated);
}

/* Dropdown container */
.board-filter__dropdown {
  position: relative;
}

/* Pill buttons - prominent style */
.board-filter__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-muted);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) ease;
}

.board-filter__pill:hover {
  background: var(--accent-muted);
  border-color: var(--accent-primary);
}

/* Secondary pill style (for extended filters) */
.board-filter__pill--secondary {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.board-filter__pill--secondary:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* Active pill */
.board-filter__pill--active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.board-filter__pill--active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.board-filter__pill-chevron {
  opacity: 0.6;
}

/* Icon buttons */
.board-filter__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.board-filter__icon-btn:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.board-filter__icon-btn--active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Expanded filters panel */
.board-filter__expanded {
  display: none;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.board-filter__expanded:not([hidden]) {
  display: block;
}

.board-filter__expanded-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Inline filter bar for list headers */
.board-filter--inline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.board-filter--inline .board-filter__row {
  justify-content: flex-end;
}

.board-filter--inline .board-filter__expanded {
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: none;
}

.board-filter--inline .board-filter__expanded-row {
  justify-content: flex-end;
}

/* Extra filters - inline, collapsible */
.board-filter__extra {
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-filter__extra[hidden] {
  display: none;
}

/* Section without header */
.section--no-header {
  padding-top: 0;
}

.section--no-header .section-body {
  padding-top: 0;
}

/* Item list left aligned */
.item-list--left {
  max-width: none;
}

/* ==========================================================================
   POLICY FILTER BAR (matches quotes board style)
   ========================================================================== */

.policy-filter {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 16px;
}

.policy-filter__header {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.policy-filter__header::before,
.policy-filter__header::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 1px;
  background: var(--border-subtle);
  width: calc(50% - 60px);
}

.policy-filter__header::before {
  left: 0;
}

.policy-filter__header::after {
  right: 0;
}

.policy-filter__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  padding: 0 16px;
  background: var(--bg-base);
  position: relative;
  z-index: 1;
}

.policy-filter__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.policy-filter__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.policy-filter__search {
  min-width: 200px;
  max-width: 280px;
}

.policy-filter__search-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.policy-filter__search-input::placeholder {
  color: var(--text-tertiary);
}

.policy-filter__search-input:focus {
  border-color: var(--border-default);
  background: var(--bg-elevated);
}

.policy-filter__dropdown {
  position: relative;
}

.policy-filter__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-muted);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) ease;
}

.policy-filter__pill:hover {
  background: var(--accent-muted);
  border-color: var(--accent-primary);
}

.policy-filter__pill--active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.policy-filter__pill--active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.policy-filter__pill-chevron {
  opacity: 0.6;
}

.policy-filter__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) ease;
}

.policy-filter__icon-btn:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.policy-filter__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}

.policy-filter__menu[hidden] {
  display: none;
}

.policy-filter__menu-header {
  padding: 12px 14px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.policy-filter__menu-items {
  padding-bottom: 8px;
}

.policy-filter__menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.policy-filter__menu-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.policy-filter__menu-item--selected {
  background: var(--accent-primary);
  color: white;
  font-weight: 500;
}

.policy-filter__menu-item--selected:hover {
  background: var(--accent-hover);
  color: white;
}

/* Dropdown menu */
.board-filter__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}

.board-filter__menu[hidden] {
  display: none;
}

.board-filter__menu-header {
  padding: 12px 14px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.board-filter__menu-filter {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.board-filter__menu-filter:focus {
  border-color: var(--border-default);
}

.board-filter__menu-items {
  max-height: 280px;
  overflow-y: auto;
  padding-bottom: 8px;
}

.board-filter__menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.board-filter__menu-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.board-filter__menu-item--selected {
  background: var(--accent-primary);
  color: white;
  font-weight: 500;
}

.board-filter__menu-item--selected:hover {
  background: var(--accent-hover);
  color: white;
}

.board-filter__menu-item--selected::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Icon buttons */
.board-filter__icon-btn,
.board-filter__clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.board-filter__icon-btn:hover,
.board-filter__clear-btn:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.board-filter__clear-btn {
  margin-left: auto;
}

/* Quick action filter indicator */
.board-filter-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: var(--bg-blue-subtle, #e8f1fc);
  border-bottom: 1px solid var(--border-subtle);
}

.board-filter-indicator__text {
  font-size: 14px;
  color: var(--text-primary);
}

.board-filter-indicator__clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) ease;
}

.board-filter-indicator__clear:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
  background: var(--bg-hover);
}

/* Filtered view (when filters are active) - horizontal row like Fizzy */
.board-filter-results {
  flex: 1;
  padding: 0 24px 24px;
  overflow-x: auto;
  overflow-y: hidden;
}

.board-filter-results__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 4px;
}

.board-filter-results__grid .card {
  flex: 0 0 340px;
  max-width: 400px;
}

.board-filter-results__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 200px;
  color: var(--text-tertiary);
  font-size: 15px;
}

/* Filtered card styles - horizontal cards like Fizzy */
.filtered-card {
  flex: 0 0 340px;
  min-width: 340px;
  max-width: 400px;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-fast) ease;
}

/* Status-colored left border */
.filtered-card--intake { border-left-color: var(--status-intake); }
.filtered-card--with_underwriters { border-left-color: var(--status-underwriters); }
.filtered-card--quoted { border-left-color: var(--status-quoted); }
.filtered-card--presented { border-left-color: var(--status-presented); }
.filtered-card--bound { border-left-color: var(--status-bound); }
.filtered-card--not_taken { border-left-color: var(--status-not-taken); }
.filtered-card--not_now { border-left-color: var(--status-not-now); }

.filtered-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}

.filtered-card__link {
  display: block;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}

.filtered-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.filtered-card__id {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.filtered-card__status {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.filtered-card__status--intake { background: var(--status-intake-bg); color: var(--status-intake-text); }
.filtered-card__status--with_underwriters { background: var(--status-underwriters-bg); color: var(--status-underwriters-text); }
.filtered-card__status--quoted { background: var(--status-quoted-bg); color: var(--status-quoted-text); }
.filtered-card__status--presented { background: var(--status-presented-bg); color: var(--status-presented-text); }
.filtered-card__status--bound { background: var(--status-bound-bg); color: var(--status-bound-text); }
.filtered-card__status--not_taken { background: var(--status-not-taken-bg); color: var(--status-not-taken-text); }
.filtered-card__status--not_now { background: var(--status-not-now-bg); color: var(--status-not-now-text); }

.filtered-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.filtered-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.filtered-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.filtered-card__tag--date {
  color: var(--accent-primary);
}

.filtered-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.filtered-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filtered-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.filtered-card__assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.filtered-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .board-filter__controls {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  
  .board-filter__search {
    min-width: 160px;
  }
  
  .board-filter__pill {
    flex-shrink: 0;
  }
}

/* ==========================================================================
   BULK ACTIONS
   ========================================================================== */

.bulk-action-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--bg-surface, #fff) 96%, transparent);
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  padding: 0.5rem 0.75rem;
  z-index: 40;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.bulk-action-bar__content {
  min-height: 36px;
  max-width: none;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.bulk-action-bar__text {
  color: var(--text-secondary, #64748b);
  font-size: 0.8125rem;
}

.bulk-action-bar__text strong {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

.bulk-action-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.bulk-action-bar__actions--primary {
  margin-left: auto;
  padding-right: 0;
  border-right: 0;
}

.bulk-action-bar .btn {
  min-height: 30px;
  padding: 0.3rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.worklist-context-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface, #fff);
}

.worklist-bulk-bar {
  position: sticky;
  left: 0;
  right: 0;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  background: color-mix(in srgb, var(--bg-surface, #fff) 96%, transparent);
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.worklist-bulk-bar[hidden] {
  display: none;
}

.worklist-bulk-bar__count {
  color: var(--text-secondary, #64748b);
  font-size: 0.8125rem;
}

.worklist-bulk-bar__count strong {
  color: var(--text-primary, #0f172a);
}

.worklist-bulk-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.worklist-bulk-bar .btn {
  min-height: 30px;
  padding: 0.3rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.worklist-bulk-pane {
  position: fixed;
  top: 98px;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  z-index: 99;
  background: var(--bg-surface, #fff);
  border-left: 1px solid var(--border-default, #e2e8f0);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.14);
  overflow: auto;
}

.worklist-bulk-pane[hidden] {
  display: none;
}

.worklist-bulk-pane__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: var(--bg-surface, #fff);
  border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.worklist-bulk-pane__header h3 {
  margin: 0;
  font-size: 16px;
}

.worklist-bulk-pane__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  padding-bottom: 92px;
}

.worklist-bulk-compare {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 6px;
  background: var(--bg-muted, #f8fafc);
}

.worklist-bulk-compare h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-primary, #0f172a);
}

.worklist-bulk-compare p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.worklist-bulk-compare__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.worklist-bulk-compare__meta span {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.endorsement-compare-pane {
  position: fixed;
  top: 98px;
  right: 0;
  bottom: 0;
  width: min(860px, calc(100vw - 96px));
  z-index: 98;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface, #fff);
  border-left: 1px solid var(--border-default, #e2e8f0);
  box-shadow: -10px 0 28px rgba(15, 23, 42, 0.16);
}

.endorsement-compare-pane[hidden] {
  display: none;
}

.endorsement-compare-pane__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-surface, #fff);
  border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.endorsement-compare-pane__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #94a3b8);
}

.endorsement-compare-pane__header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text-primary, #0f172a);
}

.endorsement-compare-pane__body {
  flex: 1;
  overflow: auto;
  padding: 18px 24px 96px;
}

.endorsement-compare-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.endorsement-compare-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 4px;
  background: var(--bg-muted, #f8fafc);
  color: var(--text-secondary, #475569);
  font-size: 12px;
  font-weight: 600;
}

.endorsement-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.endorsement-compare-card {
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-muted, #f8fafc);
  padding: 16px;
}

.endorsement-compare-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.endorsement-compare-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary, #0f766e);
  text-decoration: none;
}

.endorsement-compare-card__header p,
.endorsement-compare-card__description {
  margin: 4px 0 0;
  color: var(--text-secondary, #475569);
  font-size: 13px;
}

.endorsement-compare-card__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.endorsement-compare-card__facts div {
  padding: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 6px;
  background: var(--bg-surface, #fff);
}

.endorsement-compare-card__docs {
  margin: 0 0 12px;
}

.endorsement-compare-card__docs-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted, #94a3b8);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.endorsement-compare-card__doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.endorsement-compare-card__doc-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-primary, #0f766e) 12%, transparent);
  color: var(--accent-primary, #0f766e);
  font-size: 11px;
  font-weight: 600;
}

.endorsement-compare-card__docs--empty {
  margin: 0 0 12px;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
  font-style: italic;
}

.endorsement-compare-card__facts dt {
  margin-bottom: 2px;
  color: var(--text-muted, #94a3b8);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.endorsement-compare-card__facts dd {
  margin: 0;
  color: var(--text-primary, #0f172a);
  font-size: 13px;
  font-weight: 600;
}

.endorsement-compare-card__deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.endorsement-compare-card__delta {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-surface, #fff);
  color: var(--text-muted, #64748b);
}

.endorsement-compare-card__delta--add {
  background: #dcfce7;
  color: #166534;
}

.endorsement-compare-card__delta--remove {
  background: #fee2e2;
  color: #991b1b;
}

.endorsement-compare-card__linked {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
}

.endorsement-compare-card__linked strong {
  color: var(--accent-primary, #0f766e);
  font-size: 13px;
}

.endorsement-compare-card__linked span {
  color: var(--text-secondary, #475569);
  font-size: 12px;
}

.endorsement-compare-card__linked a {
  color: var(--accent-primary, #0f766e);
  font-size: 12px;
  font-weight: 700;
}

.endorsement-compare-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.worklist-context-dialog > .add-risk-card-wrap > button {
  display: none;
}

/* Card checkbox styling */
.card-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

.card-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0d9488;
}

.card--linked {
}

.card-link-indicator {
  display: inline-flex;
  align-items: center;
  color: #0d9488;
  margin-right: 0.25rem;
}

.card-link-indicator svg {
  width: 12px;
  height: 12px;
}

/* Make sure card content doesn't overlap checkbox */
.card {
  padding-right: 36px;
}

@media (max-width: 680px) {
  .bulk-action-bar__content {
    flex-direction: column;
    gap: 0.75rem;
  }

  .bulk-action-bar__actions {
    width: 100%;
  }

  .bulk-action-bar__actions button {
    flex: 1;
  }
}

/* ── Quote Totals Panel ── */
.totals-panel {
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.totals-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-default);
}

.totals-panel__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
}

.totals-panel__row--total {
  border-top: 2px solid var(--border-default);
  margin-top: 0.25rem;
  padding-top: 0.6rem;
}

.totals-panel__row--input {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-default);
}

.totals-panel__row--difference {
  margin-top: 0.25rem;
}

.totals-panel__label {
  font-size: 14px;
  color: var(--text-secondary);
}

.totals-panel__value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.totals-panel__value--bold {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.input-group--compact {
  max-width: 180px;
}

.form-label--inline {
  margin-bottom: 0;
  font-size: 14px;
}

/* Totals difference value states */
.totals-value {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.totals-value--match {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-success);
}

.totals-value--mismatch {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-danger);
}

/* ── Accounting Dashboard ── */
.acct-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.acct-kpi {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.acct-kpi:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.acct-kpi__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acct-kpi__icon--danger  { background: color-mix(in srgb, var(--accent-danger)  15%, transparent); color: var(--accent-danger); }
.acct-kpi__icon--success { background: color-mix(in srgb, var(--accent-success) 15%, transparent); color: var(--accent-success); }
.acct-kpi__icon--warning { background: color-mix(in srgb, var(--accent-warning) 15%, transparent); color: var(--accent-warning); }
.acct-kpi__icon--info    { background: color-mix(in srgb, var(--accent-primary) 15%, transparent); color: var(--accent-primary); }
.acct-kpi__icon--muted   { background: color-mix(in srgb, var(--text-secondary) 10%, transparent); color: var(--text-secondary); }

.acct-kpi__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.acct-kpi__value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.acct-kpi__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.acct-kpi__sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.acct-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border-default);
}

.acct-nav__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.acct-nav__item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.acct-nav__item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.acct-nav__item:hover svg {
  opacity: 1;
}

.acct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .acct-grid {
    grid-template-columns: 1fr;
  }
  .acct-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

/* Accounting invoice status badges */
.status-badge--not-recorded { background: color-mix(in srgb, var(--accent-warning) 20%, transparent); color: var(--accent-warning); }
.status-badge--recorded     { background: color-mix(in srgb, var(--accent-success) 20%, transparent); color: var(--accent-success); }
.status-badge--under-review { background: color-mix(in srgb, var(--accent-primary) 20%, transparent); color: var(--accent-primary); }
.status-badge--revised      { background: color-mix(in srgb, var(--status-presented) 20%, transparent); color: var(--status-presented); }
.status-badge--void         { background: color-mix(in srgb, var(--accent-danger) 20%, transparent); color: var(--accent-danger); }

/* Mono cells for currency columns */
.cell-mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Inline kbd badge in search results */
.command-palette__kbd--inline {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.5;
  font-size: 10px;
}

/* ──────────────────────────────────────────────────────────────────────
   ACCOUNTING
   Shares the .board-page / .card primitives with the other worklists.
   ────────────────────────────────────────────────────────────────────── */

/* Prominent total banner. Picks up --card-color so each status group's
   running total tints to match. */
.column-total-banner {
  padding: 4px 20px 14px;
  font-size: 22px;
  font-weight: 700;
  color: var(--card-color, var(--text-primary));
  letter-spacing: -0.01em;
}

/* Big "Add a card" affordance shown inside the intake column body. Mirrors
   .add-risk-card on the Risk Assessment board so creation entrypoints
   read identically across kanbans. */
.column-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 16px);
  min-height: 56px;
  margin: 0 8px 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.column-add-card:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  border-style: solid;
}

/* Slimmer filter bar variant used on the accounting board: same visual
   chrome as .board-filter, just narrower row layout since we only carry
   a search input + a sub-page rail today. */
.board-filter--simple .board-filter__filters--rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── Edit invoice page ─────────────────────────────────────────────── */

.acct-edit-page {
  max-width: 880px;
  margin: 24px auto 48px;
  padding: 0 24px;
}

.acct-edit-page__header {
  margin: 18px 0 24px;
}

.acct-edit-page__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.acct-edit-page__ref {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 16px;
  margin-left: 4px;
}

.acct-edit-page__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.acct-edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.acct-edit-section {
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.acct-edit-section__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.acct-edit-section__hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.acct-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}

.acct-edit-grid__full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .acct-edit-grid { grid-template-columns: 1fr; }
}

.acct-edit-empty {
  margin: 0;
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.acct-bundle-policy {
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.acct-bundle-policy:first-child { margin-top: 0; }

.acct-bundle-policy__header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.acct-bundle-policy__label {
  color: var(--text-secondary);
  font-weight: 500;
}

.acct-bundle-policy__link {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
}
.acct-bundle-policy__link:hover { text-decoration: underline; }

.acct-bundle-policy__cov {
  font-size: 12px;
  color: var(--text-muted);
}

.acct-bundle-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.acct-bundle-row {
  border-bottom: 1px solid var(--border-subtle);
}
.acct-bundle-row:last-child { border-bottom: none; }

.acct-bundle-row__label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
}

.acct-bundle-row--locked .acct-bundle-row__label {
  cursor: not-allowed;
  opacity: 0.55;
}

.acct-bundle-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.acct-bundle-row__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.acct-bundle-row__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.acct-bundle-row__lock {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
}

.acct-edit-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acct-edit-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.acct-edit-check input { margin-top: 3px; }
.acct-edit-check span  { display: block; }
.acct-edit-check small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.acct-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

/* ── Picker result list (Add-a-card modal) ─────────────────────────── */
/* Tighten the result rows so the modal reads as a list, not a single
   stretched card. Each row gets a row divider and a hover state. */
.add-card-dialog .add-card-menu__result-form {
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.add-card-dialog .add-card-menu__result {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.add-card-dialog .add-card-menu__result:hover {
  background: var(--bg-hover);
}

.add-card-dialog .add-card-menu__result:last-child {
  border-bottom: 0;
}

.add-card-dialog .add-card-menu__result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.add-card-dialog .add-card-menu__result-dot {
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.add-card-dialog .add-card-menu__result--create {
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
  padding-top: 10px;
}

.add-card-dialog .add-card-menu__result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.card-company {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.card-company__name {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--card-border-color);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* ── Invoice card-perma sub-components ───────────────────────────────── */

.acct-policy-group {
  margin-bottom: 12px;
}
.acct-policy-group:last-child { margin-bottom: 0; }

.acct-policy-group__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.acct-policy-group__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--duration-fast);
}
.acct-policy-group__link:hover { color: var(--card-color, var(--accent-primary)); }

.acct-policy-group__coverage {
  font-size: 12px;
  color: var(--text-muted);
}

.acct-policy-group__count {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.acct-policy-group__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 0;
  margin-top: 2px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.acct-totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: fit-content;
}

.acct-totals__row {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.acct-totals__row--grand {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}

/* ── Invoice detail (legacy drill-down view) ─────────────────────────── */

.acct-detail {
  max-width: 920px;
  margin: 24px auto 48px;
  padding: 0 24px;
}

.acct-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.acct-detail__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.acct-detail__ref {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.acct-detail__company {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.acct-detail__company-link {
  color: var(--text-secondary);
  text-decoration: none;
}
.acct-detail__company-link:hover { color: var(--accent-primary); text-decoration: underline; }

.acct-detail__status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.acct-detail__status-pill--no-charge { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-secondary); }
.acct-detail__status-pill--pending  { background: color-mix(in srgb, var(--accent-warning) 12%, transparent); color: var(--accent-warning); border-color: color-mix(in srgb, var(--accent-warning) 30%, transparent); }
.acct-detail__status-pill--billed   { background: color-mix(in srgb, var(--accent-primary) 12%, transparent); color: var(--accent-primary); border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent); }
.acct-detail__status-pill--paid     { background: color-mix(in srgb, var(--accent-success) 12%, transparent); color: var(--accent-success); border-color: color-mix(in srgb, var(--accent-success) 30%, transparent); }
.acct-detail__status-pill--direct   { background: color-mix(in srgb, var(--status-presented) 12%, transparent); color: var(--status-presented); border-color: color-mix(in srgb, var(--status-presented) 30%, transparent); }
.acct-detail__status-pill--archived { background: var(--bg-muted); color: var(--text-muted); }

.acct-detail__close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--duration-fast);
}
.acct-detail__close:hover { background: var(--bg-hover); color: var(--text-primary); }

.acct-detail__empty {
  margin: 24px 0;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.acct-detail__policy-block {
  margin-top: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.acct-detail__policy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.acct-detail__policy-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.acct-detail__policy-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.acct-detail__policy-link {
  color: var(--accent-primary);
  text-decoration: none;
}
.acct-detail__policy-link:hover { text-decoration: underline; }

.acct-detail__policy-coverage {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.acct-detail__policy-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.acct-detail__endorsement-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.acct-detail__endorsement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.acct-detail__endorsement:last-child { border-bottom: none; }

.acct-detail__endorsement-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.acct-detail__endorsement-ref {
  font-weight: 600;
  color: var(--text-primary);
}

.acct-detail__endorsement-type,
.acct-detail__endorsement-date {
  color: var(--text-muted);
}

.acct-detail__endorsement-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.acct-detail__policy-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
}

.acct-detail__totals {
  margin-top: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
}

.acct-detail__total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.acct-detail__total-row--grand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.acct-detail__payments {
  margin-top: 24px;
}

.acct-detail__section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
}

.acct-detail__payment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.acct-detail__payment-list li {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.acct-detail__payment-list li:last-child { border-bottom: none; }

.acct-detail__payment-method { color: var(--text-secondary); }
.acct-detail__payment-amount { font-weight: 600; text-align: right; }

.acct-detail__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ──────────────────────────────────────────────────────────────────────
   ENDORSEMENT KANBAN
   Same compound-selector pattern as the accounting board above so that
   column header counts and card backgrounds pick up consistent accent
   colors matching the design-token palette. Endorsement statuses:
   draft, intake, pending, processing, on_hold, issued, void.
   ────────────────────────────────────────────────────────────────────── */

/* Card-level status colors — scoped to the endorsement board so the
   accounting board's "pending = orange" override doesn't bleed here. */
[data-controller*="bulk-endorsement-link"] .card--draft      { --card-color: var(--status-not-now); }
[data-controller*="bulk-endorsement-link"] .card--intake     { --card-color: var(--status-intake); }
[data-controller*="bulk-endorsement-link"] .card--pending    { --card-color: var(--status-quoted); }
[data-controller*="bulk-endorsement-link"] .card--processing { --card-color: var(--status-underwriters); }
[data-controller*="bulk-endorsement-link"] .card--on_hold    { --card-color: var(--status-not-now); }
[data-controller*="bulk-endorsement-link"] .card--issued     { --card-color: var(--status-bound); }
[data-controller*="bulk-endorsement-link"] .card--void       { --card-color: var(--status-void); }

/* Linked sibling references shown on board cards */
.card-linked-siblings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.card-linked-sibling {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* MGA submission reference on board cards */
.card-reference {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 11px;
}

.card-reference__route {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}

.card-reference__email {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-reference__email-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 11px;
}

.card-reference__email-link:hover {
  text-decoration: underline;
}

.card-reference__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms, background 150ms;
  flex-shrink: 0;
}

.card-reference:hover .card-reference__copy,
.card-reference__copy:focus {
  opacity: 1;
}

.card-reference__copy:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
/* ==========================================================================
   APP SHELL
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fixed actions wrapper - for elements that need fixed positioning outside app-shell */
.fixed-actions-wrapper {
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  padding: 0 32px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  position: absolute;
}

.header-actions--left {
  left: 32px;
}

.header-actions--right {
  right: 32px;
}

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast);
}

.header-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-add-trigger {
  width: auto;
  min-width: 68px;
  gap: 10px;
  padding: 0 8px 0 12px;
  white-space: nowrap;
}

.header-add-trigger__key {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: 700 14px/1 var(--font-sans);
  letter-spacing: 0;
}

.app-main {
  flex: 1;
  width: 100%;
  display: block;
}
/* ==========================================================================
   PAGE LAYOUTS
   ========================================================================== */

.single-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

.single-page--wide {
  max-width: 1200px;
}

/* Company split view - two columns */
.company-split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.company-split-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 900px) {
  .company-split-view {
    grid-template-columns: 1fr;
  }
}

.page-header {
  margin-bottom: 24px;
}

.page-header--flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.page-header--flex .page-header__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.page-header--flex .page-header__actions {
  flex-shrink: 0;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.page-title__label {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.page-header__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.page-header__badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.coverage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.coverage-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--bg-elevated, #f1f5f9);
  color: var(--text-secondary, #64748b);
  letter-spacing: 0.03em;
}

.page-header-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.page-header-contacts {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.contact-info {
  font-size: 13px;
}

.contact-name {
  font-weight: 500;
  color: var(--text-primary);
}

.contact-role {
  color: var(--text-muted);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.section-body {
  padding: 16px;
}

/* ==========================================================================
   LISTS
   ========================================================================== */

.item-list {
  display: flex;
  flex-direction: column;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
}

.item-row:last-child {
  border-bottom: none;
}

.item-row:hover {
  background: var(--bg-hover);
  margin: 0 -16px;
  padding: 12px 16px;
}

.item-checkbox {
  flex-shrink: 0;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.item-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.item-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.item-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
  margin-top: 8px;
  border-bottom: 2px solid var(--border-default, #e2e8f0);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.item-group-header:first-child {
  margin-top: 0;
}

.item-group-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 10px;
}

/* ==========================================================================
   BOARD - Kanban Pipeline
   ========================================================================== */

.board-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  overflow: auto;
}

.board-page__board {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.board-page__board[hidden] {
  display: none !important;
}

.board-filter-results[hidden] {
  display: none !important;
}

.board {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 0 28px 80px;
  overflow-x: auto;
  background: var(--bg-base);
  align-items: flex-start;
}

/* Column Header */
.column-header {
  padding: 20px 24px 16px;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 12px;
}

.column-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.column-count {
  font-size: 24px;
  font-weight: 700;
  /* Fizzy-style: use --card-color set on parent column */
  color: var(--card-color);
}

/* Column Cards Area */
.column-cards {
  padding: 0 8px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
}

/* Header action icons - menu and add */
.column-header__menu,
.column-header__add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  text-decoration: none;
}

.column-header__menu:hover,
.column-header__add:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   ADD CARD MENU - Company Search/Add Dropdown
   ========================================================================== */

/* The Add-card menu used to be a positioned dropdown anchored to the
   small "+" button. It now lives inside a <dialog class="modal-dialog">
   so it pops as a proper centered modal — same UX as the risk /
   endorsement pickers. */
.add-card-dialog {
  /* Tighter than the default 600px modal so the search list doesn't read
     as a giant card with mostly empty space. Reset the browser's default
     <dialog> border/outline that bled through on some platforms. */
  width: min(440px, 90vw);
  max-width: 440px;
  border: none;
  outline: none;
}

.add-card-dialog .modal-content {
  /* Fill the dialog instead of capping inside it — the dialog itself
     already provides the width constraint. */
  width: 100%;
  max-width: none;
}

.add-card-dialog .modal-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-card-dialog .add-card-menu__results {
  /* Bottom-pad the empty hint so the modal isn't dramatically taller
     than the search box when no query has been typed. */
  max-height: 320px;
  padding: 0;
}

.add-card-dialog .add-card-menu__hint,
.add-card-dialog .add-card-menu__empty {
  padding: 12px 4px;
  text-align: left;
}

.add-card-dialog--invoice {
  width: min(920px, 94vw);
  max-width: 920px;
}

.add-card-dialog--invoice .modal-content {
  max-height: min(780px, 92vh);
}

.add-card-dialog--invoice .modal-body {
  padding: 0;
}

.add-card-dialog--invoice .add-card-menu__results {
  max-height: min(680px, 78vh);
  padding: 0;
}

.add-card-dialog--invoice .form {
  padding: 16px 20px 20px;
}

.add-card-dialog--invoice .endorsement-picker {
  max-height: min(430px, 48vh);
  overflow: auto;
}

.add-card-menu__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.add-card-menu__input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}

.add-card-menu__input::placeholder {
  color: var(--text-muted);
}

.add-card-menu__results {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
}

.add-card-menu__hint {
  padding: 16px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.add-card-menu__empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.add-card-menu__result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--duration-fast);
}

.add-card-menu__result:hover {
  background: var(--bg-hover);
}

.add-card-menu__result-name {
  font-size: 14px;
  font-weight: 500;
}

.add-card-menu__result-dot {
  font-size: 12px;
  color: var(--text-secondary);
}

.add-card-menu__footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.add-card-menu__new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast);
}

.add-card-menu__new-btn:hover {
  background: var(--accent-primary-hover);
  color: white;
}

/* Empty placeholder - style for expanded empty columns */
.column-empty-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-surface);
  opacity: 0.7;
  margin: 8px;
}

/* Drop card for empty columns - Basecamp style */
.column-drop-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
}

.column-drop-card__text {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
}

/* ==========================================================================
   DRAG & DROP
   ========================================================================== */

[data-arrangement-target="item"] {
  user-select: none;
  -webkit-user-select: none;
}

.arrangement-item--dragging {
  opacity: 0.4;
  transform: scale(0.98);
  border-left-color: var(--text-muted) !important;
}

.arrangement-item--dropped {
  animation: drop-bounce 0.3s var(--ease-spring);
}

@keyframes drop-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.arrangement-touch-clone {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

/* ==========================================================================
   CARD STACKING - Groups same-company cards in same column
   ========================================================================== */

.card-stack {
  position: relative;
}

/* Collapsed stack container - uses status color for cohesive look */
.card-stack__collapsed {
  position: relative;
  cursor: pointer;
  padding: 8px;
  padding-top: 6px;
  background: color-mix(in srgb, var(--card-color) 8%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--card-color) 30%, transparent);
  border-radius: calc(var(--radius-lg) + 4px);
  transition: all 0.2s ease;
}

.card-stack__collapsed:hover {
  background: color-mix(in srgb, var(--card-color) 12%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--card-color) 50%, transparent);
}

/* Stack label - shows "X quotes" in status color */
.card-stack__label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: color-mix(in srgb, var(--card-color) 80%, var(--text-primary));
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card-stack__label svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

/* Stack count badge - uses status color */
.card-stack__indicator {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 10;
}

.card-stack__count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--card-color);
  color: white;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--card-color) 40%, transparent);
  border: 2px solid var(--bg-surface);
}

/* Remove old shadow layers - no longer needed */
.card-stack__shadow {
  display: none;
}

/* Expanded state - matching wrapper style */
.card-stack__expanded {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  padding-top: 6px;
  background: color-mix(in srgb, var(--card-color) 8%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--card-color) 30%, transparent);
  border-radius: calc(var(--radius-lg) + 4px);
}

/* Ensure hidden attribute works despite display: flex */
.card-stack__expanded[hidden],
.card-stack__collapsed[hidden] {
  display: none !important;
}

.card-stack__collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px dashed color-mix(in srgb, var(--card-color) 40%, transparent);
  border-radius: var(--radius-md);
  color: color-mix(in srgb, var(--card-color) 80%, var(--text-primary));
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.card-stack__collapse-btn:hover {
  background: color-mix(in srgb, var(--card-color) 10%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--card-color) 60%, transparent);
  border-style: solid;
}

/* Stacked card styling - prevent link navigation on collapsed stack */
.card--stacked .card-link {
  pointer-events: none;
}

/* Hover effect on collapsed stack - subtle lift */
.card-stack__collapsed:hover .card {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ensure stacked cards don't lift on hover (parent handles it) */
.card--stacked:hover {
  transform: none;
}

/* ==========================================================================
   CARD CHECKLIST PROGRESS
   ========================================================================== */

.card-checklist-progress__meter {
  inline-size: 100%;
  block-size: 4px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
}
.card-checklist-progress__meter::-webkit-progress-bar {
  background: var(--border-subtle);
}
.card-checklist-progress__meter::-webkit-progress-value {
  background: var(--status-underwriters);
}
.card-checklist-progress__meter::-moz-progress-bar {
  background: var(--status-underwriters);
}
.card-checklist-progress__meter--complete::-webkit-progress-value,
.card-checklist-progress__meter--complete::-moz-progress-bar {
  background: var(--status-bound);
}

/* ==========================================================================
   ADD RISK CARD — Blank "Add a card" button in the Risk Assessment In-take
   column + its dropdown menu (type typeahead → active policy list → Next).
   ========================================================================== */

.add-risk-card-wrap {
  position: relative;
  margin: 8px;
}

.add-risk-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.add-risk-card:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  border-style: solid;
}

.add-risk-card__label {
  line-height: 1;
}

/* Modal pop-up for the Add-a-card flow on the Risk Assessment board. */
.add-risk-dialog {
  max-width: 560px;
  width: 92vw;
}

.add-risk-modal {
  max-height: 85vh;
}

.add-risk-modal__body {
  padding: 20px 24px;
  overflow-y: auto;
  min-height: 0;
}

.add-risk-modal__step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-risk-modal__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.add-risk-modal__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.add-risk-modal__input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}

.add-risk-modal__input::placeholder {
  color: var(--text-muted);
}

.add-risk-modal__results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 48vh;
  overflow-y: auto;
  padding: 4px 0;
}

.add-risk-modal__hint,
.add-risk-modal__empty {
  padding: 24px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.add-risk-modal__result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}

.add-risk-modal__result:hover {
  background: var(--bg-hover);
}

.add-risk-modal__result--selected {
  background: var(--accent-ghost);
  border-color: var(--accent-primary);
}

.add-risk-modal__result-name {
  font-size: 14px;
  font-weight: 500;
}

.add-risk-modal__result-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.add-risk-modal__chosen-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}

.add-risk-modal__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.add-risk-modal__back:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.add-risk-modal__chip {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-ghost);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.add-risk-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   LIST VIEW - Table alternative to Kanban (lv-* namespace)
   ========================================================================== */

.board-list-view[hidden] { display: none !important; }

.board-filter--worklist {
  position: sticky;
  top: 0;
  z-index: 20;
  display: block;
  align-items: stretch;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  background: color-mix(in srgb, var(--bg-base, #f8fafc) 94%, transparent);
  backdrop-filter: blur(8px);
}

.board-filter--worklist .board-filter__row {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px) minmax(0, 1fr);
  max-width: none;
  gap: 10px;
  align-items: center;
  justify-content: stretch;
}

.board-filter--worklist .board-filter__view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  white-space: nowrap;
}

.board-filter--worklist .board-filter__view-name {
  color: var(--text-primary, #0f172a);
  font-size: 14px;
  font-weight: 700;
}

.board-filter--worklist .board-filter__view-count {
  color: var(--text-muted, #64748b);
  font-size: 13px;
}

.board-filter--worklist .board-filter__view-count::before {
  content: "\00b7";
  margin-right: 8px;
}

.board-filter--worklist .board-filter__view-meta {
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.board-filter--worklist .board-filter__search {
  min-width: 0;
  max-width: none;
}

.board-filter--worklist .board-filter__filters {
  justify-content: flex-end;
}

.board-list-view {
  flex: 1;
  min-height: 0;
  padding: 0 12px 24px;
  overflow: auto;
}

/* Outer wrapper — scrolls both axes; gives sticky headers a scroll context */
.list-view-table-wrap {
  position: relative;
  overflow: auto;
  height: calc(100vh - 128px);
  max-height: none;
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 6px;
  background: var(--bg-surface, #fff);
}

.list-view-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.4;
}

.list-view-table[hidden] {
  display: none !important;
}

.list-view-table tr[hidden] {
  display: none !important;
}

/* ---- Header cells ---- */
.lv-th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated, #f1f5f9);
  padding: 10px 10px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
  border-bottom: 2px solid var(--border-default, #e2e8f0);
  z-index: 2;
}

/* Frozen header cells — sticky left + top */
.lv-th.lv-frozen {
  position: sticky;
  z-index: 4;
  background: var(--bg-elevated, #f1f5f9);
}

.lv-th.lv-frozen--last {
  box-shadow: 3px 0 6px -2px rgba(0,0,0,0.08);
}

.lv-th--check,
.lv-td--check {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.lv-th--check .checkbox,
.lv-td--check .checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary, #0f766e);
  cursor: pointer;
}

/* ---- Sortable headers ---- */
.lv-th--sortable {
  cursor: pointer;
  user-select: none;
}
.lv-th--sortable:hover {
  color: var(--text-primary, #334155);
}
.lv-sort-arrow::after {
  content: "\2195";
  margin-left: 3px;
  opacity: 0.3;
  font-size: 10px;
}
.lv-th--sorted-asc .lv-sort-arrow::after {
  content: "\2191";
  opacity: 0.8;
}
.lv-th--sorted-desc .lv-sort-arrow::after {
  content: "\2193";
  opacity: 0.8;
}

/* ---- Body cells ---- */
.lv-td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--text-primary, #334155);
  font-size: 13px;
}

/* Frozen body cells — sticky left */
.lv-td.lv-frozen {
  position: sticky;
  z-index: 1;
  background: var(--bg-surface, #fff);
}

.lv-td.lv-frozen--last {
  box-shadow: 3px 0 6px -2px rgba(0,0,0,0.08);
}

/* ---- Modifier classes ---- */
.lv-td--mono   { font-family: var(--font-mono, 'SF Mono', 'Cascadia Code', monospace); font-size: 12px; }
.lv-td--center { text-align: center; }
.lv-td--muted  { color: var(--text-muted, #94a3b8); font-size: 12px; }
.lv-td--wrap   { white-space: normal; max-width: 220px; }

.lv-td--truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lv-td--stacked { white-space: normal; }
.lv-stacked-primary { font-family: var(--font-mono, 'SF Mono', 'Cascadia Code', monospace); font-size: 12px; }
.lv-stacked-secondary { font-size: 11px; margin-top: 1px; }
.lv-stacked-cov { margin-top: 2px; line-height: 1; }
.lv-link--muted { color: var(--text-muted, #64748b); text-decoration: none; }
.lv-link--muted:hover { color: var(--accent-primary, #0f766e); text-decoration: underline; }
.lv-text--muted { color: var(--text-muted, #64748b); }

/* ---- Rows ---- */
.lv-row:hover .lv-td {
  background: var(--bg-hover, #f8fafc);
}
.lv-row:hover .lv-td.lv-frozen {
  background: var(--bg-hover, #f8fafc);
}

.lv-row--active .lv-td,
.lv-row--active .lv-td.lv-frozen {
  background: color-mix(in srgb, var(--accent-ghost, rgba(15,118,110,0.08)) 70%, var(--bg-surface, #fff));
}

.lv-row--issued { opacity: 0.65; }
.lv-row--void   { opacity: 0.45; }

.lv-type-section--new-venture {
  --lv-section-accent: var(--status-intake, #3b82f6);
  --lv-section-bg: color-mix(in srgb, var(--status-intake, #3b82f6) 5%, var(--bg-surface, #fff));
  --lv-section-header-bg: color-mix(in srgb, var(--status-intake, #3b82f6) 18%, var(--bg-elevated, #eef2f7));
}

.lv-type-section--middle-of-term {
  --lv-section-accent: var(--status-underwriters, #f59e0b);
  --lv-section-bg: color-mix(in srgb, var(--status-underwriters, #f59e0b) 5%, var(--bg-surface, #fff));
  --lv-section-header-bg: color-mix(in srgb, var(--status-underwriters, #f59e0b) 18%, var(--bg-elevated, #eef2f7));
}

.lv-type-section--renewal {
  --lv-section-accent: var(--status-bound, #22c55e);
  --lv-section-bg: color-mix(in srgb, var(--status-bound, #22c55e) 5%, var(--bg-surface, #fff));
  --lv-section-header-bg: color-mix(in srgb, var(--status-bound, #22c55e) 18%, var(--bg-elevated, #eef2f7));
}

.lv-type-section--untyped {
  --lv-section-accent: var(--status-void, #ef4444);
  --lv-section-bg: color-mix(in srgb, var(--status-void, #ef4444) 5%, var(--bg-surface, #fff));
  --lv-section-header-bg: color-mix(in srgb, var(--status-void, #ef4444) 18%, var(--bg-elevated, #eef2f7));
}

/* ---- Company group rows ---- */
.lv-type-group-row {
  background: var(--bg-elevated, #eef2f7);
}

.lv-type-group-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  padding: 9px 10px;
  border-top: 1px solid var(--border-default, #cbd5e1);
  border-bottom: 1px solid var(--border-default, #cbd5e1);
  background: var(--lv-section-header-bg, var(--bg-elevated, #eef2f7));
  color: var(--text-primary, #0f172a);
  box-shadow: inset 4px 0 0 var(--lv-section-accent, var(--border-default, #cbd5e1));
  cursor: pointer;
}

.lv-type-group-cell::before {
  content: "\25be";
  display: inline-block;
  width: 14px;
  margin-right: 4px;
  color: var(--lv-section-accent, var(--text-muted, #64748b));
}

.lv-type-group-row--collapsed .lv-type-group-cell::before {
  content: "\25b8";
}

.lv-type-group-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lv-group-row {
  background: var(--bg-muted, #f8fafc);
}

.lv-group-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  border-bottom: 2px solid var(--border-default, #e2e8f0);
  border-top: 1px solid var(--border-default, #e2e8f0);
  background: var(--lv-section-bg, var(--bg-muted, #f8fafc));
  box-shadow: inset 4px 0 0 var(--lv-section-accent, transparent);
  cursor: pointer;
}

.lv-group-cell::before {
  content: "\25be";
  display: inline-block;
  width: 14px;
  margin-right: 4px;
  color: var(--lv-section-accent, var(--text-muted, #64748b));
}

.lv-group-row--collapsed .lv-group-cell {
  color: var(--text-muted, #64748b);
}

.lv-group-row--collapsed .lv-group-cell::before {
  content: "\25b8";
}

.lv-row[class*="lv-type-section--"] .lv-td--check {
  box-shadow: inset 4px 0 0 var(--lv-section-accent, transparent);
}

.lv-row[class*="lv-type-section--"] .lv-td {
  background: var(--lv-section-bg, var(--bg-surface, #fff));
}

.lv-row[class*="lv-type-section--"] .lv-td.lv-frozen {
  background: var(--lv-section-bg, var(--bg-surface, #fff));
}

.lv-row[class*="lv-type-section--"]:hover .lv-td,
.lv-row[class*="lv-type-section--"]:hover .lv-td.lv-frozen {
  background: color-mix(in srgb, var(--lv-section-accent, #0f766e) 9%, var(--bg-hover, #f8fafc));
}

.lv-group-link {
  color: var(--text-primary, #1e293b);
  text-decoration: none;
}
.lv-group-link:hover {
  text-decoration: underline;
  color: var(--accent-primary, #0f766e);
}

.lv-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--lv-count-accent, var(--accent-primary, #0f766e)) 14%, transparent);
  color: var(--lv-count-accent, var(--accent-primary, #0f766e));
  font-size: 11px;
  font-weight: 700;
}

.lv-type-group-row .lv-group-count {
  --lv-count-accent: var(--lv-section-accent, var(--accent-primary, #0f766e));
}

.lv-group-row .lv-group-count {
  --lv-count-accent: var(--lv-section-accent, var(--accent-primary, #0f766e));
}

.lv-group-pills {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}
.lv-group-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-secondary, #f1f5f9);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
}

.lv-group-pill__link {
  color: var(--accent-primary, #0f766e);
  text-decoration: none;
  font-weight: 600;
}
.lv-group-pill__link:hover { text-decoration: underline; }
.lv-group-pill__stat {
  border-left: 1px solid var(--border-subtle, #cbd5e1);
  padding-left: 6px;
  white-space: nowrap;
}

.lv-filter-empty-state {
  margin: 24px auto;
  max-width: 420px;
}

.lv-filter-empty-state[hidden] {
  display: none !important;
}

.list-view-table-wrap [data-list-filter-empty][hidden] {
  display: none !important;
}

.lv-group-note-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  background: transparent;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.15s;
}
.lv-group-note-btn:hover {
  background: var(--accent-ghost, rgba(15,118,110,0.08));
  color: var(--accent-primary, #0f766e);
  border-color: var(--accent-primary, #0f766e);
}

.lv-note-dialog { max-width: 520px; overflow: visible; }
.lv-note-modal { max-width: 520px; width: 100%; overflow: visible; }
.lv-note-modal .modal-body { padding: 16px 20px; overflow: visible; }
.lv-note-modal .timeline-composer__textarea-wrapper { position: relative; }
.lv-note-modal .mention-suggestions-panel { z-index: 9999; }
.lv-note-modal .timeline-composer__textarea {
  width: 100%; box-sizing: border-box;
  min-height: 80px;
}
.lv-note-status {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-primary, #0f766e);
  font-weight: 500;
}

.quote-pane__market-copy {
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.quote-pane__market-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-pane__market-mga {
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* ---- Links ---- */
.lv-link {
  color: var(--text-primary, #334155);
  text-decoration: none;
}
.lv-link:hover { text-decoration: underline; }
.lv-link--button {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.lv-link--primary {
  color: var(--accent-primary, #0f766e);
  font-weight: 600;
  text-decoration: none;
}
.lv-link--primary:hover { text-decoration: underline; }

/* ---- Coverage pills ---- */
.lv-cov {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #475569);
  margin-right: 2px;
  letter-spacing: 0.02em;
}
.lv-cov--sm {
  padding: 0 3px;
  font-size: 9px;
  vertical-align: middle;
}

/* ---- Delta badges (driver/vehicle add/remove) ---- */
.lv-delta {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}
.lv-delta--add { background: #dcfce7; color: #166534; }
.lv-delta--rm  { background: #fee2e2; color: #991b1b; }

/* ---- Status badges (small variant) ---- */
.status-badge--sm {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
}

/* ---- Check marks ---- */
.lv-check--yes     { color: #16a34a; font-size: 14px; }
.lv-check--pending { color: #f59e0b; font-size: 10px; }

/* ---- Empty placeholder ---- */
.lv-empty { color: var(--text-muted, #cbd5e1); }

/* ---- Assignee avatar ---- */
.lv-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-primary, #0f766e);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ---- Inline assign dropdown ---- */
.lv-assign-cell {
  position: relative;
  cursor: pointer;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lv-assign-display {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lv-assign-display .lv-avatar + .lv-avatar {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--bg-surface, #fff);
}

.lv-assign-dropdown {
  position: fixed;
  z-index: 60;
  width: 210px;
  max-height: 260px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-default, #e2e8f0);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lv-assign-dropdown[hidden] { display: none; }

.lv-assign-search {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
  font-size: 12px;
  outline: none;
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #334155);
}
.lv-assign-search::placeholder { color: var(--text-muted, #94a3b8); }

.lv-assign-list {
  overflow-y: auto;
  max-height: 210px;
  padding: 4px;
}

.lv-assign-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-primary, #334155);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lv-assign-option:hover {
  background: var(--bg-hover, #f8fafc);
}

.lv-assign-option--active {
  background: color-mix(in srgb, var(--accent, #0f766e) 12%, transparent);
  color: var(--accent, #0f766e);
  font-weight: 700;
}

.lv-assign-option--none {
  color: var(--text-muted, #94a3b8);
  font-style: italic;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
  border-radius: 0;
  margin-bottom: 2px;
}

.lv-avatar--xs {
  width: 20px;
  height: 20px;
  font-size: 8px;
  flex-shrink: 0;
}

/* ---- Group row layout ---- */
.lv-group-cell__inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lv-group-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
}
.lv-group-action:hover {
  background: var(--accent-ghost, rgba(15,118,110,0.08));
  border-color: var(--accent-primary, #0f766e);
  color: var(--accent-primary, #0f766e);
}

.lv-doc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 700;
}

/* ==========================================================================
   RIGHT-SIDE PANE — Company details slide-out
   ========================================================================== */

.lv-pane {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.25s, opacity 0.25s ease;
}

.lv-pane--open {
  visibility: visible;
  opacity: 1;
  background: rgba(0,0,0,0.15);
  transition: visibility 0s, opacity 0.25s ease;
}

.lv-pane__panel {
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-surface, #fff);
  border-left: 1px solid var(--border-default, #e2e8f0);
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.lv-pane--open .lv-pane__panel {
  transform: translateX(0);
}

.lv-pane__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
  flex-shrink: 0;
}

.lv-pane__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lv-pane__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 4px);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.lv-pane__close:hover {
  background: var(--bg-hover, #f8fafc);
  color: var(--text-primary, #1e293b);
}

.lv-pane__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 8px;
  background: transparent;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.lv-pane__back:hover {
  background: var(--bg-hover, #f8fafc);
  color: var(--accent-primary, #0f766e);
  border-color: var(--accent-primary, #0f766e);
}
.lv-pane__back[hidden] { display: none; }

.lv-pane__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 32px;
}

.lv-pane__section {
  margin-bottom: 24px;
}

.lv-pane__section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
}

.lv-pane__item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
}
.lv-pane__item:last-child { border-bottom: none; }

.lv-pane__item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lv-pane__item-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary, #0f766e);
  text-decoration: none;
}
.lv-pane__item-link:hover { text-decoration: underline; }

.lv-pane__item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
}

.lv-pane__doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.lv-pane__doc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
}

.lv-pane__doc-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lv-pane__doc-type {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #334155);
}

.lv-pane__doc-ref {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.lv-pane__doc-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}
.lv-pane__doc-badge--yes {
  background: #dcfce7;
  color: #166534;
}
.lv-pane__doc-badge--none {
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #94a3b8);
}

.lv-pane__empty {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  padding: 8px 0;
  margin: 0;
}

.lv-pane__upload-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.lv-pane__upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px dashed var(--border-default, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lv-pane__upload-btn:hover {
  background: var(--accent-ghost, rgba(15,118,110,0.08));
  border-color: var(--accent-primary, #0f766e);
  border-style: solid;
  color: var(--accent-primary, #0f766e);
}

.lv-pane__link-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
}

.lv-pane__link-item {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm, 4px);
  background: var(--accent-ghost, rgba(15,118,110,0.08));
  color: var(--accent-primary, #0f766e);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.lv-pane__link-item:hover {
  background: rgba(15,118,110,0.15);
  text-decoration: none;
}

.lv-linked-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-primary, #0f766e);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.lv-linked-badge:hover {
  background: rgba(15, 118, 110, 0.15);
  text-decoration: none;
}

.lv-pane__linked-table {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 6px;
  background: var(--bg-muted, #f8fafc);
}

.lv-pane__linked-table-head,
.lv-pane__linked-row {
  display: grid;
  grid-template-columns: 52px minmax(92px, 1fr) minmax(92px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.lv-pane__linked-table-head {
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lv-pane__linked-table-head .lv-pane__item-link {
  grid-column: 4;
  text-transform: none;
  letter-spacing: 0;
}

.lv-pane__linked-row {
  padding: 7px 8px;
  border-radius: 5px;
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #0f172a);
  text-decoration: none;
}

.lv-pane__linked-row:hover {
  background: rgba(15, 118, 110, 0.08);
  text-decoration: none;
}

.lv-pane__linked-ref {
  color: var(--accent-primary, #0f766e);
  font-weight: 700;
}

.lv-pane__linked-policy,
.lv-pane__linked-type {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary, #475569);
}

/* ---- Inline edit ---- */
.lv-td--editable { cursor: pointer; position: relative; }
.lv-td--editable:hover { background: rgba(15, 118, 110, 0.06); }
.lv-edit-input {
  width: 100%; box-sizing: border-box;
  padding: 2px 4px; font: inherit; font-size: 12px;
  border: 1.5px solid var(--accent-primary, #0f766e);
  border-radius: 4px; outline: none;
  background: var(--bg-surface, #fff); color: var(--text-primary, #1e293b);
}
select.lv-edit-input { padding: 1px 2px; }

.pane-inline-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pane-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: end;
  width: 100%;
}

.pane-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  margin-top: 0;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.pane-inline-actions .btn {
  min-height: 38px;
}

.pane-workflow-card {
  margin-bottom: 16px;
}

.pane-status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  width: 100%;
}

.pane-status-form .form-select {
  min-width: 0;
}

.pane-readonly-field {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 6px;
  background: var(--surface-subtle, #f8fafc);
}

.pane-readonly-field strong {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

/* ---- Utility text colors ---- */
.text-positive { color: #16a34a; }
.text-negative { color: #dc2626; }

/* ---- Toggle button active state ---- */
.board-filter__icon-btn--active {
  background: var(--accent-primary, #0f766e);
  color: #fff;
  border-radius: 50%;
}

/* ---- Endorsement detail side pane ---- */
.lv-detail-pane {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: rgba(0,0,0,0.25);
}
.lv-detail-pane.lv-pane--open { display: block; }
.lv-detail-pane__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 85vw);
  height: 100%;
  background: var(--bg-surface, #fff);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  animation: lv-detail-slide 0.2s ease;
}
@keyframes lv-detail-slide {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.lv-detail-pane__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-default, #e2e8f0);
  flex-shrink: 0;
}
.lv-detail-pane__title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lv-detail-pane__body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.lv-detail-pane__body .dashboard-page,
.lv-detail-pane__body .form-page,
.lv-detail-pane__body .single-page { padding: 16px; }
.lv-detail-pane__body .page-header:not(.quote-pane__header) { display: none; }
.lv-detail-pane__body .app-header { display: none; }
.lv-detail-pane__body .dashboard-grid { grid-template-columns: 1fr !important; }
.lv-detail-pane__body .dashboard-card { break-inside: avoid; }
.lv-detail-pane__body .comments-section {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-surface, #fff);
}
.lv-detail-pane__body .comment-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.lv-detail-pane__body .comment-form-avatar { display: none; }
.lv-detail-pane__body .comment-textarea {
  min-height: 84px;
  font-size: 14px;
}
.lv-detail-pane__body dialog.modal-dialog {
  max-width: min(520px, 70vw);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  animation: paneFadeIn 0.15s ease;
}
@keyframes paneFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.lv-detail-pane__body dialog.modal-dialog .modal-content {
  max-width: none;
}
.lv-detail-pane__body dialog.modal-dialog::backdrop {
  background: rgba(0,0,0,0.3);
}
.lv-detail-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 14px;
}

/* ---- Quote side-pane polish ---- */
.lv-detail-pane__body .quote-pane {
  background: var(--bg-main, #f8fafc);
}
.quote-pane--standalone {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  background: var(--bg-main, #f8fafc);
}
.quote-pane__standalone-back {
  margin-bottom: 16px;
}
.pane-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 4px 0 18px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.pane-detail-header--compact {
  align-items: center;
  padding-top: 0;
}

.pane-detail-header__main {
  min-width: min(100%, 280px);
  flex: 1 1 280px;
}

.pane-detail-header__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pane-detail-header__title {
  color: var(--text-primary, #0f172a);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.quote-pane__title {
  font-size: 20px !important;
}

.pane-detail-header__meta {
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  line-height: 1.4;
  margin: 6px 0 0;
}

.quote-pane__subtitle {
  margin-top: 6px;
}

.pane-detail-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.pane-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 4px;
}

.pane-action-bar form,
.pane-detail-header__actions form {
  margin: 0;
  display: inline-flex;
}

.pane-action-bar .btn,
.pane-detail-header__actions .btn {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 8px;
  font-weight: 700;
}

.quote-pane__card {
  border-radius: var(--radius-md, 8px);
  border-color: var(--border-subtle, #e2e8f0);
  box-shadow: none;
}
.quote-pane__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quote-pane__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
}
.quote-pane__text-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  color: var(--accent-primary, #0f766e);
}
.quote-pane__list {
  padding-top: 6px;
  padding-bottom: 6px;
}
.quote-pane__list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  font-size: 13px;
}
.quote-pane__list-row:first-child { border-top: 0; }
.quote-pane__list-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.quote-pane__amount {
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.quote-pane__row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.quote-pane__remove-form {
  margin: 0;
}
.quote-pane__remove-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 0;
}
.quote-pane__remove-action:hover,
.quote-pane__remove-action:focus-visible {
  color: var(--danger, #dc2626);
  text-decoration: underline;
}
.quote-pane__stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.quote-pane__stat-card {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  color: inherit;
  text-decoration: none;
  background: var(--bg-surface, #fff);
}
.quote-pane__stat-card:hover {
  border-color: var(--accent-primary, #0f766e);
  background: var(--accent-ghost, rgba(15, 118, 110, 0.06));
  text-decoration: none;
}
.quote-pane__stat-value {
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}
.quote-pane__stat-label {
  color: var(--text-secondary, #64748b);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.quote-pane__stat-action {
  color: var(--accent-primary, #0f766e);
  font-size: 12px;
  font-weight: 700;
}
.quote-pane__actions {
  margin-top: 0;
}
/* ==========================================================================
   MOBILE RESPONSIVE STYLES
   ========================================================================== */

/* Mobile-first breakpoints */
@media (max-width: 768px) {
  /* App Shell */
  .app-header {
    padding: 12px 16px;
  }
  
  .header-actions--left {
    left: 16px;
  }
  
  .header-actions--right {
    right: 16px;
  }
  
  .app-content {
    padding-top: 56px;
  }
  
  /* Dashboard Page */
  .dashboard-page {
    padding: 16px 12px;
  }
  
  /* Dashboard Header - Stack on mobile */
  .dashboard-header {
    flex-direction: column;
    gap: 12px;
    position: relative;
  }
  
  .dashboard-header__main {
    flex: 1;
    min-width: 0;
    padding-right: 40px; /* Space for the edit button only */
  }
  
  /* Move edit button to top right */
  .dashboard-header__edit {
    position: absolute;
    top: 0;
    right: 0;
  }
  
  /* Move contacts strip below header, full width */
  .dashboard-header__actions {
    position: static;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    order: 1;
  }
  
  .dashboard-header__actions .contacts-strip {
    padding: 8px 0;
  }
  
  .dashboard-header__actions .contacts-strip__avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
    margin-left: -8px;
  }
  
  .dashboard-header__actions .contacts-strip__avatar:first-child {
    margin-left: 0;
  }
  
  .dashboard-header__actions .contacts-strip__avatar--add {
    margin-left: 4px;
  }
  
  .dashboard-header__title {
    font-size: 18px;
  }
  
  .dashboard-header__meta {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .dashboard-header__dot {
    font-size: 14px;
  }
  
  .dashboard-header__details {
    gap: 8px;
  }
  
  .detail-item {
    font-size: 12px;
  }
  
  /* Stats Row */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-card {
    padding: 14px 16px;
  }
  
  .stat-card__value {
    font-size: 28px;
  }
  
  /* Single Page Layout */
  .single-page {
    padding: 16px 12px;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  /* Board Layout - Horizontal scroll */
  .board-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Cards */
  .card {
    padding: 14px;
  }
  
  .card-title {
    font-size: 14px;
  }
  
  .card-subtitle {
    font-size: 12px;
  }
  
  /* Cards Grid */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Forms */
  .form-page {
    padding: 16px 12px;
  }
  
  .form-section {
    padding: 20px 16px;
  }
  
  .form-title {
    font-size: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 16px;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Buttons */
  .btn {
    padding: 10px 16px;
  }
  
  .btn-sm {
    padding: 8px 12px;
  }
  
  /* Sections */
  .section {
    margin-bottom: 20px;
  }
  
  .section-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .section-title {
    font-size: 15px;
  }
  
  .section-body {
    padding: 16px;
  }
  
  /* Data Grid */
  .data-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Tables - Horizontal scroll */
  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table {
    min-width: 600px;
  }
  
  /* Quote Show Page */
  .quote-show-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Selection List */
  .selection-list {
    gap: 8px;
  }
  
  .selection-item {
    padding: 12px 14px;
  }
  
  /* Back Link */
  .back-link {
    font-size: 13px;
  }
  
  .back-link__key {
    display: none;
  }
  
  /* Modals/Command Palette */
  .command-palette {
    width: 95%;
    max-width: 400px;
    max-height: 70vh;
  }
  
  .command-palette__input {
    padding: 14px 16px;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  /* Toast */
  .toast-container {
    bottom: 16px;
    left: 12px;
    right: 12px;
  }
  
  /* DQ Card (Quotes Snapshot) */
  .dq-card {
    padding: 16px;
  }
  
  /* Discovery Section */
  .discovery-content {
    padding: 16px;
  }
  
  /* Comments */
  .comment-form textarea {
    font-size: 16px; /* Prevents iOS zoom */
  }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
  .dashboard-header__title {
    font-size: 18px;
  }
  
  .stats-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .stat-card__value {
    font-size: 24px;
  }
  
  .card-tags {
    flex-wrap: wrap;
  }
  
  .page-header-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .page-header-actions {
    flex-direction: column;
  }
  
  .page-header-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Hide less important elements on very small screens */
  .card-dot {
    display: none;
  }
  
  .card-meta {
    gap: 12px;
  }
  
  .card-timestamp {
    font-size: 11px;
  }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .btn, 
  .stat-card__action,
  .header-icon-btn,
  .selection-item,
  .combobox-option {
    min-height: 44px;
  }
  
  .combobox-option {
    padding: 14px 16px;
  }
  
  .data-table td,
  .data-table th {
    padding: 14px 12px;
  }
}

/* Landscape phone adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .board-grid {
    max-height: 60vh;
  }
  
  .command-palette {
    max-height: 80vh;
  }
}

/* Card Perma (Quote Detail) Mobile */
@media (max-width: 1100px) {
  /* Hide fixed side actions on narrower screens */
  .card-perma__actions {
    display: none;
  }
}

@media (max-width: 768px) {
  /* =========================================
     QUOTE DETAIL MOBILE - Fizzy-inspired
     ========================================= */
  
  .card-perma {
    padding: 12px;
    min-height: calc(100vh - 64px);
  }
  
  .card-perma__container {
    padding: 0;
  }
  
  .card-perma__bg {
    padding: 16px;
    border-radius: var(--radius-lg);
    min-height: auto;
    position: relative;
  }
  
  /* Mobile close button - show on mobile */
  .mobile-close-btn {
    display: flex;
  }
  
  /* Back link / breadcrumb */
  .card-perma__back {
    display: none; /* Hidden on mobile - using mobile-close-btn instead */
  }
  
  .breadcrumb {
    display: none; /* Hide full breadcrumb on mobile */
  }
  
  .back-link {
    font-size: 14px;
    gap: 8px;
  }
  
  .back-link__key {
    display: none; /* Hide keyboard shortcut on mobile */
  }

  .header-add-trigger__key {
    display: none;
  }
  
  /* Header row - stack everything vertically */
  .card__header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .card__board {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .card__id--large {
    font-size: 14px;
    padding: 4px 10px;
  }
  
  .card__effective-tag {
    font-size: 12px;
    padding: 4px 10px;
  }
  
  /* Tags row */
  .card__tags {
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .card__tag button,
  button.card__tag {
    padding: 3px 8px;
    font-size: 10px;
  }
  
  /* Card body - stack sections vertically */
  .card__body {
    flex-direction: column;
    gap: 0;
  }
  
  /* Title and description */
  .card__title {
    font-size: 18px;
    line-height: 1.3;
  }
  
  .card__title-sub {
    display: block;
    margin: 4px 0 0 0;
  }
  
  .card__description {
    font-size: 13px;
    margin-bottom: 16px;
  }
  
  .card__client-type {
    margin-left: 0;
    margin-top: 4px;
    display: inline-block;
  }
  
  /* Sections */
  .card__section {
    margin-bottom: 16px;
    padding: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--card-color) 20%, var(--border-subtle));
    padding-bottom: 16px;
  }
  
  .card__section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  
  .card__section-title {
    font-size: 11px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .card__section-add {
    font-size: 13px;
    font-weight: 600;
    margin-left: 0;
  }
  
  /* Coverage & Markets tables - card style on mobile */
  .coverage-table {
    width: 100%;
    min-width: 0;
  }
  
  .coverage-table thead {
    display: none; /* Hide headers, use card layout instead */
  }
  
  .coverage-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .coverage-table__row {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
  }
  
  .coverage-table__row td {
    padding: 0;
    border-bottom: none;
  }
  
  .coverage-table__row td.coverage-table__type {
    padding-right: 0;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .coverage-table__row td.coverage-table__limit,
  .coverage-table__row td.coverage-table__deductible {
    padding-left: 0;
    padding-right: 0;
    font-size: 13px;
  }
  
  .coverage-table__row td.coverage-table__limit::before {
    content: "Limit: ";
    font-weight: 500;
    color: var(--text-muted);
  }
  
  .coverage-table__row td.coverage-table__deductible::before {
    content: "Ded: ";
    font-weight: 500;
    color: var(--text-muted);
  }
  
  /* Stats row (Drivers/Equipment) */
  .card__stats {
    gap: 16px;
    justify-content: flex-start;
  }
  
  .card__stat--link {
    flex: 1;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
  }
  
  .card__stat-number {
    font-size: 20px;
  }
  
  .card__stat-label {
    font-size: 11px;
  }
  
  /* Status selector - hide desktop version, show dropdown on mobile */
  .card__stages--desktop {
    display: none;
  }
  
  .card__stages--mobile {
    display: block;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--card-color) 20%, var(--border-subtle));
  }
  
  /* Footer - vertical stacking */
  .card__footer {
    padding-top: 16px;
    margin-top: 16px;
  }
  
  .card__assignment {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .card__assigned {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
  }
  
  .card__assigned-divider {
    display: none;
  }
  
  .card__assigned-info {
    flex: 1;
  }
  
  .card__assigned-label {
    font-size: 10px;
  }
  
  .card__assigned-name {
    font-size: 11px;
  }
  
  /* Bottom action bar - hide desktop, show mobile Fizzy-style */
  .card-perma__notch--desktop {
    display: none;
  }
  
  .card-perma__notch--mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 12px 0;
    padding-bottom: 16px;
    gap: 8px;
  }
  
  /* Comments section mobile */
  .comments-section {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-lg);
  }
  
  .comments-header {
    margin-bottom: 12px;
  }
  
  .comments-title {
    font-size: 13px;
  }
  
  /* Market status badge */
  .market-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
  }
  
  /* Empty state */
  .card__empty {
    font-size: 13px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    text-align: center;
  }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
  .app-header {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  
  .app-content {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
  
  .dashboard-page,
  .single-page,
  .form-page {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  
  /* Quote detail page safe areas */
  .card-perma {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  
  .card-perma__notch {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}
/* ==========================================================================
   CARD DETAIL VIEW (Quote Request Show)
   ========================================================================== */

.card-perma {
  --card-color: var(--accent-primary);
  min-height: calc(100vh - 72px);
  background: var(--bg-base);
  padding: 24px 32px;
}
.card-perma--not-now,
.card-perma__actions--status-not-now {
  --card-color: var(--status-not-now);
}
.card-perma--intake,
.card-perma__actions--status-intake {
  --card-color: var(--status-intake);
}
.card-perma--with-underwriters,
.card-perma__actions--status-with-underwriters {
  --card-color: var(--status-underwriters);
}
.card-perma--quoted,
.card-perma__actions--status-quoted {
  --card-color: var(--status-quoted);
}
.card-perma--presented,
.card-perma__actions--status-presented {
  --card-color: var(--status-presented);
}
.card-perma--bound,
.card-perma__actions--status-bound {
  --card-color: var(--status-bound);
}
.card-perma--not-taken,
.card-perma__actions--status-not-taken {
  --card-color: var(--status-not-taken);
}
.card-perma--void,
.card-perma__actions--status-void {
  --card-color: var(--status-void);
}

.card-perma__container {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.card-perma__back {
  margin-bottom: 12px;
}

.page-back {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.page-back__text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-back__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  transition: all var(--duration-fast);
}

.page-back__link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb__separator {
  color: var(--text-muted);
}

.breadcrumb__current {
  color: var(--text-primary);
  font-weight: 500;
}

.page-breadcrumb {
  margin-bottom: 16px;
}

.page-breadcrumb .back-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.page-breadcrumb .back-link:hover {
  color: var(--text-primary);
}

.page-breadcrumb .back-link svg {
  opacity: 0.7;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  transition: color var(--duration-fast);
}

.back-link:hover {
  color: var(--text-secondary);
}

.back-link__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-perma__actions {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 12px;
  top: 180px;
  z-index: 10;
}

/* Position icons outside the larger card (880px + gap) */
.card-perma__actions--left { left: calc(50% - 500px); }
.card-perma__actions--right { right: calc(50% - 500px); }

.card-perma__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast);
}

.card-perma__action-btn:hover {
  background: color-mix(in srgb, var(--card-color) 20%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--card-color) 50%, var(--border-subtle));
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.card-perma__action-btn--active {
  background: color-mix(in srgb, var(--accent) 15%, var(--bg-surface));
  border-color: var(--accent);
  color: var(--accent);
}

.card-perma__action-btn--active:hover {
  background: color-mix(in srgb, var(--accent) 25%, var(--bg-surface));
}

.card-perma__bg {
  background: color-mix(in srgb, var(--card-color) 15%, var(--bg-surface));
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  border: none;
}

.card-perma__bg:hover {
  border: none;
}

.card--detail {
  /* Inherit --card-color from parent (card-perma) instead of using default */
  --card-color: inherit;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.card--detail:hover {
  transform: none;
  box-shadow: none;
}

.card--detail .status-badge {
  background: color-mix(in srgb, var(--card-color) 12%, var(--bg-surface));
  color: color-mix(in srgb, var(--card-color) 80%, var(--text-primary));
  border-color: color-mix(in srgb, var(--card-color) 25%, transparent);
}

.card__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.card__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__board {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card__id {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  color: var(--text-muted);
}

.card__id--large {
  font-size: 18px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-primary);
}

.card__effective-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
}

.card__effective-tag svg {
  opacity: 0.7;
}

.card__board-name {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Business type tag pills - inherits card status color */
.card__tags {
  display: flex;
  gap: 6px;
}

.card__tag {
  display: inline-block;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

.card__tag button,
button.card__tag {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-family: inherit;
}

.card__tag button:hover,
button.card__tag:hover {
  background: color-mix(in srgb, var(--card-color) 10%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--card-color) 50%, var(--border-subtle));
  color: var(--text-secondary);
}

.card__tag--active button,
button.card__tag--active {
  background: color-mix(in srgb, var(--card-color) 15%, var(--bg-surface));
  border-color: var(--card-color);
  color: var(--card-color);
  font-weight: 600;
}

.card__tag--active button:hover,
button.card__tag--active:hover {
  background: color-mix(in srgb, var(--card-color) 20%, var(--bg-surface));
}

.card__body {
  display: flex;
  gap: 24px;
}

.card__content {
  flex: 1;
}

.card__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.card__title-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 8px;
}

.card__description {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.card__description p {
  margin: 0 0 4px 0;
}

.card__client-type {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--card-color) 20%, var(--bg-elevated));
  border-radius: 4px;
  color: var(--card-color);
  vertical-align: middle;
}

.card__section {
  margin-bottom: 16px;
}

.card__section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

.card__section-add {
  font-size: 12px;
  color: var(--card-color);
  margin-left: 8px;
}

.card__checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card__checklist-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.card__checklist-item:last-child {
  border-bottom: none;
}

.card__checklist-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card__checklist-text {
  font-size: 14px;
  color: var(--text-primary);
}

.card__checklist-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Coverage Table */
.coverage-table {
  border-collapse: collapse;
  font-size: 14px;
}

.coverage-table thead {
  border-bottom: 1px solid var(--border-subtle);
}

.coverage-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding-bottom: 8px;
}

.coverage-table th.coverage-table__type,
.coverage-table td.coverage-table__type {
  text-align: left;
  padding-right: 32px;
}

.coverage-table th.coverage-table__limit,
.coverage-table td.coverage-table__limit {
  text-align: left;
  padding-left: 24px;
  padding-right: 24px;
}

.coverage-table th.coverage-table__deductible,
.coverage-table td.coverage-table__deductible {
  text-align: left;
  padding-left: 24px;
}

.coverage-table__row td {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.coverage-table__row:last-child td {
  border-bottom: none;
}

.coverage-table__type a {
  color: var(--text-primary);
  transition: color var(--duration-fast);
}

.coverage-table__type a:hover {
  color: var(--card-color);
}

.coverage-table td.coverage-table__limit,
.coverage-table td.coverage-table__deductible {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.coverage-table th.coverage-table__actions,
.coverage-table td.coverage-table__actions {
  width: 32px;
  text-align: center;
  padding-left: 4px;
}

.coverage-table__delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}

.coverage-table__row:hover .coverage-table__delete-btn {
  opacity: 1;
}

.coverage-table__delete-btn:hover {
  opacity: 1;
  color: var(--color-danger);
  background: var(--color-danger-bg, rgba(220, 38, 38, 0.08));
}

/* Selectable checklist items (used in split dialog) */
.modal-checklist__item--selectable {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--duration-fast);
}

.modal-checklist__item--selectable:hover {
  background: var(--bg-hover);
}

.modal-checklist__item--selectable input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--card-color, var(--color-primary));
}

/* Coverage Table - Compact variant for embedded views */
.coverage-table--compact {
  margin-top: 4px;
}

.coverage-table--compact th {
  font-size: 10px;
  padding: 0 16px 6px 0;
  text-align: left;
}

.coverage-table--compact th:first-child {
  padding-left: 0;
}

.coverage-table--compact th:last-child {
  padding-right: 0;
}

.coverage-table--compact td {
  padding: 6px 16px 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}

.coverage-table--compact td:first-child {
  padding-left: 0;
}

.coverage-table--compact td:last-child {
  padding-right: 0;
}

.coverage-table--compact tr:last-child td {
  border-bottom: none;
}

/* Coverage table subtotal, fees, and total rows */
.coverage-table__subtotal td,
.coverage-table__fees td,
.coverage-table__total td {
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
  border-bottom: none !important;
}

.coverage-table__subtotal td {
  padding-top: 16px;
}

.coverage-table__fees td {
  color: var(--text-secondary);
  font-size: 12px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
}

.coverage-table__total td {
  padding-top: 10px;
  font-size: 14px;
  border-top: 1px solid var(--border-default);
}

/* ==========================================================================
   QUOTE CARD - Expanded quote display in proposals
   ========================================================================== */

.quote-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.quote-card:last-child {
  margin-bottom: 0;
}

.quote-card__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.quote-card__title-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: color var(--duration-fast);
}

.quote-card__title-link:hover {
  color: var(--accent-primary);
}

.quote-card__title {
  font-size: 17px;
  font-weight: 600;
}

.quote-card__premium {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-primary);
  margin-left: auto;
}

.quote-card__arrow {
  font-size: 14px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--duration-fast), transform var(--duration-fast);
}

.quote-card__title-link:hover .quote-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

.quote-card__details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quote-card__details .data-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 24px;
}

.quote-card__coverages {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.quote-card__coverages > .data-label {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--accent-primary);
}

/* ── Financing Card (proposal show, own section) ── */
.financing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.financing-card:last-child {
  margin-bottom: 0;
}

.financing-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.financing-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.financing-card__market {
  font-size: 13px;
  color: var(--text-secondary);
}

.financing-combine-form {
  background: var(--bg-elevated);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.financing-combine-form__hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.financing-combine-form__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.financing-combine-form__option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.form-input--inline {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.form-input--inline:focus {
  background: var(--bg-surface);
  border-color: var(--accent-primary);
  outline: none;
}

/* Bind Ready Section */
.bind-ready-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bind-ready-info {
  flex: 1;
}

.bind-ready-info p {
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.bind-ready-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   BIND MODAL — Redesigned
   ========================================================================== */

.modal-dialog--lg {
  max-width: 720px;
  width: 92vw;
}

.bind-modal-form .modal-body {
  max-height: 65vh;
  overflow-y: auto;
  padding: 16px 20px;
}

/* ── Per-Policy Card ── */
.bind-policy {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--bg-surface);
}
.bind-policy:last-of-type { margin-bottom: 0; }

.bind-policy__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.bind-policy__id {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bind-policy__badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}



.bind-policy__meta {
  font-size: 11px;
  color: var(--text-muted);
  display: none; /* show on wider screens */
}

.bind-policy__header-fields {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.bind-policy__header-fields .form-select--sm {
  max-width: 260px;
  min-width: 160px;
  text-overflow: ellipsis;
}

.bind-policy__policy-num {
  width: 100px;
  flex-shrink: 0;
}

.bind-policy__body {
  padding: 12px 14px;
}

/* ── Toggle Tabs ── */
.bind-policy__toggle {
  margin-bottom: 10px;
}

.toggle-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-muted);
  padding: 2px;
  border-radius: var(--radius-sm);
}

.toggle-tabs--sm .toggle-tab {
  padding: 4px 10px;
  font-size: 12px;
}

.toggle-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs, 4px);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-tab:hover { color: var(--text-primary); }

.toggle-tab--active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ── Upload: doc type + dropzone as one connected row ── */
.bind-policy__upload {
  margin-bottom: 12px;
}
.bind-policy__upload[hidden] { display: none !important; }

.bind-policy__upload-row {
  display: flex;
  align-items: stretch;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  transition: border-color 0.15s;
  overflow: hidden;
}

.bind-policy__upload-row:hover {
  border-color: var(--accent-primary);
}

.bind-policy__upload-type {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 4px 0 8px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
}

.bind-policy__upload-type .form-select--sm {
  border: none;
  background: transparent;
  box-shadow: none;
  padding-right: 24px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  min-width: 140px;
}

.bind-policy__dropzone-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.file-dropzone--inline {
  border: none;
  background: transparent;
  padding: 8px 14px;
  min-height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: 0;
}

.file-dropzone--inline:hover {
  background: transparent;
  border-color: transparent;
}

.file-dropzone--inline .file-dropzone__content {
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.file-dropzone--inline .file-dropzone__icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.file-dropzone--inline .file-dropzone__text {
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-secondary);
}

.file-preview--compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

/* Manual entry hint */
.bind-policy__manual-hint {
  margin-bottom: 8px;
}
.bind-policy__manual-hint[hidden] { display: none !important; }

/* ── Premium Fields Row ── */
.bind-policy__fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bind-policy__fields[hidden] { display: none !important; }

.bind-policy__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.bind-policy__row--2col { grid-template-columns: repeat(2, minmax(0, 240px)); }
.bind-policy__row--3col { grid-template-columns: repeat(3, minmax(0, 200px)); }
.bind-policy__row--4col { grid-template-columns: repeat(4, minmax(0, 200px)); }

/* Ensure prefix/suffix inputs fill their grid cell */
.bind-policy__row .input-with-prefix,
.bind-policy__row .input-with-suffix { width: 100%; }
.bind-policy__row .input-with-suffix .form-input { width: 100%; }

.bind-policy__row .form-group {
  margin-bottom: 0;
}

/* Small form controls */
.form-select--sm { font-size: 13px; padding: 6px 10px; height: 34px; }
.form-input--sm { font-size: 13px; padding: 6px 10px; height: 34px; }
.input-with-prefix--sm { height: 34px; }
.input-with-prefix--sm .input-prefix { font-size: 12px; padding: 0 8px; }
.input-with-prefix--sm .form-input { font-size: 13px; padding: 6px 8px; }
.input-with-suffix--sm { height: 34px; }
.input-with-suffix--sm .input-suffix { font-size: 12px; padding: 0 8px; }
.input-with-suffix--sm .form-input { font-size: 13px; padding: 6px 8px; }

.form-label--sm {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Policy Total (static row) ── */
.bind-policy__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.bind-policy__subtotal-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bind-policy__subtotal-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Advanced details toggle ── */
.bind-policy__total-details {
  margin-top: 4px;
}

.bind-policy__details-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: all 0.15s;
}
.bind-policy__details-toggle::-webkit-details-marker { display: none; }
.bind-policy__details-toggle:hover { color: var(--text-primary); background: var(--bg-muted); }

.bind-policy__subtotal-chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.bind-policy__total-details[open] .bind-policy__subtotal-chevron {
  transform: rotate(90deg);
}

.bind-policy__total-details[open] .bind-policy__details-toggle {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom-color: transparent;
}

.bind-policy__advanced-content {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bind-policy__field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bind-policy__field-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.bind-policy__computed {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 0;
}

.bind-policy__field-group-hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  font-size: 10px;
}

/* ==========================================================================
   PROPOSAL SUMMARY (bottom of modal)
   ========================================================================== */

.bind-summary {
  margin-top: 16px;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.bind-summary__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.bind-summary__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.bind-summary__quote-count {
  font-size: 12px;
  color: var(--text-muted);
}

.bind-summary__totals {
  padding: 12px 14px 0;
}

.bind-summary__line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.bind-summary__line--sub {
  font-size: 12px;
  color: var(--text-muted);
}

.bind-summary__line--total {
  padding: 8px 0 4px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.bind-summary__divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 8px 14px;
}

.bind-summary__financing {
  padding: 0 14px 14px;
}

.bind-summary__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}


.bind-summary__row--4col { grid-template-columns: repeat(4, 1fr); }

.bind-summary__row .form-group { margin-bottom: 0; }

.bind-summary__computed {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 0;
}

/* ── Modal Footer ── */
.bind-modal-form .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Responsive ── */
@media (min-width: 641px) {
  .bind-policy__meta { display: inline; }
}

@media (max-width: 640px) {
  .bind-policy__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .bind-policy__header-fields {
    width: 100%;
    flex-direction: column;
  }
  .bind-policy__header-fields .form-select--sm { max-width: 100%; }
  .bind-policy__policy-num { width: 100%; }
  .bind-policy__upload-row { flex-direction: column; }
  .bind-policy__upload-type { width: 100%; }
  .bind-policy__row { grid-template-columns: repeat(2, 1fr); }
  .bind-policy__row--3col { grid-template-columns: repeat(2, 1fr); }
  .bind-policy__row--4col { grid-template-columns: repeat(2, 1fr); }
  .bind-summary__row { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   DASHBOARD PAGE - Modern Company View
   ========================================================================== */

.dashboard-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.dashboard-header__main {
  flex: 1;
}

.dashboard-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-header__actions form {
  display: inline-flex;
  margin: 0;
}

.dashboard-header__actions .btn {
  min-height: 38px;
}

.dashboard-header__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-header__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.dashboard-header__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.dashboard-header__edit:hover {
  color: var(--accent-primary);
  background: var(--bg-elevated);
}

/* Contacts Avatar Strip */
.contacts-strip {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast);
}

.contacts-strip:hover {
  background: var(--bg-elevated);
}

.contacts-strip__avatars {
  display: flex;
  align-items: center;
}

.contacts-strip__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--bg-page);
  margin-left: -8px;
  object-fit: cover;
  transition: transform var(--duration-fast);
}

.contacts-strip__avatar:first-child {
  margin-left: 0;
}

.contacts-strip:hover .contacts-strip__avatar {
  transform: translateY(-2px);
}

.contacts-strip__avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--accent-primary);
}

.contacts-strip__avatar--more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-color: var(--bg-page);
}

.contacts-strip__avatar--add {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 2px dashed var(--border-subtle);
  margin-left: 4px;
  transition: all var(--duration-fast);
}

.contacts-strip__avatar--add:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}

.dashboard-header__dot {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
}

.dashboard-header__meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 6px 0 0 0;
  letter-spacing: 0.01em;
}

.dashboard-header__details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.detail-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.dashboard-header__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Company Details Bar — sits below badges in header */
.company-details-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.company-details-bar__item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.company-details-bar__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.company-details-bar__value {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Cargo Visual - shows cargo types as chips in header */
.cargo-visual {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--duration-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.cargo-visual:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.cargo-visual--empty {
  background: var(--bg-surface);
}

.cargo-visual--empty:hover {
  background: var(--bg-surface);
}

.cargo-visual__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cargo-visual__label svg {
  color: var(--text-muted);
}

.cargo-visual__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.cargo-visual__chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.cargo-visual:hover .cargo-visual__chevron {
  color: var(--accent-primary);
}

/* Cargo Chips */
.cargo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.cargo-chip__pct {
  font-weight: 600;
  color: var(--text-primary);
}

/* Category-specific colors */
.cargo-chip--general-freight,
.cargo-chip--general-dry-freight {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.cargo-chip--general-freight .cargo-chip__pct,
.cargo-chip--general-dry-freight .cargo-chip__pct { color: #2563eb; }

.cargo-chip--refrigerated {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
}
.cargo-chip--refrigerated .cargo-chip__pct { color: #0891b2; }

.cargo-chip--hazmat,
.cargo-chip--hazmat-freight {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.cargo-chip--hazmat .cargo-chip__pct,
.cargo-chip--hazmat-freight .cargo-chip__pct { color: #dc2626; }

.cargo-chip--livestock {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}
.cargo-chip--livestock .cargo-chip__pct { color: #16a34a; }

.cargo-chip--auto-hauler,
.cargo-chip--car-hauler {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}
.cargo-chip--auto-hauler .cargo-chip__pct,
.cargo-chip--car-hauler .cargo-chip__pct { color: #9333ea; }

.cargo-chip--heavy-machinery,
.cargo-chip--construction {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.cargo-chip--heavy-machinery .cargo-chip__pct,
.cargo-chip--construction .cargo-chip__pct { color: #d97706; }

.cargo-chip--household-goods {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
}
.cargo-chip--household-goods .cargo-chip__pct { color: #db2777; }

.cargo-chip--intermodal,
.cargo-chip--intermodal-operations,
.cargo-chip--containerized-freight {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}
.cargo-chip--intermodal .cargo-chip__pct,
.cargo-chip--intermodal-operations .cargo-chip__pct,
.cargo-chip--containerized-freight .cargo-chip__pct { color: #4f46e5; }

.cargo-chip--flat-bed {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
}
.cargo-chip--flat-bed .cargo-chip__pct { color: #ea580c; }

.cargo-chip--sand-gravel,
.cargo-chip--scrap-metal {
  background: rgba(120, 113, 108, 0.12);
  color: #78716c;
}
.cargo-chip--sand-gravel .cargo-chip__pct,
.cargo-chip--scrap-metal .cargo-chip__pct { color: #57534e; }

.cargo-chip--medical-supplies {
  background: rgba(20, 184, 166, 0.12);
  color: #14b8a6;
}
.cargo-chip--medical-supplies .cargo-chip__pct { color: #0d9488; }

.cargo-chip--appliances {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}
.cargo-chip--appliances .cargo-chip__pct { color: #475569; }

.cargo-chip--motor-coach {
  background: rgba(217, 70, 239, 0.12);
  color: #d946ef;
}
.cargo-chip--motor-coach .cargo-chip__pct { color: #c026d3; }

.cargo-chip--more {
  background: var(--bg-surface);
  border: 1px dashed var(--card-border);
  color: var(--text-muted);
  font-weight: 600;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.type-badge--trucking {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
}

.type-badge--non_trucking {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.type-badge--personal_line {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.type-badge--radius {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.dashboard-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
}

@media (max-width: 900px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.stat-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-card__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-card__action {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast);
}

.stat-card__action:hover {
  background: var(--accent-primary);
  color: white;
}

.stat-card__value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card__value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-card__value-row .stat-card__value {
  margin-bottom: 0;
}

.stat-card__footer {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card__compare {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-card__link {
  font-size: 12px;
  color: var(--accent-primary);
}

/* Contacts card with list */
.stat-card--contacts {
  display: flex;
  flex-direction: column;
}

.contact-list-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  margin-bottom: 8px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.contact-row:hover {
  background: var(--bg-hover);
  margin: 0 -8px;
  padding: 4px 8px;
}

.contact-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  background: var(--accent-primary);
  flex-shrink: 0;
}

.contact-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card__avatars {
  display: flex;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: white;
  margin-right: -6px;
  border: 2px solid var(--bg-surface);
  background: var(--accent-primary);
}

.mini-avatar--more {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* Compact Clickable Stat Cards */
.stats-row--compact {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.stat-card--clickable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  text-decoration: none;
  transition: all var(--duration-fast);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.stat-card--clickable:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.stat-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card--clickable .stat-card__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card--clickable .stat-card__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin: 0;
}

.stat-card__chevron {
  color: var(--text-muted);
  opacity: 0;
  transition: all var(--duration-fast);
}

.stat-card--clickable:hover .stat-card__chevron {
  opacity: 1;
  color: var(--accent-primary);
}

@media (max-width: 1100px) {
  .stats-row--compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .stats-row--compact {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-card--clickable .stat-card__value {
    font-size: 24px;
  }
}

/* AI Summary Banner (Collapsible) */
.ai-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast);
}

.ai-summary-banner:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
}

.ai-summary-banner--expanded {
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.ai-summary-banner__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-summary-banner__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ai-summary-banner__counts {
  display: flex;
  gap: 6px;
}

.ai-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  color: white;
}

.ai-count--critical {
  background: #dc2626;
}

.ai-count--warning {
  background: #f59e0b;
}

.ai-count--info {
  background: #3b82f6;
}

.ai-count--success {
  background: #22c55e;
}

.ai-summary-banner__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-summary-banner__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.ai-summary-banner__chevron {
  color: var(--text-secondary);
  transition: transform var(--duration-fast);
}

.ai-insights-panel {
  display: none;
}

/* Secondary Navigation (in header) */
.secondary-nav {
  display: flex;
  gap: 6px;
}

.secondary-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
}

.secondary-nav__item:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--bg-surface);
}

.secondary-nav__count {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
}

.secondary-nav__item:hover .secondary-nav__count {
  color: var(--accent-primary);
}

/* AI Filter Buttons */
.ai-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-filters {
  display: flex;
  gap: 4px;
}

.ai-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--duration-fast);
  opacity: 0.35;
}

.ai-filter--active {
  opacity: 1;
}

.ai-filter--critical {
  background: #dc2626;
  color: white;
}

.ai-filter--warning {
  background: #f59e0b;
  color: white;
}

.ai-filter--info {
  background: #3b82f6;
  color: white;
}

.ai-filter--success {
  background: #22c55e;
  color: white;
}

.ai-filter__count {
  font-size: 11px;
  font-weight: 700;
}

/* Dashboard Grid - 2x2 layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px;
}

.dashboard-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

/* Dashboard Grid - 3 column layout */
.dashboard-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .dashboard-grid-3col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .dashboard-grid,
  .dashboard-grid--2col {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid-3col {
    grid-template-columns: 1fr;
  }
}

.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* Dashboard Cards */
.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dashboard-card + .dashboard-card,
.dashboard-grid + .dashboard-card {
  margin-top: 20px;
}

/* Inside grids the gap handles spacing — no extra margin */
.dashboard-grid > .dashboard-card + .dashboard-card {
  margin-top: 0;
}

.dashboard-card--ai {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.dashboard-card--full {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-card--full .dashboard-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-card__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-card__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.title-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border-radius: 11px;
}

.dashboard-card__body {
  padding: 16px 20px;
}

/* Soft Card - subtle background, no border */
.soft-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.soft-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.soft-card__content {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.soft-card__content p {
  margin: 0;
}

.soft-card__content p + p {
  margin-top: 8px;
}

.dashboard-card__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
}

.dashboard-card__section {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

.dashboard-card__section--collapsed {
  background: var(--bg-muted);
}

.data-table--muted {
  opacity: 0.7;
}

.data-table--muted .data-table__row:hover {
  background: var(--bg-hover);
}

.data-table__row--clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.data-table__row--clickable:hover {
  background-color: var(--bg-hover, #f8f9fa);
}

.data-table__row--clickable:hover td {
  background-color: var(--bg-hover, #f8f9fa);
}

.card-link {
  font-size: 13px;
  color: var(--accent-primary);
  font-weight: 500;
}

.section-subtitle {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-list__category {
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}
.task-list__category:first-child {
  margin-top: 0;
  border-top: none;
}

.task-list__section-header {
  margin-top: 16px;
  margin-bottom: 4px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
}
.task-list__section-header:first-child {
  margin-top: 0;
  border-top: none;
}
.task-list__section-header--collapsible {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 10px 0;
  margin: 0;
  border-top: none;
  list-style: none;
  user-select: none;
}
.task-list__section-header--collapsible::-webkit-details-marker { display: none; }
.task-list__section-header--collapsible::marker { display: none; content: ""; }

.task-list__chevron {
  transition: transform 0.15s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}
details[open] > .task-list__section-header--collapsible .task-list__chevron {
  transform: rotate(90deg);
}

.task-list__section-count {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.task-list__section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Document List - Simple list view */
.document-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.document-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--border-subtle);
}

.document-list__item:last-child {
  border-bottom: none;
}

.document-list__item:hover {
  background: var(--bg-hover);
}

.document-list__info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.document-list__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.document-list__version {
  font-size: 12px;
  color: var(--accent-primary);
  font-weight: 500;
}

.document-list__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.document-list__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 0 -12px;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast);
}

.task-item:hover {
  background: var(--bg-hover);
}

.task-item__status {
  flex-shrink: 0;
}

.task-item__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.task-item__content {
  flex: 1;
  min-width: 0;
}

.task-item__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.task-item__meta {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.task-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

/* Status Dots */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot--not_now { background: var(--status-not-now); }
.status-dot--intake { background: var(--status-intake); }
.status-dot--underwriters { background: var(--status-underwriters); }
.status-dot--quoted { background: var(--status-quoted); }
.status-dot--presented { background: var(--status-presented); }
.status-dot--bound { background: var(--status-bound); }
.status-dot--not_taken { background: var(--status-not-taken); }

/* Badge Pill Variant */
.badge--pill {
  border-radius: 20px;
  padding: 4px 10px;
}

/* AI Components */
.ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-icon {
  font-size: 18px;
}

.ai-summary {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
}

.ai-summary-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-summary__content {
  margin-bottom: 12px;
}

.ai-summary__content p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.ai-summary__content p:last-child {
  margin-bottom: 0;
}

.ai-summary__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}

/* AI Insight Cards */
.ai-insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-insights-list--compact {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.ai-insights-list--compact::-webkit-scrollbar {
  width: 6px;
}

.ai-insights-list--compact::-webkit-scrollbar-track {
  background: var(--bg-muted);
  border-radius: 3px;
}

.ai-insights-list--compact::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

.ai-insights-list--compact::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.ai-insight-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border-left: 4px solid var(--text-muted);
}

.ai-insight-card--critical {
  border-left-color: #dc2626;
  background: color-mix(in srgb, #dc2626 5%, var(--bg-surface));
}

.ai-insight-card--warning {
  border-left-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 5%, var(--bg-surface));
}

.ai-insight-card--info {
  border-left-color: #3b82f6;
  background: color-mix(in srgb, #3b82f6 5%, var(--bg-surface));
}

.ai-insight-card--success {
  border-left-color: #22c55e;
  background: color-mix(in srgb, #22c55e 5%, var(--bg-surface));
}

.ai-insight-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ai-insight-card__badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
}

.ai-insight-card--critical .ai-insight-card__badge {
  background: #dc2626;
  color: white;
}

.ai-insight-card--warning .ai-insight-card__badge {
  background: #f59e0b;
  color: white;
}

.ai-insight-card--info .ai-insight-card__badge {
  background: #3b82f6;
  color: white;
}

.ai-insight-card--success .ai-insight-card__badge {
  background: #22c55e;
  color: white;
}

.ai-insight-card__category {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ai-insight-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.ai-insight-card__description {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Fixed height card with scroll */
.dashboard-card--fixed {
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.dashboard-card--fixed .dashboard-card__header {
  flex-shrink: 0;
}

.dashboard-card__body--scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.ai-text {
  font-size: 14px;
  line-height: 1.6;
}

.ai-prompt {
  text-align: center;
  padding: 24px 16px;
}

.ai-prompt--centered {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.ai-prompt__icon {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.ai-prompt__text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

/* Insight List */
.insight-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast);
}

.insight-item:hover {
  background: var(--bg-hover);
}

.insight-item__content {
  min-width: 0;
}

.insight-item__title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.insight-item__meta {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.insight-item__date {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Quick Actions Grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.quick-action:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.quick-action__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.quick-action__icon--blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.quick-action__icon--purple {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.quick-action__icon--green {
  background: rgba(13, 148, 136, 0.15);
  color: #0d9488;
}

.quick-action__icon--orange {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.quick-action__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Empty State Mini */
.empty-state-mini {
  text-align: center;
  padding: 24px 16px;
}

.empty-state-mini p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

/* Extra small button */
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}
/* ==========================================================================
   LIST PAGE - Global Driver/Asset Views
   ========================================================================== */

.list-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.list-header__main {
  flex: 1;
  min-width: 200px;
}

.list-header__nav {
  margin-bottom: 8px;
}

.list-header__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.list-header__title svg {
  color: var(--accent-primary);
}

.list-header__count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: var(--radius-md);
}

.list-header__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.list-search-form {
  display: contents;
}

/* Back link inline variant */
.back-link--inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.back-link--inline:hover {
  color: var(--accent-primary);
}

.back-link--inline svg {
  flex-shrink: 0;
}

/* Search input for list pages */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 220px;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 15%, transparent);
}

.list-content {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

/* List Table */
.list-table {
  width: 100%;
}

.list-table__header {
  display: flex;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.list-table__row {
  display: flex;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--duration-fast);
}

.list-table__row:last-child {
  border-bottom: none;
}

.list-table__row:hover {
  background: var(--bg-hover);
}

.list-table__cell {
  display: flex;
  align-items: center;
  padding-right: 12px;
}

.list-table__cell--name,
.list-table__cell--asset {
  flex: 2;
  gap: 10px;
  font-weight: 500;
}

.list-table__cell--vin {
  flex: 1.5;
}

.list-table__cell--license,
.list-table__cell--type {
  flex: 1;
}

.list-table__cell--companies {
  flex: 1.5;
}

.list-table__cell--dob {
  flex: 1;
}

.list-table__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.list-table__name {
  color: var(--text-primary);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-default);
  margin-top: 4px;
}

.pagination__info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination__controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination__btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.pagination__btn--current {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: var(--text-primary);
  cursor: default;
}

.pagination__btn--current:hover {
  background: var(--text-primary);
  color: var(--bg-base);
}

.pagination__btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination__btn--disabled:hover {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.pagination__btn--gap {
  border: none;
  cursor: default;
  min-width: 24px;
}

.pagination__btn--gap:hover {
  background: transparent;
}

/* Endorsement list columns */
.list-table__cell--id {
  flex: 0 0 100px;
  gap: 10px;
  font-weight: 500;
}

.list-table__cell--company {
  flex: 1.5;
}

.list-table__cell--policy {
  flex: 0 0 140px;
  font-size: 0.8rem;
}

.list-table__cell--contact {
  flex: 1.2;
}

.list-table__cell--type-col {
  flex: 0 0 140px;
}

.list-table__cell--coverages {
  flex: 1;
}

.list-table__cell--items {
  flex: 2;
}

.list-table__cell--er-status {
  flex: 0 0 140px;
  text-align: right;
}

.list-table__cell--date {
  flex: 0 0 110px;
}

/* Claims list columns */
.list-table__cell--claim-ref {
  flex: 0 0 120px;
  gap: 10px;
  font-weight: 500;
}

.list-table__cell--claim-company {
  flex: 1.7;
  min-width: 0;
}

.list-table__cell--claim-policy {
  flex: 0 0 150px;
}

.list-table__cell--claim-party,
.list-table__cell--claim-adjuster {
  flex: 1.1;
  min-width: 0;
}

.list-table__cell--claim-status {
  flex: 0 0 120px;
}

/* Adjusters list columns */
.list-table__cell--adjuster-name {
  flex: 1.3;
  gap: 10px;
  font-weight: 500;
}

.list-table__cell--adjuster-firm,
.list-table__cell--adjuster-phone {
  flex: 1;
  min-width: 0;
}

.list-table__cell--adjuster-email {
  flex: 1.6;
  min-width: 0;
}

.list-table__cell--adjuster-claims {
  flex: 0 0 100px;
}

.list-table__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.list-table__icon--request {
  color: var(--accent-primary);
}

.text-mono {
  font-family: ui-monospace, "SF Mono", Monaco, monospace;
  font-size: 13px;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}
/* ==========================================================================
   DOCUMENT LIST (compact list for global pages)
   ========================================================================== */

.document-list {
  padding: 0;
}

.document-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.document-list__item:last-child {
  border-bottom: none;
}

.document-list__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-md);
  color: #3b82f6;
}

.document-list__content {
  flex: 1;
  min-width: 0;
}

.document-list__name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.document-list__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.document-list__action {
  flex-shrink: 0;
  padding: 6px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.document-list__action:hover {
  background: var(--bg-elevated);
  color: var(--accent-primary);
}

/* VIN Code Styling */
.vin-code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.empty-state__icon {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.empty-state__text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
}

.empty-state--compact {
  padding: 32px 16px;
  background: none;
  border: none;
}

.empty-state--compact .empty-state__icon svg {
  width: 32px;
  height: 32px;
}

.empty-state--compact .empty-state__title {
  font-size: 15px;
}

.empty-state--compact .empty-state__text {
  font-size: 13px;
  margin-bottom: 0;
}

/* Selection List (for drivers/equipment) */
.selection-form {
  max-width: 100%;
}

.selection-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.selection-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.selection-count {
  font-size: 13px;
  color: var(--text-muted);
}

.selection-items {
  max-height: 400px;
  overflow-y: auto;
}

.selection-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.selection-item:last-child {
  border-bottom: none;
}

.selection-item:hover {
  background: var(--bg-elevated);
}

.selection-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.selection-item__content {
  flex: 1;
  min-width: 0;
}

.selection-item__name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.selection-item__details {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.selection-item__link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.selection-item__stated-value {
  /* The stated-value input is rendered on every row in the DOM so toggling
     a checkbox can reveal it without a page reload. By default we hide the
     slot entirely (don't reserve space) — only rows whose checkbox is
     actually checked show the input. This keeps unchecked rows clean while
     still letting CSS flip visibility instantly. */
  display: none;
  align-items: center;
  flex: 0 0 auto;
  width: 180px;
  justify-content: flex-end;
  margin-left: auto;
}

/* Show the stated-value slot when the enclosing row's checkbox is checked.
   :has() is widely supported in evergreen browsers; the selector is scoped
   to the .selection-item label so it only matches the row's own checkbox. */
.selection-item:has(> input[type="checkbox"]:checked) .selection-item__stated-value {
  display: flex;
}

.stated-value-form__label {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated, var(--bg-surface, #fff));
  border: 1px solid var(--border-subtle, #d0d7de);
  border-radius: 4px;
  padding: 0 8px;
  height: 32px;
  width: 100%;
  cursor: text;
}

.stated-value-form__prefix {
  color: var(--text-muted);
  font-size: 13px;
  margin-right: 2px;
}

.stated-value-form__input {
  border: none;
  outline: none;
  background: transparent;
  width: 110px;
  font-size: 13px;
  color: var(--text-primary);
  padding: 0;
}

.stated-value-form__input:focus {
  outline: none;
}

.selection-summary {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated, var(--bg-surface, #fff));
  border: 1px solid var(--border-subtle, #d0d7de);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
}

.selection-summary__warning {
  color: var(--accent-warning, #b54708);
  font-weight: 500;
}

.selection-item__link:hover {
  color: var(--accent);
  background: var(--bg-elevated);
}

/* Market Status Badges */
.market-status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--status-color) 15%, transparent);
  color: var(--status-color);
}
.market-status--not-now { --status-color: var(--status-not-now); }
.market-status--intake { --status-color: var(--status-intake); }
.market-status--with-underwriters { --status-color: var(--status-underwriters); }
.market-status--quoted { --status-color: var(--status-quoted); }
.market-status--presented { --status-color: var(--status-presented); }
.market-status--bound { --status-color: var(--status-bound); }
.market-status--not-taken { --status-color: var(--status-not-taken); }
.market-status--void { --status-color: var(--status-void); }

/* Combobox / Searchable Dropdown */
.combobox {
  position: relative;
}

.combobox-input {
  width: 100%;
}

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow: hidden;
}

.combobox-options {
  max-height: 300px;
  overflow-y: auto;
}

.combobox-option {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.combobox-option:hover,
.combobox-option--selected {
  background: var(--bg-elevated);
}

.combobox-option--selected {
  background: var(--accent-subtle);
}

/* ==========================================================================
   Document Upload - Card Grid (matches Drive Portal)
   ========================================================================== */

/* Document type section */
.doc-type-section {
  margin-bottom: 0;
}

.doc-type-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px 0;
}

/* Section containing type selection */
.doc-type-section {
  margin-bottom: 24px;
}

/* Grid of document type tiles */
.doc-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .doc-type-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .doc-type-grid {
    grid-template-columns: repeat(4, minmax(0, 160px));
    justify-content: center;
  }
}

/* Individual tile wrapper */
.doc-type-tile {
  position: relative;
}

/* Hide the actual radio input */
.doc-type-tile__input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

/* The clickable card label */
.doc-type-tile__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  min-height: 100px;
  height: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-type-tile__label:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Selected state - blue border and light background */
.doc-type-tile__input:checked + .doc-type-tile__label {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* Icon */
.doc-type-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
}

.doc-type-tile__icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.5;
}

/* Text label — kept to a single line so every tile is the same height. */
.doc-type-tile__name {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  line-height: 1.3;
  max-width: 100%;
  white-space: nowrap;
}

/* Pending loss-run row — a placeholder for an expected-but-unuploaded
   loss run, derived from policy history. Visually muted so it reads as
   an action to take, not an existing file. */
.item-row--pending .item-info--pending {
  background: none;
  border: 1px dashed var(--border-default, #cbd5e1);
  border-radius: 8px;
  padding: 10px 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary, #475569);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.item-row--pending .item-info--pending:hover {
  border-color: var(--accent-primary, #3b82f6);
  background: color-mix(in srgb, var(--accent-primary, #3b82f6) 4%, transparent);
  color: var(--text-primary, #0f172a);
}

.item-row--pending .item-title {
  color: var(--text-primary, #0f172a);
}

.item-row--pending .item-subtitle {
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
}

.item-title__context {
  margin-left: 6px;
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
  font-size: 12px;
}

/* Upload form fields section */
.upload-form-fields {
  margin-top: 24px;
}

.upload-form-fields .form-group {
  margin-bottom: 16px;
}

/* Banner shown at the top of the upload form when the user clicked a
   pending "expected loss run" row. Everything but the file is
   already known, so the banner replaces the full metadata form. */
.upload-prefill-banner {
  background: var(--color-info-bg, rgba(59, 130, 246, 0.08));
  border: 1px solid var(--color-info-border, rgba(59, 130, 246, 0.25));
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.upload-prefill-banner__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text, #0f172a);
  margin-bottom: 4px;
}

.upload-prefill-banner__meta {
  font-size: 13px;
  color: var(--color-text-muted, #64748b);
  line-height: 1.5;
}

.upload-prefill-banner__meta strong {
  color: var(--color-text, #0f172a);
  font-weight: 600;
}

/* Scoped dropzone styling for the document upload modal.
   Base .file-dropzone rules live in pages/policies.css; these overrides
   apply only when the dropzone is rendered inside the upload form. */
.upload-form-fields .file-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border-default, #cbd5e1);
  border-radius: 12px;
  padding: 32px 24px;
  background: var(--bg-muted, #f8fafc);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.upload-form-fields .file-dropzone:hover {
  border-color: var(--accent-primary, #3b82f6);
  background: color-mix(in srgb, var(--accent-primary, #3b82f6) 5%, var(--bg-muted, #f8fafc));
}

.upload-form-fields .file-dropzone--active {
  border-color: var(--accent-primary, #3b82f6);
  border-style: solid;
  background: color-mix(in srgb, var(--accent-primary, #3b82f6) 8%, var(--bg-muted, #f8fafc));
  transform: scale(1.005);
}

.upload-form-fields .file-dropzone__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.upload-form-fields .file-dropzone__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  color: var(--accent-primary, #3b82f6);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.upload-form-fields .file-dropzone:hover .file-dropzone__icon,
.upload-form-fields .file-dropzone--active .file-dropzone__icon {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--accent-primary, #3b82f6) 10%, var(--bg-surface, #ffffff));
}

.upload-form-fields .file-dropzone__text {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #475569);
  line-height: 1.5;
}

.upload-form-fields .file-dropzone__text strong {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

.upload-form-fields .file-dropzone__browse {
  pointer-events: auto;
  color: var(--accent-primary, #3b82f6);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.upload-form-fields .file-dropzone__browse:hover {
  text-decoration: underline;
}

.upload-form-fields .file-dropzone__hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

/* File preview card after selection */
.upload-form-fields .file-preview {
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.upload-form-fields .file-preview__info {
  min-width: 0;
  gap: 12px;
}

.upload-form-fields .file-preview__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-primary, #3b82f6) 10%, transparent);
  font-size: 18px;
}

.upload-form-fields .file-preview__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 3px;
  gap: 4px;
  background: var(--surface-secondary);
}

.segmented-control__item {
  position: relative;
  margin: 0;
}

.segmented-control__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control__item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.segmented-control__item input:checked + span {
  background: var(--surface-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--border-color);
}

.upload-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-default);
}

.upload-form-actions .btn {
  min-width: 120px;
}

.document-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  min-height: 120px;
  background: var(--surface-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.document-type-btn:hover {
  border-color: var(--accent-primary);
  background: var(--surface-tertiary);
}

.document-type-btn--selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
}

.document-type-btn__icon {
  font-size: 28px;
  line-height: 1;
  color: var(--text-secondary);
}

.document-type-btn__icon svg {
  width: 32px;
  height: 32px;
}

.document-type-btn:hover .document-type-btn__icon,
.document-type-btn--selected .document-type-btn__icon {
  color: var(--accent-primary);
}

.document-type-btn__name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.2;
}

.document-type-btn__description {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  display: none; /* Hide descriptions for cleaner grid */
}

/* Selected Type Header */
.selected-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--accent-primary-subtle);
  border-radius: 8px;
  margin-bottom: 16px;
}

.selected-type-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   DOCUMENT CARDS (Drive Portal Style)
   ========================================================================== */

.document-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.document-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--surface-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.document-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.document-card--clickable {
  cursor: pointer;
}

.document-card__link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.document-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.document-card__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.document-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card__name:hover {
  color: var(--accent-primary);
}

.document-card__type {
  font-size: 12px;
  color: var(--text-secondary);
}

.document-card__expiry {
  font-size: 11px;
  color: var(--text-tertiary);
}

.document-card__expiry--expired {
  color: var(--accent-danger);
  font-weight: 500;
}

.document-card__date {
  font-size: 11px;
  color: var(--text-tertiary);
}

.document-card__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.document-card:hover .document-card__actions {
  opacity: 1;
}

.document-card__actions .btn {
  padding: 6px;
}

.document-card__actions .btn svg {
  width: 16px;
  height: 16px;
}

/* ── Document thumbnail ── */
.document-card__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-muted, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.document-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.document-card__thumb--pdf {
  color: #ef4444;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.document-card__thumb--file {
  color: var(--text-tertiary);
}

/* Override icon when thumbnail is present */
.document-card:has(.document-card__thumb) .document-card__icon {
  display: none;
}

/* ── Image lightbox overlay ── */
.doc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.doc-lightbox:not([hidden]) {
  display: flex;
}

.doc-lightbox img {
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  cursor: default;
}

.doc-lightbox__filename {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  opacity: 0.7;
}

.doc-lightbox__close:hover {
  opacity: 1;
}

/* Inline Upload Form */
.document-upload-inline {
  margin-bottom: 24px;
  padding: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Typed Upload Modal Wrapper */
.typed-upload-modal {
  padding: 24px 28px;
}

/* Typed Upload Modal Header */
.typed-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.typed-upload-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.typed-upload-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.typed-upload-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.document-upload-inline .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.document-upload-inline .form-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Danger Zone */
.danger-zone {
  margin-top: 48px;
  padding: 24px;
  border: 1px solid var(--accent-danger);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.03);
}

.danger-zone__title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-danger);
}

.danger-zone__description {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Premium Pending Review */
.inline-toggle {
  display: inline-flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.toggle-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Plain-text copy used inside the Financial Impact card when the "pending
   carrier review" toggle is on. The card itself carries the warning color
   (see .dashboard-card--pending-review) so this block intentionally has
   no background, border, or padding — no inner accent box. */
.pending-review-copy {
  color: #78350f;
}

.pending-review-copy__title {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
}

.pending-review-copy__text {
  margin: 0;
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}

/* Whole-card warning treatment applied to the Financial Impact card when
   "Premium pending carrier review" is on. Colors the card top-to-bottom
   instead of using an inner accent block. */
.dashboard-card--pending-review {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #78350f;
}

.dashboard-card--pending-review .dashboard-card__header {
  background: transparent;
  border-bottom-color: rgba(146, 64, 14, 0.18);
}

.dashboard-card--pending-review .dashboard-card__title {
  color: #92400e;
}

.dashboard-card--pending-review .premium-review-toggle__title,
.dashboard-card--pending-review .premium-review-toggle__hint {
  color: #78350f;
}

/* Prominent switch-style toggle shown inside the Financial Impact card. */
.premium-review-toggle {
  margin: 0 0 16px 0;
}

.premium-review-toggle__row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.premium-review-toggle__row:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.premium-review-toggle__row:has(.premium-review-toggle__input:checked) {
  border-color: #fbbf24;
  background: #fffbeb;
}

.premium-review-toggle__switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  margin-top: 2px;
}

.premium-review-toggle__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.premium-review-toggle__track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}

.premium-review-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.premium-review-toggle__input:checked + .premium-review-toggle__track {
  background: #d97706;
}

.premium-review-toggle__input:checked + .premium-review-toggle__track::after {
  transform: translateX(18px);
}

.premium-review-toggle__input:focus-visible + .premium-review-toggle__track {
  outline: 2px solid var(--accent-primary, #0d9488);
  outline-offset: 2px;
}

.premium-review-toggle__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.premium-review-toggle__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}

.premium-review-toggle__hint {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  line-height: 1.45;
}

/* Document Upload Grid */
.document-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.document-upload-grid .form-group {
  margin-bottom: 0;
}

.document-upload-grid .form-group--button {
  padding-bottom: 0;
}

@media (max-width: 768px) {
  .document-upload-grid {
    grid-template-columns: 1fr;
  }
}

/* Documents List */
.documents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.document-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.document-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.document-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.document-item__type {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.document-item__name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.document-item__meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.document-item__actions {
  display: flex;
  gap: 8px;
}

/* Typed Confirmation Modal */
.typed-confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.typed-confirm-modal.is-open,
.typed-confirm-modal.typed-confirm-modal--open,
.typed-confirm-modal.typed-confirm-modal--visible {
  display: flex;
}

.typed-confirm-modal__content {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  overflow: hidden;
}

.typed-confirm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.typed-confirm-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.typed-confirm-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.typed-confirm-modal__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.typed-confirm-modal__body {
  padding: 24px;
}

.typed-confirm-modal__warning {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.typed-confirm-modal__list {
  margin: 0 0 16px 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.typed-confirm-modal__list li {
  padding: 2px 0;
}

.typed-confirm-modal__instruction {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.typed-confirm-modal__instruction strong,
.typed-confirm-modal__word {
  color: var(--text-primary);
  font-weight: 600;
}

.typed-confirm-modal__word-display {
  color: var(--text-primary);
}

.typed-confirm-modal__input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.typed-confirm-modal__confirm-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text-secondary);
}

.typed-confirm-modal__copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px dashed var(--border-default);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.typed-confirm-modal__copy-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.typed-confirm-modal__input {
  width: 100%;
}

.typed-confirm-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border-subtle);
}

.typed-confirm-modal__footer .btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.typed-confirm-modal__footer .btn-danger:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
}

.typed-confirm-modal__footer .btn-danger:disabled {
  background: #fca5a5;
  border-color: #fca5a5;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Arrangement Confirm Dialog (for drag-drop confirmations) */
.arrangement-confirm-dialog {
  border: none;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 0;
  max-width: 420px;
  width: 90vw;
  background: var(--bg-surface);
}

.arrangement-confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.arrangement-confirm-dialog[open] {
  animation: arrangementConfirmFadeIn 0.2s ease;
}

@keyframes arrangementConfirmFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.arrangement-confirm-dialog__content {
  padding: 0;
}

.arrangement-confirm-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}

.arrangement-confirm-dialog__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.arrangement-confirm-dialog__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.arrangement-confirm-dialog__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.arrangement-confirm-dialog__body {
  padding: 16px 24px 24px;
}

.arrangement-confirm-dialog__message {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.arrangement-confirm-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  border-radius: 0 0 16px 16px;
}

/* Master-cert editable limits — collapsible per-coverage sections */
.cert-limits { border: 1px solid var(--border-subtle, #e2e8f0); border-radius: 6px; margin-bottom: 10px; padding: 0; }
.cert-limits > summary { padding: 10px 14px; font-weight: 600; cursor: pointer; user-select: none; font-size: 13px; }
.cert-limits[open] > summary { border-bottom: 1px solid var(--border-subtle, #e2e8f0); }
.cert-limits__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; padding: 12px 14px 14px; }
.cert-limits__grid .cert-field { margin: 0; }
.cert-limits__grid .cert-field__label { font-size: 11px; color: var(--text-secondary, #64748b); margin-bottom: 2px; }
.cert-limits__grid .cert-field__input { font-size: 13px; padding: 5px 8px; }

/* Processing-complete toggle switch on policy show */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 20px;
  background: var(--surface-primary, #fff);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
}
.toggle-switch:hover { border-color: #94a3b8; }
.toggle-switch__track {
  position: relative;
  width: 28px;
  height: 16px;
  background: #cbd5e1;
  border-radius: 8px;
  transition: background 0.15s;
}
.toggle-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-switch--on { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.toggle-switch--on .toggle-switch__track { background: #10b981; }
.toggle-switch--on .toggle-switch__thumb { left: 14px; }
.toggle-switch--sm { padding: 2px 8px; font-size: 11px; gap: 6px; }
.toggle-switch--sm .toggle-switch__track { width: 22px; height: 12px; }
.toggle-switch--sm .toggle-switch__thumb { width: 8px; height: 8px; top: 2px; }
.toggle-switch--sm.toggle-switch--on .toggle-switch__thumb { left: 12px; }
.list-table__cell--processing { flex: 0 0 140px; }

/* Inline NAIC edit on carrier show — compact, single row */
.naic-inline { display: inline; }
.naic-inline__edit {
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface-primary, #fff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 4px;
  cursor: pointer;
}
.naic-inline__form form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.naic-inline__input {
  width: 100px;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 4px;
}

/* Inline Notes Form (Carrier/MGA pages) */
.inline-notes-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-notes-form textarea {
  resize: vertical;
  min-height: 80px;
  font-size: 13px;
}

.inline-notes-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Editable notes — display mode */
.editable-notes__display {
  position: relative;
  cursor: pointer;
  padding: 12px 16px;
  background: var(--surface-secondary, #f8fafc);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.editable-notes__display:hover {
  border-color: var(--border-subtle, #e2e8f0);
}

.editable-notes__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.editable-notes__text p {
  margin: 0 0 8px;
}

.editable-notes__text p:last-child {
  margin-bottom: 0;
}

.editable-notes__edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-primary, #fff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.editable-notes__display:hover .editable-notes__edit-btn {
  opacity: 1;
}

.hidden {
  display: none !important;
}

/* Inline Document Preview Dialog */
.doc-preview-dialog {
  width: 90vw;
  max-width: 900px;
  height: 85vh;
  padding: 0;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.doc-preview-dialog[open] {
  display: flex;
  flex-direction: column;
}

.doc-preview-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.doc-preview-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--bg-elevated, #f8fafc);
  flex-shrink: 0;
}

.doc-preview-dialog__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-preview-dialog__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.doc-preview-dialog__close:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary);
}

.doc-preview-dialog__frame {
  flex: 1;
  width: 100%;
  border: none;
}


/* ==========================================================================
   POLICY ACTIVATION SECTION
   ========================================================================== */

.activation-checklist {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.activation-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
}

.activation-check__icon {
  flex-shrink: 0;
}

.activation-check__icon--success {
  color: var(--accent-success);
}

.activation-check__icon--missing {
  color: var(--accent-warning);
}

.activation-check__label {
  font-size: 0.875rem;
}

.activation-check--met .activation-check__label {
  color: var(--text-secondary);
}

.activation-check--unmet .activation-check__label {
  color: var(--text-primary);
  font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch__slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  transition: all var(--duration-fast);
}

.toggle-switch__slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--bg-surface);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform var(--duration-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-switch__slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-switch__slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-switch__slider {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.toggle-switch__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Activation Confirmation */
.activation-confirmation {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.activation-confirmation__warning {
  display: flex;
  gap: 0.75rem;
  background: color-mix(in srgb, var(--accent-warning) 10%, transparent);
  border: 1px solid var(--accent-warning);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.activation-confirmation__icon {
  flex-shrink: 0;
  color: var(--accent-warning);
}

.activation-confirmation__input {
  max-width: 300px;
}

.activation-blocked {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--accent-warning) 10%, transparent);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Readonly form input */
.form-input--readonly {
  background: var(--bg-muted);
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
}

/* ==========================================================================
   LOSS RUNS ANALYSIS
   ========================================================================== */

.loss-runs-section {
  margin-top: 24px;
}

.subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

/* Premium & Fees card section headings: refined uppercase labels that match
   the card's "Grand Total" label, plus vertical rhythm so sections breathe.
   First heading stays flush to the card body. */
.dashboard-card--premium .subsection-title {
  margin-top: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-card--premium .subsection-title:first-child {
  margin-top: 0;
}

.alert--compact {
  padding: 12px 16px;
  margin-bottom: 8px;
}

.alert--compact .alert__content {
  font-size: 13px;
}

.alert--compact .alert__detail {
  margin: 4px 0 0 0;
  font-size: 12px;
  opacity: 0.85;
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-elevated);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tbody tr:hover {
  background: var(--bg-elevated);
}

.data-table tfoot td {
  background: var(--bg-elevated);
  font-weight: 600;
  border-top: 2px solid var(--border-default);
  border-bottom: none;
}

.data-table .text-right {
  text-align: right;
}

/* Compact embedded tables (inside dashboard cards) */
.data-table--embedded th,
.data-table--embedded td {
  padding: 8px 8px;
  white-space: nowrap;
}

/* Inside grid columns, prevent tables from overflowing their track */
.dashboard-column .data-table--embedded {
  table-layout: fixed;
}

.dashboard-column .data-table--embedded td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table--embedded th {
  font-size: 10px;
}

.data-table--embedded .cell-primary {
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table--embedded .cell-actions {
  width: 1%;
  white-space: nowrap;
}

.data-table--embedded .cell-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--policy-additional-insureds {
  table-layout: fixed;
}

.data-table--policy-additional-insureds .policy-ai-col--name {
  width: 30%;
}

.data-table--policy-additional-insureds .policy-ai-col--relationship {
  width: 16%;
}

.data-table--policy-additional-insureds .policy-ai-col--address {
  width: auto;
}

.data-table--policy-additional-insureds .policy-ai-col--phone {
  width: 14%;
}

.data-table--policy-additional-insureds .policy-ai-col--actions {
  width: 92px;
}

.data-table--policy-additional-insureds .cell-actions form {
  display: inline-flex;
  margin: 0;
}

/* Vehicle schedule tables — fixed columns so every vehicle-type group
   aligns to the same geometry and the Edit PD Value button doesn't shift
   with content width. The Vehicle column flexes; the rest are pinned. */
.data-table--vehicles {
  table-layout: fixed;
  /* Keep the fixed columns from collapsing (and wrapping text vertically) when
     this table is rendered in a narrow container such as the policy side pane.
     The section scrolls horizontally instead — see the overflow rule below. */
  min-width: 640px;
}

.data-table--vehicles .veh-col--vin { width: auto; }
.data-table--vehicles .veh-col--pd { width: 210px; }
.data-table--vehicles .veh-col--payee { width: 122px; }
.data-table--vehicles .veh-col--status { width: 90px; }

/* Year + make shown as a meta line under the VIN (replaces the Vehicle column). */
.vehicle-vin-meta {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-primary);
  overflow-wrap: anywhere;
}

.data-table--vehicles td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

/* Schedule group sections scroll horizontally when the fixed-width vehicle
   tables exceed a narrow container (policy side pane), instead of crushing the
   Vehicle column to zero width. */
.dashboard-card__section[data-schedule-filter-target="group"] {
  overflow-x: auto;
}

/* Driver schedule table — fixed columns for stable alignment. */
.data-table--drivers {
  table-layout: fixed;
  min-width: 680px;
}

.data-table--drivers .drv-col--name { width: auto; }
.data-table--drivers .drv-col--dob { width: 172px; }
.data-table--drivers .drv-col--experience { width: 120px; }
.data-table--drivers .drv-col--license { width: 172px; }
.data-table--drivers .drv-col--status { width: 104px; }

.data-table--drivers td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

/* Terminated (muted) tables have no header row — pin the columns so the
   identifier flexes while the date and endorsement columns stay aligned. */
.data-table--terminated {
  table-layout: fixed;
}

.data-table--terminated td:nth-child(1) { width: auto; }
.data-table--terminated td:nth-child(2) { width: 210px; }
.data-table--terminated td:nth-child(3) { width: 132px; text-align: right; }

.data-table--terminated td {
  overflow-wrap: anywhere;
}

/* Clickable link in table cells */
.table-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.table-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.row--highlight {
  background: color-mix(in srgb, var(--accent-danger) 5%, transparent);
}

.row--highlight:hover {
  background: color-mix(in srgb, var(--accent-danger) 10%, transparent) !important;
}

.recommendations-list {
  margin: 0;
  padding-left: 20px;
}

.recommendations-list li {
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* =======================================
   POLICY SUGGESTIONS FOR LOSS RUNS
   ======================================= */

.policy-suggestions-container {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--accent-bg-light, #f0f9ff);
  border-radius: 12px;
  border: 1px solid var(--accent-border-light, #bae6fd);
}

.policy-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.policy-suggestions-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.policy-suggestions-title svg {
  color: var(--accent-color, #0ea5e9);
}

.policy-suggestions-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.policy-suggestions-hint--success {
  color: var(--success-color, #22c55e);
  font-weight: 500;
}

.policy-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.policy-suggestion-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  font-size: inherit;
}

.policy-suggestion-card:hover {
  border-color: var(--accent-color, #0ea5e9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.policy-suggestion-card:focus {
  outline: 2px solid var(--accent-color, #0ea5e9);
  outline-offset: 2px;
}

.policy-suggestion-card--selected {
  border-color: var(--success-color, #22c55e);
  background: var(--success-bg-light, #f0fdf4);
  box-shadow: 0 0 0 2px var(--success-color, #22c55e);
}

.policy-suggestion-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.policy-suggestion-card__market {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.policy-suggestion-card__status {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.policy-suggestion-card__status--active {
  background: var(--success-bg-light, #dcfce7);
  color: var(--success-color-dark, #166534);
}

.policy-suggestion-card__status--processing {
  background: var(--warning-bg-light, #fef3c7);
  color: var(--warning-color-dark, #92400e);
}

.policy-suggestion-card__status--cancelled {
  background: var(--danger-bg-light, #fee2e2);
  color: var(--danger-color-dark, #991b1b);
}

.policy-suggestion-card__status--renew {
  background: var(--accent-bg-light, #e0f2fe);
  color: var(--accent-color-dark, #075985);
}

.policy-suggestion-card__status--expired {
  background: var(--neutral-bg-light, #e5e7eb);
  color: var(--neutral-color-dark, #374151);
}

.policy-suggestion-card__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.policy-suggestion-card__policy-number {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.policy-suggestion-card__dates {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .policy-suggestions-grid {
    grid-template-columns: 1fr;
  }
  
  .policy-suggestions-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dynamic Fields Container */
.dynamic-fields-container {
  margin-top: 24px;
}

/* File Upload Dropzone */
.file-upload-container {
  margin-top: 24px;
}

.file-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.2s ease;
  background: var(--surface-secondary);
}

.file-dropzone:hover,
.file-dropzone--active {
  border-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
}

.file-dropzone__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.file-dropzone__icon {
  color: var(--text-tertiary);
}

.file-dropzone__text {
  font-size: 14px;
  color: var(--text-secondary);
}

.file-dropzone__browse {
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: underline;
}

.file-dropzone__browse:hover {
  color: var(--accent-primary-dark);
}

.file-dropzone__hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.file-dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-dropzone {
  position: relative;
}

.file-preview[hidden],
.file-preview__status[hidden] {
  display: none !important;
}

.file-preview__status--loading {
  color: var(--accent-primary);
  font-size: 12px;
}

.file-preview__status--success {
  color: var(--color-success, #22c55e);
  font-size: 12px;
}

.file-preview__remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
}

.file-preview__remove:hover {
  color: var(--color-danger, #ef4444);
}

/* File Preview */
.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.file-preview__info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-preview__icon {
  font-size: 24px;
}

.file-preview__name {
  font-weight: 500;
  color: var(--text-primary);
}

.file-preview__size {
  font-size: 12px;
  color: var(--text-secondary);
}

.file-preview__remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tertiary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.file-preview__remove:hover {
  background: var(--accent-danger);
  color: white;
}

/* Submit Container */
.file-upload-container + .form-actions,
[data-document-upload-target="submitContainer"] {
  margin-top: 24px;
}

/* Analysis Results */
.stat-cards--compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .stat-cards--compact {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stat-cards--compact {
    grid-template-columns: 1fr;
  }
}

.stat-cards--compact .stat-card {
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-cards--compact .stat-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  order: 1;
}

.stat-cards--compact .stat-card__value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  order: 2;
  margin: 0;
}

/* Alert Styles */
.alert {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: 8px;
  margin: 24px 0;
}

/* Section Header Actions */
.section-header__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* IFTA States inline */
.ifta-states {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.ifta-states__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.alert--warning {
  background: color-mix(in srgb, var(--accent-warning) 10%, transparent);
  border: 1px solid var(--accent-warning);
}

.alert--danger {
  background: color-mix(in srgb, var(--accent-danger) 10%, transparent);
  border: 1px solid var(--accent-danger);
}

.alert--success {
  background: color-mix(in srgb, var(--accent-success) 10%, transparent);
  border: 1px solid var(--accent-success);
}

.alert__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.alert__content {
  flex: 1;
}

.alert__title {
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.alert__list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.alert__list li {
  margin-bottom: 4px;
}

/* Tag List */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #1e40af;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.tag:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
  text-decoration: none;
}

/* Document Detail Layout */
.document-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 768px) {
  .document-detail-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.document-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.document-preview__image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.document-preview__embed {
  width: 100%;
  height: 400px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-secondary);
}

.document-preview__pdf,
.document-preview__file,
.document-preview__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  background: var(--surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
}

.document-preview__icon {
  font-size: 48px;
  line-height: 1;
}

.document-preview__filename {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.document-preview__download {
  width: 100%;
  justify-content: center;
}

.document-details {
  flex: 1;
}

.document-details .data-grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 600px) {
  .document-details .data-grid {
    grid-template-columns: 1fr;
  }
}

/* Code Block */
.code-block {
  background: var(--surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Detail Section */
.detail-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  cursor: pointer;
}

.detail-section-title:not(:first-child) {
  margin-top: 20px;
}

/* Item list for endorsement details */
.item-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.item-list__item:last-child {
  margin-bottom: 0;
}

.item-list__item--added {
  border-left: 3px solid var(--color-success);
}

.item-list__item--removed {
  border-left: 3px solid var(--color-danger);
}

.item-list__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.item-list__item--added .item-list__icon {
  color: var(--color-success);
}

.item-list__item--removed .item-list__icon {
  color: var(--color-danger);
}

.item-list__name {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.item-list__meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.item-list__value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.item-list__value-form {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.item-list__value-form .input-prefix {
  font-size: 13px;
  color: var(--text-secondary);
}

.item-list__value-form .form-input--inline {
  width: 100px;
  padding: 2px 6px;
  font-size: 13px;
}

details.detail-section > summary {
  list-style: none;
}

details.detail-section > summary::-webkit-details-marker {
  display: none;
}

details.detail-section > summary::before {
  content: "▶ ";
  font-size: 10px;
  margin-right: 4px;
}

details.detail-section[open] > summary::before {
  content: "▼ ";
}

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.detail-value {
  font-size: 14px;
  color: var(--text-primary);
}

/* ==========================================================================
   RISK ASSESSMENT SHOW PAGE
   ========================================================================== */

.risk-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.risk-header__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.risk-header__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.risk-header__badges {
  display: flex;
  gap: 6px;
}

.risk-header__policy-ref {
  font-size: 13px;
  color: var(--text-muted);
}

.risk-header__policy-ref a {
  color: var(--text-secondary);
  text-decoration: none;
}

.risk-header__policy-ref a:hover {
  color: var(--accent-primary);
}

.risk-header__assignee {
  margin-top: 4px;
}

/* Deadline Bar */
.risk-deadline-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-top: 8px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-warning) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-warning) 30%, transparent);
  font-size: 13px;
  color: var(--text-primary);
}

.risk-deadline-bar--overdue {
  background: color-mix(in srgb, var(--accent-danger) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent-danger) 30%, transparent);
}

.risk-deadline-bar--overdue .risk-deadline-bar__icon {
  color: var(--accent-danger);
}

.risk-deadline-bar--overdue .risk-deadline-bar__countdown {
  color: var(--accent-danger);
  font-weight: 600;
}

.risk-deadline-bar--resolved {
  background: color-mix(in srgb, var(--accent-success) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent-success) 30%, transparent);
}

.risk-deadline-bar__icon {
  flex-shrink: 0;
  color: var(--accent-warning);
}

.risk-deadline-bar__text strong {
  font-weight: 600;
}

.risk-deadline-bar__countdown {
  color: var(--accent-warning);
  font-weight: 500;
}

/* Inline select for progress status */
.form-select--inline {
  padding: 4px 28px 4px 8px;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 140px;
}

.form-select--inline:hover {
  border-color: var(--accent-primary);
}

.form-select--inline:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

/* System note styling in comments */
.comment--system {
  opacity: 0.75;
}

.comment--system:hover {
  opacity: 1;
}

.comment-avatar--system {
  background: var(--bg-muted);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
}

.comment-author--system {
  font-weight: 500;
  color: var(--text-muted);
}

.comment-content--system {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.comment-content--system p {
  margin: 0;
}

/* Comment form wrapper in dashboard card */
.comment-form-wrapper {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Risk assessment single-column layout */
.risk-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Risk assessment document upload modal — scrollable content */
.risk-layout .modal-dialog--lg {
  max-width: 780px;
  width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
}

/* @ Mention autocomplete */
.mention-wrapper {
  position: relative;
}

.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  margin-bottom: 4px;
}

.mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}

.mention-option:hover,
.mention-option--active {
  background: var(--bg-elevated);
}

.mention-option__icon {
  flex-shrink: 0;
  font-size: 14px;
}

.mention-option__name {
  flex: 1;
  font-weight: 500;
}

.mention-option__type {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Rendered @mention links in note bodies */
.mention-link {
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  padding: 0 2px;
}

.mention-link--carrier,
.mention-link--mga {
  color: var(--accent-primary);
}

.mention-link--carrier:hover,
.mention-link--mga:hover {
  text-decoration: underline;
}

.mention-link--user {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
}


/* ==========================================================================
   INDEX SECTION SUBLABELS (Recently bound / All other)
   ========================================================================== */

/* Section sublabels used to split the policies indexes into "Recently bound"
   and "All other policies" buckets. The accent variant gets a colored dot +
   underline to draw the eye to the new group; the plain variant sits quietly
   above the main list. The trailing pill is the section count.

   We set *our own* horizontal padding (16px) so the heading stays aligned
   with the list-table rows below it regardless of whether the container
   (.list-content on /global/policies, .section-body on /companies/:id/
   policies) adds its own padding. .section--no-header zeros out the top
   padding of .section-body, so we need an explicit top padding here too. */
.section-sublabel {
  margin: 24px 0 0 0;
  padding: 16px 16px 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* First heading inside any container: no extra top margin, but keep the
   top padding so it's not flush against the container edge. */
.section-sublabel:first-child {
  margin-top: 0;
}

/* Recently-bound variant: colored dot with a soft halo + tinted underline. */
.section-sublabel--accent {
  color: var(--accent-primary);
  border-bottom-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-subtle));
}

.section-sublabel--accent::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-primary) 18%, transparent);
  flex-shrink: 0;
}

.section-sublabel--policy-status {
  border-bottom-color: var(--border-subtle);
}

.section-sublabel--policy-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-sublabel--policy-status-active::before {
  background: var(--accent-success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-success) 16%, transparent);
}

.section-sublabel--policy-status-renew::before {
  background: var(--accent-warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-warning) 16%, transparent);
}

.section-sublabel--policy-status-expired::before {
  background: var(--text-muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-muted) 16%, transparent);
}

.section-sublabel--policy-status-cancelled::before {
  background: var(--accent-danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-danger) 16%, transparent);
}

/* Trailing count pill, right-aligned. */
.section-sublabel__meta {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

/* Vertical spacer between the two policy buckets on /global/policies so
   the flat list-table layout still reads as two distinct sections. */
.policy-group-spacer {
  height: 24px;
}

.policy-premium-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.policy-premium-actions__inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.policy-premium-actions form {
  margin: 0;
}

/* Neutralize the global "[data-controller] + [data-controller]" form-spacing
   rule (components/forms.css): the dialog-trigger buttons in this header both
   carry data-controller, so the second one inherits a stray 16px top margin
   that knocks it out of vertical alignment. */
.policy-premium-actions__inline .policy-premium-action {
  margin: 0;
}

.policy-premium-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.policy-premium-action:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  box-shadow: 0 1px 2px rgb(15 23 42 / 8%);
}

/* ==========================================================================
   COVERAGE EDIT BUTTON (policy show → draft Correction endorsement)
   ========================================================================== */

.coverage-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 4px);
  padding: 2px 8px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.coverage-edit-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
}

.coverage-edit-btn svg {
  flex-shrink: 0;
}

.coverage-edit-dialog .form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.coverage-edit-dialog .form-row .form-group {
  margin-bottom: 0;
}

.form-label__muted {
  color: var(--text-muted);
  font-weight: 400;
}

/* Coverage corrections display inside the endorsement show page. */
.correction-prev {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 13px;
}
.correction-arrow {
  margin: 0 6px;
  color: var(--text-muted);
}
.correction-next {
  font-weight: 600;
  color: var(--accent-primary);
}
.correction-unchanged {
  color: var(--text-muted);
  font-size: 13px;
}
.endorsement-status-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Policy Provisions ──────────────────────────────────────────── */
.provision-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 8px;
}

.provision-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 20%, transparent);
  border-radius: 999px;
  white-space: nowrap;
}

.provision-pill svg {
  flex-shrink: 0;
}

.provision-pill__beneficiary {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Embedded table filter/sort ──────────────────────────────────── */

.embedded-table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.embedded-table-filters__search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 5px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  transition: border-color 0.15s;
}

.embedded-table-filters__search:focus-within {
  border-color: var(--accent-primary);
}

.embedded-table-filters__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  line-height: 1.5;
}

.embedded-table-filters__input::placeholder {
  color: var(--text-muted);
}

.embedded-table-filters__select {
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  line-height: 1.5;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s;
}

.embedded-table-filters__select:focus {
  border-color: var(--accent-primary);
  outline: none;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 18px !important;
}

.sortable-header:hover {
  color: var(--text-primary);
}

.sortable-header::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-top-color: var(--border-default);
  margin-top: 3px;
}

.sortable-header::before {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-bottom-color: var(--border-default);
  margin-top: -7px;
}

.sortable-header.sort-asc::before {
  border-bottom-color: var(--text-primary);
}

.sortable-header.sort-desc::after {
  border-top-color: var(--text-primary);
}

.sortable-header.text-right::before,
.sortable-header.text-right::after {
  right: auto;
  left: -2px;
}

/* ── Embedded table pagination ─────────────────────────────────── */

.embedded-table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
}

.embedded-table-pagination__info {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}

.embedded-table-pagination__btn {
  padding: 3px 10px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.embedded-table-pagination__btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.embedded-table-pagination__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.table-notes-cell {
  max-width: 200px;
  white-space: normal !important;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Schedule filter bar (drivers / vehicles tables) */
.schedule-filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle, #f8fafc);
}

.schedule-filter-bar__search {
  flex: 1;
  min-width: 0;
}

.schedule-filter-bar__sort,
.schedule-filter-bar__filter {
  width: auto;
  min-width: 140px;
}

.policy-vehicle-pd-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 190px;
}

.policy-vehicle-pd-cell__value {
  font-weight: 700;
  white-space: nowrap;
  /* Fixed-width, right-aligned so the Edit PD Value button lands at the same
     x on every row regardless of the value (incl. the empty "—" rows). */
  display: inline-block;
  min-width: 80px;
  text-align: right;
}

/* Edit Coverage Premiums dialog — per-coverage grouping */
.premium-edit-coverage {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.premium-edit-coverage:last-of-type {
  border-bottom: none;
}

.premium-edit-coverage__title {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.premium-edit-coverage__special {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm, 6px);
}

.premium-edit-coverage__special-row {
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 6px;
}

.premium-edit-coverage__special-row .form-label--inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.premium-edit-coverage__toggle {
  align-self: center;
  margin-top: 18px;
}

.premium-edit-tiv-note {
  margin: 8px 0 0;
}

/* Read-only calculated "Total Premium" display */
.premium-edit-total__value {
  display: block;
  padding: 8px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-primary);
  font-weight: 700;
}

.policy-ai-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.policy-ai-modal__intro {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.policy-ai-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.policy-ai-panel {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-base);
  padding: 16px;
}

.policy-ai-panel--secondary {
  background: var(--bg-subtle, #f8fafc);
}

.policy-ai-panel__header {
  margin-bottom: 14px;
}

.policy-ai-panel__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
}

.policy-ai-panel__hint {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.policy-ai-search .search-input {
  min-height: 44px;
}

.policy-ai-csv-schema {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.policy-ai-csv-schema span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}

.policy-ai-upload-form {
  display: grid;
  gap: 12px;
}

.policy-ai-upload-form__file {
  width: 100%;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  color: var(--text-secondary);
  padding: 10px;
  font-size: 13px;
}

.policy-ai-upload-form__file::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
}

@media (max-width: 780px) {
  .policy-ai-modal__grid {
    grid-template-columns: 1fr;
  }
}

.special-transactions-section {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px 16px;
  background: var(--bg-subtle, #f8fafc);
}

.special-transactions-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.special-transactions-hint {
  margin: 8px 0 12px;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
}

.form-input--sm {
  padding: 6px 10px;
  font-size: 13px;
  height: 32px;
}

.schedule-exclusions-section {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
}

.schedule-exclusions-section .pill-list {
  margin-top: 6px;
}

/* Manual schedule (add driver/vehicle without endorsement) */
.manual-schedule__search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.manual-schedule__search-row .form-input {
  flex: 1;
}

.manual-schedule__count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.manual-schedule__list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-default);
  border-radius: 6px;
}

.manual-schedule__list:empty {
  display: none;
}

.manual-schedule__search-results {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  margin-top: 4px;
}

.manual-schedule__check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.manual-schedule__check-row:last-child {
  border-bottom: none;
}

.manual-schedule__check-row:hover {
  background: var(--bg-hover);
}

.manual-schedule__check-row[hidden] {
  display: none;
}

.manual-schedule__check-row--disabled {
  opacity: 0.45;
  cursor: default;
}

.manual-schedule__check-row--select-all {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 1;
}

.manual-schedule__check-row--search {
  border: none;
}

.manual-schedule__check-row--search .manual-schedule__check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-default);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manual-schedule__check-row--search .manual-schedule__check-icon svg {
  opacity: 0;
}

.manual-schedule__check-row--active .manual-schedule__check-icon {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.manual-schedule__check-row--active .manual-schedule__check-icon svg {
  opacity: 1;
  stroke: white;
}

.manual-schedule__checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.manual-schedule__check-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.manual-schedule__check-info strong {
  font-weight: 500;
  color: var(--text-primary);
}

.manual-schedule__check-info .text-muted {
  font-size: 12px;
}

.manual-schedule__notice {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

#manual-add-driver-dialog .form-row,
#manual-add-vehicle-dialog .form-row {
  grid-template-columns: 1fr 1fr;
}
/* ==========================================================================
   E-SIGNATURE STATUS BANNER
   ========================================================================== */

.esig-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border-default, #e5e7eb);
  background: var(--color-bg-surface, #fff);
}

.esig-banner__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.8125rem;
}

.esig-banner__icon {
  flex-shrink: 0;
}

.esig-banner__label {
  color: var(--text-secondary, #6b7280);
}

.esig-banner__badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.esig-banner__details {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
}

.esig-banner__detail + .esig-banner__detail::before {
  content: "·";
  margin-right: 6px;
}

/* Sent / Viewed */
.esig-banner--sent {
  border-color: #fbbf24;
  background: #fffbeb;
}
.esig-banner--sent .esig-banner__icon { color: #d97706; }
.esig-banner--sent .esig-banner__badge {
  background: #fef3c7;
  color: #92400e;
}

/* Completed */
.esig-banner--completed {
  border-color: #34d399;
  background: #ecfdf5;
}
.esig-banner--completed .esig-banner__icon { color: #059669; }
.esig-banner--completed .esig-banner__badge {
  background: #d1fae5;
  color: #065f46;
}

/* Declined / Expired */
.esig-banner--alert {
  border-color: #fca5a5;
  background: #fef2f2;
}
.esig-banner--alert .esig-banner__icon { color: #dc2626; }
.esig-banner--alert .esig-banner__badge {
  background: #fee2e2;
  color: #991b1b;
}

.esig-banner__sync {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  background: white;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  margin-left: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.esig-banner__sync:hover {
  color: var(--text-primary, #1f2937);
  border-color: var(--text-secondary, #6b7280);
}
.esig-banner__sync:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Draft */
.esig-banner--draft {
  border-color: #d1d5db;
  background: #f9fafb;
}
.esig-banner--draft .esig-banner__icon { color: #6b7280; }
.esig-banner--draft .esig-banner__badge {
  background: #f3f4f6;
  color: #374151;
}

/* ==========================================================================
   ENDORSEMENT FORM - Estimate Card & Checkbox Lists
   ========================================================================== */

/* Checkbox List */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.checkbox-item:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
}

.checkbox-item input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-label {
  color: var(--text-primary);
}

.checkbox-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.checkbox-label strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 2px;
}

/* Estimate Card */
.estimate-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.estimate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.estimate-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.estimate-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.estimate-value.positive {
  color: var(--accent-success);
}

.estimate-value.negative {
  color: var(--accent-danger);
}

.estimate-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.estimate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.estimate-row span:last-child {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* ==========================================================================
   ENDORSEMENT EDIT FORM - Card Layout
   ========================================================================== */

.endorsement-edit-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

/* Cards — match builder style */
.endorsement-edit-layout .endorsement-card {
  background: var(--bg-surface, #f9fafb);
  border: 1px solid #d1d5db;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: visible;
}

.endorsement-edit-layout .endorsement-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
}

.endorsement-edit-layout .endorsement-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.endorsement-edit-layout .endorsement-card__body {
  padding: 1.5rem;
}

.endorsement-edit-layout .endorsement-card__subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
}

/* Item lists (remove checkboxes) */
.endorsement-item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.endorsement-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.endorsement-item-row:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.endorsement-item-row__check {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.endorsement-item-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.endorsement-item-row__info strong {
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 600;
}

.endorsement-item-row__info .text-muted {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Toggle variant (premium pending) */
.endorsement-item-row--toggle {
  cursor: pointer;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  background: #ffffff;
  transition: all 0.15s ease;
}

.endorsement-item-row--toggle:hover {
  border-color: #cbd5e1;
}

.endorsement-item-row--toggle .toggle-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

/* Form layout helpers */
.endorsement-edit-layout .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.endorsement-edit-layout .form-row:last-child {
  margin-bottom: 0;
}

.endorsement-edit-layout .form-group {
  margin-bottom: 0;
}

.endorsement-edit-layout .form-group:last-child {
  margin-bottom: 0;
}

/* Search within cards */
.endorsement-edit-layout .search-input-wrapper {
  position: relative;
  z-index: 40;
}

.endorsement-edit-layout .search-input-wrapper:focus-within {
  z-index: 80;
}

.endorsement-edit-layout .search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1200;
  margin-top: 4px;
}

.endorsement-edit-layout .search-suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.endorsement-edit-layout .search-suggestion:hover {
  background: #f8fafc;
}

.endorsement-edit-layout .search-suggestion:last-child {
  border-bottom: none;
}

.endorsement-edit-layout .search-suggestion.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.endorsement-edit-layout .search-suggestion__content {
  flex: 1;
}

.endorsement-edit-layout .search-suggestion__name {
  font-weight: 500;
  font-size: 0.9375rem;
}

.endorsement-edit-layout .search-suggestion__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.endorsement-edit-layout .search-suggestion__badges {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.endorsement-edit-layout .search-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.endorsement-edit-layout .search-badge.on-account {
  background: #dbeafe;
  color: #1e40af;
}

.endorsement-edit-layout .search-badge.new-to-account {
  background: #fef3c7;
  color: #92400e;
}

.endorsement-edit-layout .search-badge.on-policy {
  background: #fee2e2;
  color: #991b1b;
}

.endorsement-edit-layout .search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Inline new item form */
.new-item-form {
  margin-top: 1rem;
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}

.new-item-form__title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.new-item-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

/* Inline file upload */
.file-upload-inline {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px 16px;
  background: #ffffff;
}

.file-upload-inline__input {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.file-upload-inline__input::file-selector-button {
  background: var(--bg-surface, #f1f5f9);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.15s;
}

.file-upload-inline__input::file-selector-button:hover {
  background: #e2e8f0;
}

/* Actions bar */
.endorsement-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 0.5rem;
}

/* Utility spacing */
.endorsement-edit-layout .mt-4 {
  margin-top: 1.5rem;
}

.endorsement-edit-layout .mb-4 {
  margin-bottom: 1rem;
}

.endorsement-edit-layout .mb-3 {
  margin-bottom: 0.75rem;
}

/* Autocomplete for entity fields (Loss Payee, Additional Insured) */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 2px;
}

.autocomplete-suggestion {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
}

.autocomplete-suggestion:hover {
  background: var(--bg-hover, #f8fafc);
}

.autocomplete-suggestion__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.autocomplete-suggestion__meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Context banner shown above description on edit */
.form-context-banner {
  background: var(--info-bg, #f0f6ff);
  border: 1px solid var(--info-border, #c4d9f0);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-line;
}

.form-context-banner span p {
  display: inline;
  margin: 0;
}

.form-context-banner span p + p::before {
  content: "\A";
  white-space: pre;
}

/* Description content on show page */
.endorsement-description-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-line;
}

.endorsement-description-content p {
  margin: 0 0 4px;
}

/* Responsive */
@media (max-width: 600px) {
  .endorsement-edit-layout .form-row {
    grid-template-columns: 1fr;
  }

  .endorsement-edit-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .endorsement-edit-actions .btn {
    text-align: center;
  }
}

/* ==========================================================================
   Financial Impact inline editor on endorsement show
   ========================================================================== */

.financial-impact-form .form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}

.financial-impact-form .form-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.financial-impact-form .form-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.financial-impact-form .form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  display: block;
}

.detail-list--total-only {
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  padding-top: 10px;
}

/* Right-aligned cluster (badge + save button) in the Financial Impact
   card header. */
.dashboard-card__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

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

/* ==========================================================================
   MGA Submission Reference Card — copy-paste helpers on endorsement show
   ========================================================================== */

.mga-reference-card {
  margin-bottom: 24px;
}

.mga-reference-card .dashboard-card__subtitle {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  margin-top: 2px;
}

.mga-reference-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.mga-reference-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  background: var(--bg-muted, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
}

.mga-reference-item dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.mga-reference-item dd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.mga-reference-item__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary, #0f172a);
  font-size: 0.875rem;
}

.mga-reference-item__value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
}

a.mga-reference-item__value {
  color: var(--accent-primary, #2563eb);
  text-decoration: none;
}

a.mga-reference-item__value:hover {
  text-decoration: underline;
}

.mga-reference-item__copy {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  background: #ffffff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mga-reference-item__copy:hover {
  color: var(--text-primary, #0f172a);
  border-color: var(--border-strong, #cbd5e1);
}

.mga-reference-item__copy.copied {
  color: var(--success, #059669);
  border-color: var(--success, #059669);
}

@media (max-width: 640px) {
  .mga-reference-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Reference links: multi-value row with add/remove affordances */
.mga-reference-item--links dd {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

/* ==========================================================================
   MULTI-POLICY ENDORSEMENT BANNER
   ========================================================================== */

.multi-endorsement-policies-banner {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-left: 4px solid var(--accent, #0d9488);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.multi-endorsement-policies-banner__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
}

.multi-endorsement-policies-banner__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.multi-endorsement-policies-banner__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-muted, #f1f5f9);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #0f172a);
}

/* Multi-policy button on the board add-card */
.column-add-card--multi {
  font-size: 11px;
  opacity: 0.8;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  padding-top: 6px;
  margin-top: 4px;
}

.column-add-card--multi:hover {
  opacity: 1;
}

/* Wider modal for multi-policy picker */
.add-risk-modal--wide {
  max-width: 560px;
}

.modal-dialog--discovery {
  max-width: 860px;
  transition: max-width 0.25s ease;
}

.modal-dialog--discovery .add-risk-modal--wide {
  max-width: none;
}

.add-risk-modal__sublabel {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin: 0 0 12px;
}

.add-risk-modal__select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  margin-bottom: 8px;
  cursor: pointer;
}

.add-risk-modal__policy-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.add-risk-modal__policy-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.add-risk-modal__policy-check:hover {
  background: var(--bg-hover, #f1f5f9);
}

.add-risk-modal__policy-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #0d9488);
}

.add-risk-modal__policy-check-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.add-risk-modal__policy-check-meta {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* Coverage badges on policy checkboxes */
.add-risk-modal__policy-check-coverages {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* ── Discovery View ──────────────────────────────── */
.discovery-view {
  max-height: 60vh;
  overflow-y: auto;
}

.discovery-company-card {
  background: var(--bg-elevated, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  padding: 16px;
}

.discovery-company-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.discovery-company-card__name {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 2px;
}

.discovery-company-card__dba {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin: 0;
}

.discovery-company-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.discovery-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-secondary, #475569);
  border: 1px solid var(--border-subtle, #e2e8f0);
}

.discovery-company-card__grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.discovery-company-card__section {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.discovery-company-card__summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.discovery-summary-stat {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.discovery-summary-stat strong {
  color: var(--text-primary, #1e293b);
  font-weight: 600;
}

.discovery-summary-sep {
  width: 1px;
  height: 12px;
  background: var(--border-subtle, #cbd5e1);
  display: inline-block;
  vertical-align: middle;
}

.discovery-detail {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.discovery-detail strong {
  color: var(--text-primary, #1e293b);
}

.discovery-policies-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discovery-policy-card {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--bg-surface, #fff);
  display: flex;
  flex-direction: column;
}

.discovery-policy-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.discovery-policy-card__headline {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discovery-policy-card__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.discovery-policy-card__header strong {
  font-size: 13px;
  white-space: nowrap;
}

.discovery-policy-status {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.discovery-policy-status--active { background: color-mix(in srgb, var(--accent-success, #16a34a) 12%, transparent); color: var(--accent-success, #16a34a); }
.discovery-policy-status--renew { background: color-mix(in srgb, var(--accent-warning, #d97706) 12%, transparent); color: var(--accent-warning, #d97706); }
.discovery-policy-status--cancelled { background: color-mix(in srgb, var(--accent-danger, #dc2626) 12%, transparent); color: var(--accent-danger, #dc2626); }
.discovery-policy-status--expired { background: color-mix(in srgb, var(--text-muted, #94a3b8) 16%, transparent); color: var(--text-secondary, #64748b); border: 1px solid color-mix(in srgb, var(--text-muted, #94a3b8) 28%, transparent); }

.discovery-policy-card__coverages {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 0 1 auto;
}

.discovery-policy-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary, #64748b);
}

.discovery-policy-card__meta span {
  min-width: 0;
}

.discovery-policy-card__meta a {
  font-weight: 500;
}

.discovery-policy-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.discovery-policy-card__days {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  flex-shrink: 0;
}

.discovery-policy-card__details {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .discovery-policy-card__header {
    flex-direction: column;
    gap: 10px;
  }

  .discovery-policy-card__actions {
    width: 100%;
    justify-content: space-between;
  }
}

.discovery-coverage-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: var(--bg-accent-subtle, #f0fdfa);
  color: var(--text-accent, #0d9488);
  border: 1px solid var(--border-accent-subtle, #99f6e4);
}

.discovery-coverage-badge--sm {
  font-size: 9px;
  padding: 0 5px;
}

.discovery-policy-card__footer {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

/* Endorsement list inside discovery policy card */
.discovery-policy-card__endorsements {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.discovery-endo-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.discovery-endo-toolbar {
  margin: 0 0 6px;
}

.discovery-endo-search {
  width: 100%;
  min-height: 30px;
  font-size: 12px;
}

.discovery-endo-empty {
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.discovery-endo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.discovery-endo-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  padding: 2px 6px 4px 0;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.discovery-endo-table td {
  padding: 3px 6px 3px 0;
  vertical-align: middle;
  white-space: nowrap;
}

.discovery-endo-desc {
  white-space: normal;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary, #64748b);
}

.endorsement-description-trigger {
  margin-left: 6px;
  vertical-align: baseline;
}

.endorsement-description-dialog__text {
  color: var(--text-secondary, #64748b);
  font-size: 14px;
  line-height: 1.55;
  white-space: normal;
}

.endorsement-description-dialog__text p {
  margin: 0 0 10px;
}

.endorsement-description-dialog__text p:last-child {
  margin-bottom: 0;
}

.discovery-endo-ref {
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.discovery-endo-date {
  color: var(--text-secondary, #64748b);
}

.discovery-endo-row--void {
  opacity: 0.4;
}

.discovery-endo-more {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
  text-align: center;
}

.discovery-special-transactions {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--border-default, #cbd5e1);
  border-radius: 8px;
  background: var(--bg-subtle, #f8fafc);
}

.discovery-special-transactions summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.discovery-special-transactions .discovery-endo-table {
  margin-top: 8px;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
}
.sortable-th:hover {
  color: var(--text-primary, #1e293b);
}
.sortable-th::after {
  content: "⇅";
  margin-left: 3px;
  font-size: 9px;
  opacity: 0.35;
}
.sortable-th.sorted-asc::after {
  content: "↑";
  opacity: 0.8;
}
.sortable-th.sorted-desc::after {
  content: "↓";
  opacity: 0.8;
}

/* ==========================================================================
   COMPANY LOOKUP PAGE — roster tables and layout
   ========================================================================== */

.lookup-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}

.lookup-policy-link {
  color: var(--text-primary, #1e293b);
  text-decoration: none;
}

.lookup-policy-link:hover {
  color: var(--accent-primary, #2563eb);
  text-decoration: underline;
}

.lookup-roster {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.lookup-roster__header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.lookup-roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lookup-roster-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  padding: 3px 8px 4px 0;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.lookup-roster-table td {
  padding: 4px 8px 4px 0;
  vertical-align: middle;
  color: var(--text-primary, #1e293b);
}

.lookup-roster-table a {
  color: var(--accent-primary, #2563eb);
  text-decoration: none;
}

.lookup-roster-table a:hover {
  text-decoration: underline;
}

/* Vehicle roster is grouped by type into separate tables — pin the columns so
   every group (Box Truck, Trailer, Truck …) aligns to the same geometry. */
.lookup-roster-table--vehicles {
  table-layout: fixed;
}

.lookup-roster-table--vehicles th:nth-child(1),
.lookup-roster-table--vehicles td:nth-child(1) {
  width: 180px;
}

.lookup-roster-table--vehicles th:nth-child(2),
.lookup-roster-table--vehicles td:nth-child(2) {
  width: auto;
}

.lookup-roster-table--vehicles th:nth-child(3),
.lookup-roster-table--vehicles td:nth-child(3) {
  width: 130px;
}

.lookup-roster-table--vehicles td {
  overflow-wrap: anywhere;
}

.lookup-exports {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 16px 12px;
}

.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-3 { margin-top: 0.75rem; }

/* Sidebar for multi-policy builder */
.pending-sidebar-card__policies {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin-top: 4px;
}

/* Send endorsement modal — document selection */
.send-docs-fieldset {
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  padding: 12px 16px;
  margin: 0 0 16px;
}

.send-docs-fieldset legend {
  padding: 0 6px;
  font-size: 13px;
}

.send-docs-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}

.send-docs-check + .send-docs-check {
  border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.send-docs-check input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent-primary, #3b82f6);
}

.send-docs-check span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.send-docs-check strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.send-docs-check small {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
}

.send-docs-preview {
  font-size: 12px;
  color: var(--accent-primary, #3b82f6);
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
}

.send-docs-preview:hover {
  text-decoration: underline;
}

.send-contact-list {
  display: flex;
  flex-direction: column;
}
.send-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--bg-default, #fff);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}
.send-contact-row:last-child {
  border-bottom: none;
}
.send-contact-row:hover {
  background: color-mix(in oklch, var(--accent-primary, #0d9488) 6%, transparent);
}
.send-contact-row__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #1e293b);
}
.send-contact-row__email {
  font-size: 0.8125rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
}

/* Endorsement History — global asset/driver show */
.endo-history-company {
  padding: 0;
}
.endo-history-company + .endo-history-company {
  margin-top: 16px;
}
.endo-history-company__header {
  padding: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Policy card */
.endo-history-policy {
  margin: 0 0 8px;
  border-radius: 8px;
  border: 0.5px solid var(--border-default, #d1d5db);
  overflow: hidden;
}

/* Policy header */
.endo-history-policy__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg-muted, #f8fafc);
  border-bottom: 0.5px solid var(--border-default, #d1d5db);
}
.endo-history-policy__header .link-primary {
  font-weight: 600;
}
.endo-history-policy__coverages {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Coverage pills — colored per type */
.endo-cov-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.endo-cov-pill--al  { background: #dbeafe; color: #1e40af; }
.endo-cov-pill--gl  { background: #ede9fe; color: #5b21b6; }
.endo-cov-pill--mtc { background: #ccfbf1; color: #0f766e; }
.endo-cov-pill--ti  { background: #fef3c7; color: #92400e; }
.endo-cov-pill--pd  { background: #fce7f3; color: #9d174d; }
.endo-cov-pill--ntl { background: #e0e7ff; color: #3730a3; }

/* Column headers */
.endo-history-colheads {
  display: grid;
  grid-template-columns: 86px 64px minmax(160px, 1fr) 104px;
  column-gap: 18px;
  padding: 4px 14px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 0.5px solid var(--border-subtle, #e2e8f0);
}
.endo-history-colheads--asset {
  grid-template-columns: 86px 64px minmax(180px, 1fr) 120px minmax(86px, max-content);
}
.endo-history-colhead[data-sort-btn] {
  cursor: pointer;
  user-select: none;
}
.endo-history-colhead[data-sort-btn]:hover {
  color: var(--text-primary, #1e293b);
}
.endo-history-colhead[data-sort-btn]::after {
  content: " \21C5";
  font-size: 9px;
  opacity: 0.4;
}
.endo-history-colhead.sort-asc::after {
  content: " \2191";
  opacity: 0.8;
}
.endo-history-colhead.sort-desc::after {
  content: " \2193";
  opacity: 0.8;
}
.endo-history-colhead:last-child {
  text-align: right;
}

/* Endorsement rows */
.endo-history-rows {}
.endo-history-row {
  display: grid;
  grid-template-columns: 86px 64px minmax(160px, 1fr) 104px;
  column-gap: 18px;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.8125rem;
}
.endo-history-row--asset {
  grid-template-columns: 86px 64px minmax(180px, 1fr) 120px minmax(86px, max-content);
}
.endo-history-row + .endo-history-row {
  border-top: 0.5px solid var(--border-subtle, #f1f5f9);
}
.endo-history-row__date {
  color: var(--text-secondary, #64748b);
  font-variant-numeric: tabular-nums;
}
.endo-history-row__number {
  font-weight: 600;
}
.endo-history-row__changes {
  color: var(--text-secondary, #64748b);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.endo-history-row__value {
  color: var(--text-primary, #0f172a);
  font-variant-numeric: tabular-nums;
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}
.endo-history-value-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 118px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent-primary, #0d9488) 28%, var(--border-default, #cbd5e1));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-primary, #0d9488) 9%, var(--bg-surface, #fff));
  color: var(--text-primary, #0f172a);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.endo-history-row__status {
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.endo-history-row__status::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.endo-history-row__status--active { color: var(--accent-success, #22c55e); }
.endo-history-row__status--active::after { background: var(--accent-success, #22c55e); }
.endo-history-row__status--terminated { color: var(--accent-danger, #ef4444); }
.endo-history-row__status--terminated::after { background: var(--accent-danger, #ef4444); }
.endo-history-row__status--suspended { color: var(--accent-warning, #f59e0b); }
.endo-history-row__status--suspended::after { background: var(--accent-warning, #f59e0b); }

/* Premium Estimate Card */
.premium-estimate-card {
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 8px;
  overflow: hidden;
}
.premium-estimate-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-muted, #f8fafc);
  border-bottom: 1px solid var(--border-default, #d1d5db);
}
.premium-estimate-card__title {
  font-size: 0.875rem;
  font-weight: 600;
}
.premium-estimate-card__body {
  padding: 6px 16px;
}
.premium-estimate-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  font-size: 0.9375rem;
}
.premium-estimate-card__row + .premium-estimate-card__row {
  border-top: 1px solid var(--border-subtle, #f1f5f9);
}
.premium-estimate-card__row--sub {
  font-size: 0.8125rem;
  color: var(--text-muted, #94a3b8);
  padding: 0 0 6px;
  border-top: none !important;
}
.premium-estimate-card__row--sub + .premium-estimate-card__row {
  border-top: 1px solid var(--border-subtle, #f1f5f9);
}
.premium-estimate-card__row--total {
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 0 8px;
  border-top: 2px solid var(--border-default, #d1d5db) !important;
}
.premium-estimate-card__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1rem;
}
.premium-estimate-card__row--total .premium-estimate-card__value {
  font-size: 1.0625rem;
}
.premium-estimate-card__notes {
  padding: 10px 16px;
  background: color-mix(in oklch, var(--accent-warning, #f59e0b) 6%, transparent);
  border-top: 1px solid var(--border-default, #d1d5db);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.premium-estimate-card__note {
  font-size: 0.8125rem;
  color: var(--text-secondary, #64748b);
}
.premium-estimate-card__note::before {
  content: "• ";
}
.premium-estimate-card__discrepancy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  background: color-mix(in oklch, var(--accent-info, #3b82f6) 6%, transparent);
  border-top: 1px solid var(--border-default, #d1d5db);
}

/* Premium Estimate Dialog */
.premium-estimate-dialog {
  max-width: 560px;
  width: 90vw;
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 24px 48px rgba(0,0,0,0.16);
}
.premium-estimate-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}
.premium-estimate-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--border-default, #d1d5db);
}
.premium-estimate-dialog__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}
.premium-estimate-dialog__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  padding: 4px;
  line-height: 1;
}
.premium-estimate-dialog__close:hover {
  color: var(--text-primary, #1e293b);
}
.premium-estimate-dialog__body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}
.premium-estimate-dialog__section + .premium-estimate-dialog__section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 0.5px solid var(--border-subtle, #f1f5f9);
}
.premium-estimate-dialog__section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
}
.premium-estimate-dialog__footer {
  padding: 12px 20px;
  border-top: 0.5px solid var(--border-default, #d1d5db);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.premium-estimate-dialog__result {
  margin-top: 16px;
}

/* ==========================================================================
   LINKED ENDORSEMENT RECORDS
   ========================================================================== */

.linked-records-page {
  padding: 32px 0 56px;
}

.linked-records-shell {
  width: min(1180px, calc(100vw - 64px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.linked-records-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.linked-records-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.linked-records-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--text-secondary, #475569);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.linked-records-back:hover {
  color: var(--accent-primary, #0f9488);
  text-decoration: none;
}

.linked-records-heading {
  max-width: 720px;
}

.linked-records-eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--accent-primary, #0f9488);
}

.linked-records-title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
  color: var(--text-primary, #0f172a);
}

.linked-records-subtitle {
  margin: 8px 0 0;
  color: var(--text-secondary, #64748b);
  font-size: 1rem;
}

.linked-records-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.linked-records-action-form {
  margin: 0;
}

.linked-records-action-form .btn[disabled],
.linked-records-actions .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.linked-records-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 180px));
  gap: 12px;
}

.linked-records-summary--single {
  grid-template-columns: minmax(280px, 1fr);
}

.linked-records-stat {
  padding: 16px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-default, #d8e1ee);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.linked-records-stat--wide {
  min-width: 0;
}

.linked-records-stat--ready {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.linked-records-stat--needs-setup {
  background: #fff7ed;
  border-color: #fed7aa;
}

.linked-records-stat__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.linked-records-stat strong {
  display: block;
  color: var(--text-primary, #0f172a);
  font-size: 1.375rem;
  line-height: 1.1;
}

.linked-records-root-path {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  color: var(--text-secondary, #64748b);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.linked-records-card {
  overflow: hidden;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-default, #d8e1ee);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.linked-records-setup-note {
  margin: -4px 0 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.875rem;
}

.linked-records-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.linked-records-card__header h2 {
  margin: 0;
  color: var(--text-primary, #0f172a);
  font-size: 1.125rem;
}

.linked-records-card__header p {
  margin: 4px 0 0;
  color: var(--text-secondary, #64748b);
}

.linked-records-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.linked-records-table {
  min-width: 980px;
}

.linked-records-table th,
.linked-records-table td {
  vertical-align: middle;
}

.linked-records-ref {
  font-weight: 700;
  white-space: nowrap;
}

.linked-documents-preview {
  width: 100%;
}

@media (max-width: 760px) {
  .linked-records-shell {
    width: min(100% - 24px, 1180px);
  }

  .linked-records-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .linked-records-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .linked-records-summary {
    grid-template-columns: 1fr;
  }
}
/* ============================================
   Exclusion Section Header
   ============================================ */

.exclusion-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exclusion-header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.exclusion-header__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0 0;
  font-weight: 400;
}

/* ============================================
   Policy Exclusion Pills
   ============================================ */

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  transition: all 0.15s ease;
}

.pill__text {
  white-space: nowrap;
}

.pill__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  text-transform: uppercase;
}

.pill__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 0.125rem;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  color: inherit;
}

.pill__remove:hover {
  opacity: 1;
}

/* Pill color variants */
.pill--red {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.pill--orange {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.pill--yellow {
  background: #fefce8;
  color: #854d0e;
  border-color: #fef08a;
}

.pill--blue {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.pill--purple {
  background: #faf5ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}

.pill--gray {
  background: #f9fafb;
  color: #4b5563;
  border-color: #e5e7eb;
}

.pill--default {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

/* Exclusion category section */
.exclusion-category {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.exclusion-category:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Color picker inputs (admin) */
.color-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-color {
  width: 40px;
  height: 34px;
  padding: 2px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

.form-input--sm {
  max-width: 120px;
}

.color-swatch-group {
  display: inline-flex;
  gap: 4px;
}

.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.pill-preview {
  padding: 0.75rem;
  background: #fafafa;
  border-radius: 8px;
  border: 1px dashed #e5e7eb;
}

/* Autocomplete dropdown for exclusions */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item--selected {
  background: var(--bg-elevated);
}

.autocomplete-item strong {
  color: var(--primary);
  font-weight: 600;
}
.form-field--category {
  width: 180px;
}

.title-inline-icon {
  vertical-align: -3px;
  margin-right: 8px;
}

.tooltip-icon__glyph {
  opacity: 0.5;
  margin-left: 4px;
}

.generated-documents-list {
  margin: 4px 0 0 16px;
  padding: 0;
}

.danger-confirm-hint {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.text-uppercase {
  text-transform: uppercase;
}

.card-client-type--portal {
  background: #7c3aed;
  color: white;
}

/* Endorsement builder */
.endorsement-page {
  position: relative;
  max-width: 1280px;
}

.endorsement-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #eef2f7;
  z-index: -1;
}

.endorsement-page .dashboard-header__meta {
  color: var(--text-muted);
}

.endorsement-flow {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.endorsement-flow--sticky {
  position: sticky;
  top: 58px;
  z-index: 20;
  padding: 12px 0;
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.endorsement-flow__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-secondary);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
  pointer-events: auto;
}

.endorsement-flow__step--active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--surface-primary);
  box-shadow: var(--shadow-sm);
}

.endorsement-builder__layout {
  display: block;
}

.endorsement-builder__forms,
.endorsement-builder__pending {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── 2-column build grid: main + sticky sidebar ── */
.endorsement-build-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  align-items: start;
}

.endorsement-build-main {
  min-width: 0;
}

.endorsement-build-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* ── Change-type toolbar ── */
.change-type-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.change-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.change-type-btn svg {
  flex-shrink: 0;
}

.change-type-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.change-type-btn--active {
  border-color: #0d9488;
  color: #0d9488;
  background: #f0fdfa;
  box-shadow: 0 0 0 1px #0d9488, 0 1px 3px rgba(13,148,136,0.12);
}

/* Color hints */
.change-type-btn--add { color: #047857; border-color: #a7f3d0; }
.change-type-btn--add:hover { background: #ecfdf5; border-color: #6ee7b7; }
.change-type-btn--add.change-type-btn--active {
  color: #047857;
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 0 0 0 1px #059669, 0 1px 3px rgba(5,150,105,0.15);
}

.change-type-btn--remove { color: #b91c1c; border-color: #fecaca; }
.change-type-btn--remove:hover { background: #fef2f2; border-color: #fca5a5; }
.change-type-btn--remove.change-type-btn--active {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626, 0 1px 3px rgba(220,38,38,0.15);
}

.change-type-btn--neutral { color: #475569; border-color: #d1d5db; }
.change-type-btn--neutral:hover { background: #f1f5f9; }
.change-type-btn--neutral.change-type-btn--active {
  color: #1e293b;
  background: #f1f5f9;
  border-color: #64748b;
  box-shadow: 0 0 0 1px #64748b, 0 1px 3px rgba(100,116,139,0.15);
}

.change-type-btn--teal { color: #0e7490; border-color: #a5f3fc; }
.change-type-btn--teal:hover { background: #ecfeff; border-color: #67e8f9; }
.change-type-btn--teal.change-type-btn--active {
  color: #0e7490;
  background: #ecfeff;
  border-color: #0891b2;
  box-shadow: 0 0 0 1px #0891b2, 0 1px 3px rgba(8,145,178,0.15);
}

/* ── Generic card (endorsement builder) ── */
.endorsement-builder .endorsement-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  overflow: visible;
}

.endorsement-builder .endorsement-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

/* Title inside cards without a header bar */
.endorsement-builder .endorsement-card > .endorsement-card__title {
  padding: 1.25rem 1.5rem 0;
}

/* ── Changes Summary card ── */
.changes-summary-card {
  display: flex;
  flex-direction: column;
}

.changes-summary-card .endorsement-card__title {
  padding: 1.25rem 1.5rem 0;
}

.changes-summary__empty {
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.changes-summary__items {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
}

/* When 6+ items exist, cap height so it scrolls after ~5 visible */
.changes-summary__items:has(.changes-summary__item:nth-child(6)) {
  max-height: 440px;
}

.changes-summary__item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 0.25rem 0.5rem;
  padding: 0.75rem 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.8125rem;
}

.changes-summary__badge {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.changes-summary__badge--add-driver,
.changes-summary__badge--add-asset {
  background: #dcfce7;
  color: #166534;
}

.changes-summary__badge--remove-driver,
.changes-summary__badge--remove-asset,
.changes-summary__badge--cancellation {
  background: #fee2e2;
  color: #991b1b;
}

.changes-summary__badge--correction,
.changes-summary__badge--premium-adjustment {
  background: #dbeafe;
  color: #1e40af;
}

.changes-summary__text {
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.8125rem;
  line-height: 1.5;
  word-break: break-word;
}

.changes-summary__remove {
  grid-row: 2;
  grid-column: 2;
  align-self: center;
}

.changes-summary__remove .btn {
  padding: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}

/* ── Form cards ── */
.endorsement-build-main .add-form {
  margin-bottom: 1.25rem;
}

/* Give form cards a polished header */
.endorsement-builder .endorsement-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
}

.endorsement-builder .endorsement-card__body {
  padding: 1.75rem 1.5rem;
}

.endorsement-builder .endorsement-card__body .form-group {
  margin-bottom: 1rem;
}

.endorsement-builder .endorsement-card__body .form-hint {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.endorsement-builder .endorsement-card__body .search-input-wrapper {
  position: relative;
}

/* ── Responsive: collapse sidebar below 900px ── */
@media (max-width: 900px) {
  .endorsement-build-grid {
    grid-template-columns: 1fr;
  }

  .endorsement-build-sidebar {
    position: static;
    max-height: none;
  }

  .changes-summary__items {
    max-height: none;
  }
}

/* ── Button variants ── */
.btn--block {
  display: block;
  width: 100%;
  text-align: center;
}

.btn--muted-fill {
  background: #0d9488;
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn--muted-fill:hover {
  background: #0f766e;
}

.btn--accent-fill {
  background: #0d9488;
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn--accent-fill:hover {
  background: #0f766e;
}

.btn--accent-fill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--pill {
  border-radius: 999px;
}

.btn--accent {
  color: #0d9488;
}

.btn--accent:hover {
  color: #0f766e;
}

.btn--icon-only {
  padding: 0;
  border: none;
  background: none;
  line-height: 1;
}

/* ── Form required asterisk ── */
.form-required {
  color: #dc2626;
  font-weight: 600;
}

.pending-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.pending-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
}

.pending-card__header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.pending-card__count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pending-card__items {
  padding: 1rem 1.25rem;
}

.pending-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.pending-item:last-child {
  margin-bottom: 0;
}

.pending-item__badge {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pending-item__badge--add-driver,
.pending-item__badge--add-asset {
  background: #dcfce7;
  color: #166534;
}

.pending-item__badge--remove-driver,
.pending-item__badge--remove-asset,
.pending-item__badge--cancellation {
  background: #fee2e2;
  color: #991b1b;
}

.pending-item__badge--correction,
.pending-item__badge--premium-adjustment {
  background: #dbeafe;
  color: #1e40af;
}

.pending-item__details {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.4;
}

.pending-item__remove .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.pending-item__tiv {
  margin-top: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.pending-item__tiv--missing {
  background: #fff7ed;
  border-color: #fdba74;
}

.pending-item__tiv .form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pending-item__tiv-warning {
  font-weight: 500;
  color: #c2410c;
  text-transform: none;
  letter-spacing: 0;
}

.pending-item__tiv-form {
  display: block;
}

.pending-item__tiv-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-item__tiv-prefix {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 600;
}

.pending-item__tiv-row .form-input {
  flex: 1;
  max-width: 180px;
  padding: 6px 10px;
  font-size: 14px;
}

.form-label--tight {
  font-size: 11px;
  margin-bottom: 2px;
  color: var(--text-muted);
}

.pending-card__empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.pending-card__clear {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  text-align: right;
}

.endorsement-details-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.review-summary-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.review-summary-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 14px 14px 0 0;
}

.review-summary-card__header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.review-summary-card__header span {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.review-summary-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 1.25rem 1.5rem;
}

.review-summary-card__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  background: #f1f5f9;
  text-align: left;
  transition: background 0.15s ease;
}

.review-summary-card__stat--active {
  background: #ecfdf5;
}

.review-summary-card__stat--active .review-summary-card__count {
  color: #059669;
}

.review-summary-card__label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.review-summary-card__count {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #94a3b8;
}

.review-summary-card__stat--active .review-summary-card__label {
  color: #047857;
}

@media (max-width: 800px) {
  .review-summary-card__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.endorsement-details-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.endorsement-details-card h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.add-forms {
  background: var(--surface-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: visible;
  box-shadow: var(--shadow-sm);
}

.add-forms h2 {
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 1.25rem 0.25rem;
  background: var(--surface-secondary);
  border-bottom: 0;
  margin: 0;
}

.add-forms__subtitle {
  margin: 0;
  padding: 0 1.25rem 1rem;
  background: var(--surface-secondary);
  color: var(--text-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.add-forms__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.add-forms__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.add-forms__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.add-forms__footer .form-hint {
  margin-right: auto;
}

.add-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--surface-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}

.add-tab:hover {
  background: var(--surface-secondary);
}

.add-tab--active {
  box-shadow: 0 0 0 1.5px currentColor;
  background: var(--surface-primary);
}

/* Color variants */
.add-tab--green { color: #166534; border-color: #bbf7d0; }
.add-tab--green.add-tab--active { background: #f0fdf4; border-color: #166534; }
.add-tab--red { color: #991b1b; border-color: #fecaca; }
.add-tab--red.add-tab--active { background: #fef2f2; border-color: #991b1b; }
.add-tab--neutral { color: var(--text-secondary); }
.add-tab--neutral.add-tab--active { color: var(--text-primary); }
.add-tab--teal { color: #0d9488; border-color: #99f6e4; }
.add-tab--teal.add-tab--active { background: #f0fdfa; border-color: #0d9488; }

.add-tab__icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}

.add-tab__icon--green {
  background: #dcfce7;
  color: #166534;
}

.add-tab__icon--red {
  background: #fee2e2;
  color: #991b1b;
}

.add-tab__icon--blue {
  background: #dbeafe;
  color: #1e40af;
}

.add-tab__icon--neutral {
  background: var(--surface-secondary);
  color: var(--text-secondary);
}

.add-tab__icon--teal {
  background: #ccfbf1;
  color: #0d9488;
}

.add-form__content {
  padding: 1.25rem;
  overflow: visible;
}

.new-driver-form,
.new-asset-form {
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}

.endorsement-builder .form-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.endorsement-builder .form-row--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.endorsement-builder .form-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  background: var(--surface-secondary);
  border-radius: 8px;
}

.endorsement-builder .form-instruction {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  background: var(--surface-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  line-height: 1.45;
}

.endorsement-builder .form-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.endorsement-builder .form-divider::before,
.endorsement-builder .form-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.endorsement-builder .form-divider span {
  padding: 0 1rem;
}

.endorsement-builder .search-input-wrapper {
  position: relative;
  z-index: 40;
}

.endorsement-builder .search-input-wrapper:focus-within {
  z-index: 80;
}

.endorsement-builder .search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1200;
  margin-top: 4px;
  backdrop-filter: none;
  opacity: 1;
}

.endorsement-builder .search-suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: #ffffff !important;
  border-bottom: 1px solid var(--border-color);
}

.endorsement-builder .search-suggestion:hover {
  background: #f8fafc !important;
}

.endorsement-builder .search-suggestion:last-child {
  border-bottom: none;
}

.endorsement-builder .search-suggestion:hover {
  background: var(--surface-secondary);
}

.endorsement-builder .search-suggestion.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.endorsement-builder .search-suggestion__content {
  flex: 1;
}

.endorsement-builder .search-suggestion__name {
  font-weight: 500;
  font-size: 0.9375rem;
}

.endorsement-builder .search-suggestion__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.endorsement-builder .search-suggestion__badges {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
  align-items: flex-start;
}

.endorsement-builder .search-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.endorsement-builder .search-badge.on-account {
  background: #dbeafe;
  color: #1e40af;
}

.endorsement-builder .search-badge.new-to-account {
  background: #fef3c7;
  color: #92400e;
}

.endorsement-builder .search-badge.on-policy {
  background: #fee2e2;
  color: #991b1b;
}

.endorsement-builder .search-badge.pending {
  background: #f3e8ff;
  color: #7c3aed;
}

.endorsement-builder .search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.endorsement-builder .search-no-results .btn {
  margin-top: 0.5rem;
}

.selection-stack {
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-primary);
  padding: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.selection-stack__title {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.selection-stack .selection-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-secondary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.6rem;
}

.selection-stack .selection-item:last-child {
  margin-bottom: 0;
}

.selection-stack .selection-item__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.selection-stack .selection-item__info strong {
  font-size: 1.03rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.selection-stack .selection-item__info span {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.selection-stack .selection-item__remove {
  flex-shrink: 0;
  align-self: center;
}

.selection-stack .selection-item__remove .btn {
  min-width: 92px;
  border-radius: 9px;
}

@media (max-width: 720px) {
  .selection-stack .selection-item {
    grid-template-columns: 1fr;
  }

  .endorsement-builder .selected-driver-card,
  .endorsement-builder .selected-asset-card {
    grid-template-columns: 1fr;
  }

  .selection-stack .selection-item__remove {
    width: 100%;
  }

  .selection-stack .selection-item__remove .btn {
    width: 100%;
  }

  .endorsement-builder .selected-driver-card .btn,
  .endorsement-builder .selected-asset-card .btn {
    width: 100%;
  }
}

.endorsement-builder .selected-driver-display,
.endorsement-builder .selected-asset-display {
  margin-top: 1rem;
}

.endorsement-builder .selected-driver-card,
.endorsement-builder .selected-asset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.endorsement-builder .selected-driver-info,
.endorsement-builder .selected-asset-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.endorsement-builder .selected-driver-info strong,
.endorsement-builder .selected-asset-info strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
}

.endorsement-builder .selected-driver-info .text-muted,
.endorsement-builder .selected-asset-info .text-muted {
  color: var(--text-secondary);
  font-size: 0.87rem;
}

.endorsement-builder .selected-driver-card .btn,
.endorsement-builder .selected-asset-card .btn {
  min-width: 92px;
  border-radius: 9px;
}

.endorsement-builder .mt-3 {
  margin-top: 0.75rem;
}

.endorsement-builder .badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.endorsement-builder .badge--new {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 900px) {
  .endorsement-flow--sticky {
    top: 52px;
  }

  .endorsement-flow__step {
    font-size: 11px;
    padding: 6px 10px;
  }

  .add-forms__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .add-forms__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .add-forms__footer .form-hint {
    margin-right: 0;
  }
}

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

  .pending-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .pending-item__remove {
    width: 100%;
  }

  .pending-item__remove .btn {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   OPERATIONS PAGE - Sticky Header Card
   ========================================================================== */

.operations-sticky-header {
  position: sticky;
  top: 88px;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  padding: 20px 28px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(8px);
}

.operations-header__limit {
  flex: 0 0 auto;
}

.operations-header__distribution {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.operations-header__save {
  flex: 0 0 auto;
  margin-left: auto;
}

.operations-header__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.operations-header__input-group {
  display: flex;
  align-items: center;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.operations-header__prefix {
  padding: 10px 12px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 14px;
}

.operations-header__input {
  width: 140px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
}

.operations-header__input:focus {
  outline: none;
}

.operations-header__input-group:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.operations-header__meter-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.operations-header__meter {
  flex: 1;
  height: 12px;
  background: var(--bg-base);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.operations-header__bar {
  height: 100%;
  width: 0%;
  background: var(--accent-warning);
  border-radius: 6px;
  transition: width 0.3s ease, background 0.3s ease;
}

.operations-header__bar.bar--success {
  background: linear-gradient(90deg, var(--accent-primary) 0%, #14b8a6 100%);
}

.operations-header__bar.bar--warning {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.operations-header__bar.bar--danger {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.operations-header__percentage {
  font-size: 24px;
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}

.operations-header__percentage.text-success {
  color: var(--accent-primary);
}

.operations-header__percentage.text-warning {
  color: var(--accent-warning);
}

.operations-header__percentage.text-danger {
  color: var(--accent-danger);
}

/* Total percentage display - legacy, kept for backwards compat */
.cargo-total {
  display: none;
}

/* Header row for items table */
.cargo-items-header {
  display: grid;
  grid-template-columns: 1fr 70px 90px 90px;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

@media (min-width: 640px) {
  .cargo-items-header {
    grid-template-columns: 1fr 80px 100px 100px;
    gap: 16px;
    padding: 8px 16px;
  }
}

.cargo-items-header__item {
  text-align: left;
}

.cargo-items-header__exposure {
  text-align: center;
}

.cargo-items-header__max,
.cargo-items-header__avg {
  text-align: right;
}

/* Updated cargo item layout */
.cargo-item {
  display: grid;
  grid-template-columns: 1fr 70px 90px 90px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
}

@media (min-width: 640px) {
  .cargo-item {
    grid-template-columns: 1fr 80px 100px 100px;
    gap: 16px;
    padding: 12px 16px;
  }
}

.cargo-item:hover {
  background: var(--bg-hover);
}

.cargo-item__label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
}

.cargo-item__label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-primary);
  flex-shrink: 0;
}

.cargo-item--inactive .cargo-item__percentage,
.cargo-item--inactive .cargo-item__max-input,
.cargo-item--inactive .cargo-item__avg-input {
  visibility: hidden;
}

.cargo-item__percentage {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  text-align: center;
}

@media (min-width: 640px) {
  .cargo-item__percentage {
    padding: 8px 10px;
  }
}

.cargo-item__percentage:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.cargo-item__max-input,
.cargo-item__avg-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13px;
  text-align: right;
}

.cargo-item__max-input:focus,
.cargo-item__avg-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   MASTER CERTIFICATE CONFIGURATION
   ========================================================================== */

/* Policy chips - small badges indicating coverage types */
.policy-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 50px;
}

.policy-chip--gl {
  background: #e3f2fd;
  color: #1565c0;
}

.policy-chip--auto {
  background: #f3e5f5;
  color: #7b1fa2;
}

.policy-chip--umbrella {
  background: #e8f5e9;
  color: #2e7d32;
}

.policy-chip--wc {
  background: #fff3e0;
  color: #e65100;
}

.policy-chip--cargo {
  background: #e1f5fe;
  color: #0277bd;
}

.policy-chip--pd {
  background: #fce4ec;
  color: #c2185b;
}

.policy-chip--ti {
  background: #f1f8e9;
  color: #558b2f;
}

.policy-chip--ntl {
  background: #ede7f6;
  color: #512da8;
}

/* Certificate policies summary - for index cards */
.certificate-policies-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Policy assignment grid */
.policy-assignments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Policy assignment card */
.policy-assignment-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.policy-assignment-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.policy-assignment-card__title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}

.policy-assignment-card__body {
  padding: 12px 16px;
}

/* Assigned policies list - for show page */
.assigned-policies-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assigned-policy-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 6px;
}

.assigned-policy-item__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assigned-policy-item__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #374151;
}

.assigned-policy-item__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insurer-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.insurer-letter--sm {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

/* Certificate card insurer list */
.cert-insurers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cert-insurer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cert-insurer-name {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  min-width: 120px;
}

.cert-insurer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.assigned-policy-item__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.assigned-policy-item__details strong {
  font-size: 14px;
}

/* Description text preview */
.description-text-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  background: var(--bg-elevated);
  padding: 12px;
  border-radius: 6px;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

/* Certificate preview */
.certificate-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.certificate-preview__section {
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.certificate-preview__section--wide {
  grid-column: 1 / -1;
}

.certificate-preview__section h4 {
  margin: 0 0 12px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.certificate-preview__section address {
  font-style: normal;
  line-height: 1.5;
}

/* Certificate coverage table */
.certificate-coverage-table {
  width: 100%;
  font-size: 13px;
}

.certificate-coverage-table th {
  text-align: left;
  font-weight: 500;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.certificate-coverage-table td {
  padding: 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.certificate-coverage-table tr:last-child td {
  border-bottom: none;
}

/* Certificate config form */
.certificate-config-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Form grid */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
  .form-grid--2col {
    grid-template-columns: 1fr;
  }
  
  .certificate-preview {
    grid-template-columns: 1fr;
  }
  
  .certificate-preview__section--wide {
    grid-column: 1;
  }
}

/* Monospace text */
.font-mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   CERTIFICATE CONFIG FORM - Mobile-first design
   ========================================================================== */

.cert-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
}

/* Section containers */
.cert-section {
  background: var(--surface-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.cert-section__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.cert-section__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.cert-section__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
}

.cert-section__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Form fields */
.cert-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.cert-field:last-child {
  margin-bottom: 0;
}

.cert-field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cert-field__input,
.cert-field__textarea,
.cert-field__select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  -webkit-appearance: none;
  appearance: none;
}

.cert-field__input:focus,
.cert-field__textarea:focus,
.cert-field__select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cert-field__input::placeholder,
.cert-field__textarea::placeholder {
  color: var(--text-muted);
}

.cert-field__textarea {
  resize: vertical;
  min-height: 80px;
}

.cert-field__textarea--mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.cert-field__hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle switch */
.cert-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 14px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s ease;
}

.cert-toggle:hover {
  background: var(--surface-tertiary);
}

.cert-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cert-toggle__switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cert-toggle__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cert-toggle__input:checked + .cert-toggle__switch {
  background: var(--success);
}

.cert-toggle__input:checked + .cert-toggle__switch::after {
  transform: translateX(20px);
}

.cert-toggle__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.cert-toggle__hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* Policy cards grid - mobile first */
.cert-policies {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 540px) {
  .cert-policies {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .cert-policies {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .cert-policies {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Individual policy card */
.cert-policy-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.15s ease;
}

.cert-policy-card:hover {
  border-color: var(--border-hover);
}

.cert-policy-card--empty {
  opacity: 0.5;
}

.cert-policy-card__badge {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  color: white;
}

.cert-policy-card__badge--gl { background: #10b981; }
.cert-policy-card__badge--auto { background: #3b82f6; }
.cert-policy-card__badge--umbrella { background: #8b5cf6; }
.cert-policy-card__badge--wc { background: #f59e0b; }
.cert-policy-card__badge--cargo { background: #ef4444; }
.cert-policy-card__badge--pd { background: #06b6d4; }
.cert-policy-card__badge--ti { background: #ec4899; }
.cert-policy-card__badge--ntl { background: #6366f1; }

.cert-policy-card__content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cert-policy-card__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.cert-policy-card__select {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.cert-policy-card__select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.cert-policy-card__none {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0;
}

/* Form actions */
.cert-actions {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

.cert-actions__btn {
  flex: 1;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

.cert-actions__btn--primary {
  background: var(--primary);
  color: white;
}

.cert-actions__btn--primary:hover {
  background: var(--primary-hover);
}

.cert-actions__btn--secondary {
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.cert-actions__btn--secondary:hover {
  background: var(--surface-tertiary);
}

@media (min-width: 540px) {
  .cert-actions {
    justify-content: flex-end;
  }
  
  .cert-actions__btn {
    flex: none;
    min-width: 140px;
  }
}

/* ========================================
   Policy Selector (Certificate Form)
   ======================================== */

.policy-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.policy-selector__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-secondary);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.policy-selector__item:hover {
  border-color: var(--brand-primary);
  background: var(--surface-tertiary);
}

.policy-selector__item--selected {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface-primary));
}

.policy-selector__checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--brand-primary);
  flex-shrink: 0;
}

.policy-selector__info {
  flex: 1;
  min-width: 0;
}

.policy-selector__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.policy-selector__number {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.policy-selector__status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
}

.policy-selector__status--active {
  background: var(--green-100);
  color: var(--green-700);
}

.policy-selector__status--processing {
  background: var(--yellow-100);
  color: var(--yellow-700);
}

.policy-selector__period {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.policy-selector__coverages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.policy-selector__cov {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.policy-selector__cov--gl { background: #d1fae5; color: #065f46; }
.policy-selector__cov--auto { background: #dbeafe; color: #1e40af; }
.policy-selector__cov--umbrella { background: #e9d5ff; color: #6b21a8; }
.policy-selector__cov--wc { background: #fef3c7; color: #92400e; }
.policy-selector__cov--cargo { background: #fee2e2; color: #991b1b; }
.policy-selector__cov--pd { background: #fce7f3; color: #9d174d; }
.policy-selector__cov--ti { background: #ccfbf1; color: #0f766e; }
.policy-selector__cov--ntl { background: #e0e7ff; color: #3730a3; }

.policy-selector__carrier {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.policy-selector__check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.policy-selector__check svg {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.policy-selector__item--selected .policy-selector__check {
  background: var(--brand-primary);
  color: white;
}

.policy-selector__item--selected .policy-selector__check svg {
  opacity: 1;
}

/* ========================================
   Coverage Panels (Certificate Form)
   ======================================== */

.cert-coverages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coverage-panel {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.coverage-panel.hidden {
  display: none;
}

.coverage-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface-tertiary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.coverage-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coverage-panel__policy {
  font-weight: 600;
  color: var(--text-primary);
}

.coverage-panel__carrier {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.coverage-panel__period {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.coverage-panel__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 1rem 0;
}

.coverage-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.coverage-badge--gl { background: #d1fae5; color: #065f46; }
.coverage-badge--auto { background: #dbeafe; color: #1e40af; }
.coverage-badge--umbrella { background: #e9d5ff; color: #6b21a8; }
.coverage-badge--wc { background: #fef3c7; color: #92400e; }
.coverage-badge--cargo { background: #fee2e2; color: #991b1b; }
.coverage-badge--pd { background: #fce7f3; color: #9d174d; }
.coverage-badge--ti { background: #ccfbf1; color: #0f766e; }
.coverage-badge--ntl { background: #e0e7ff; color: #3730a3; }

.coverage-panel__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
}

@media (min-width: 640px) {
  .coverage-panel__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .coverage-panel__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.coverage-item {
  padding: 0.75rem;
  background: var(--surface-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.coverage-item__header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.coverage-item__name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.coverage-item__fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.coverage-item__auto {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.coverage-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.coverage-field label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.coverage-field input {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-tertiary);
  color: var(--text-primary);
}

.coverage-field input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 20%, transparent);
}

.coverage-field input::placeholder {
  color: var(--text-muted);
}

/* Empty state */
.cert-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.cert-empty p {
  margin: 0;
}

.cert-empty__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem !important;
}

/* Row layout helper */
.cert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.cert-field--grow {
  flex: 1;
  min-width: 200px;
}

.cert-toggle--inline {
  padding-top: 1.5rem;
}

/* ========================================
   Certificate Card Design (Subtle Style)
   ======================================== */

.cert-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
}

.cert-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.cert-card__header--blue {
  color: var(--text-primary);
}

.cert-card__header--pink {
  color: var(--text-primary);
}

.cert-card__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.cert-card__subtitle {
  padding: 0.75rem 1rem 0;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cert-card__body {
  padding: 1rem;
}

.cert-card__body--no-pad {
  padding: 0;
}

/* ========================================
   Policy Row Design (List Style)
   ======================================== */

.policy-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.policy-row:last-child {
  border-bottom: none;
}

.policy-row:hover {
  background: var(--bg-hover);
}

.policy-row--selected {
  background: var(--bg-hover);
}

.policy-row__checkbox {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--brand-primary);
  flex-shrink: 0;
}

.policy-row__content {
  flex: 1;
  min-width: 0;
}

.policy-row__main {
  margin-bottom: 0.5rem;
}

.policy-row__title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.policy-row__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.policy-row__details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .policy-row__details {
    grid-template-columns: 1fr 1fr;
  }
}

.policy-row__col {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.policy-row__label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.policy-row__value {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}
/* ==========================================================================
   AUTH PAGES
   ========================================================================== */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg-base) 0%, var(--bg-surface) 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: -0.5px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.auth-form {
  margin-bottom: 24px;
}

.auth-field {
  margin-bottom: 24px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.auth-input::placeholder {
  color: var(--text-tertiary);
}

.auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-button:hover {
  background: #0ea572;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button svg {
  transition: transform 0.2s ease;
}

.auth-button:hover svg {
  transform: translateX(3px);
}

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.auth-body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
}

.auth-flash {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  animation: authFlashIn 0.3s ease;
}

@keyframes authFlashIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.auth-flash--notice {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.auth-flash--alert {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Code input styling */
.auth-input--code {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 12px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  padding: 18px 24px;
}

.auth-input--code::placeholder {
  letter-spacing: 12px;
  opacity: 0.4;
}

.auth-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-link--button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  display: inline;
}

.auth-resend-form {
  display: inline;
}

.auth-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px !important;
}


/* User menu in header */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-menu-trigger:hover {
  background: var(--bg-subtle);
  border-color: var(--border-default);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #0d9488);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-menu-chevron {
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
}

.user-menu-dropdown[hidden] {
  display: none;
}

.user-menu-header {
  padding: 12px 14px;
  background: var(--bg-subtle);
}

.user-menu-email {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.user-menu-role {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-menu-divider {
  height: 1px;
  background: var(--border-default);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.1s ease;
}

.user-menu-item:hover {
  background: var(--bg-subtle);
}

.user-menu-item svg {
  color: var(--text-tertiary);
}

.user-menu-item--danger {
  color: var(--accent-danger);
}

.user-menu-item--danger svg {
  color: var(--accent-danger);
}

.user-menu-item--danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* Assignee Badge */
.assignee-badge {
  position: relative;
  display: inline-block;
}

.assignee-trigger {
  display: flex;
  align-items: center;
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.assignee-trigger:hover {
  background: var(--bg-subtle);
}

.assignee-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #0d9488);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.assignee-avatar--empty {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  border: 1px dashed var(--border-default);
}

.assignee-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 100;
  overflow: hidden;
}

.assignee-dropdown[hidden] {
  display: none;
}

.assignee-dropdown-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-default);
}

.assignee-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.1s ease;
  text-align: left;
}

.assignee-option:hover {
  background: var(--bg-subtle);
}

.assignee-option--active {
  background: var(--bg-subtle);
}

.assignee-option--active::after {
  content: "✓";
  margin-left: auto;
  color: var(--accent-primary);
  font-size: 12px;
}

.assignee-option-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #0d9488);
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assignee-option-avatar--empty {
  background: var(--bg-base);
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
}

.assignee-option-you {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Card Assignee Button (for detail view footer) */
.card__assignee-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  color: inherit;
  font: inherit;
}

.card__assignee-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: var(--card-color);
}

.card__assignee-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  overflow: visible;
}

.card__assignee-dropdown[hidden] {
  display: none;
}

.assignee-form {
  display: contents;
}

.avatar--assignee {
  background: linear-gradient(135deg, var(--accent-primary), #0d9488);
}

/* Inline assignee selector for detail pages */
.card__assigned--inline {
  position: relative;
}

.card__assignee-btn--inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  color: inherit;
  font: inherit;
}

.card__assignee-btn--inline:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.card__assigned-name--inline {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.card__assigned-name--unassigned {
  color: var(--text-tertiary);
  font-style: italic;
}

.card__assigned--inline .card__assignee-dropdown {
  position: fixed;
  bottom: auto;
  top: auto;
  left: auto;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 9999;
}

/* ==========================================================================
   CLIENT PORTAL STYLES
   Dedicated styles for the client-facing insurance portal
   ========================================================================== */

.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.portal-header__brand {
  display: flex;
  align-items: center;
}

.portal-header__logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.portal-header__nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-header__user {
  font-weight: 500;
  color: var(--text-primary);
}

.portal-header__company {
  color: var(--text-secondary);
  font-size: 13px;
}

.portal-main {
  flex: 1;
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.portal-footer {
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* Portal Dashboard */
.portal-dashboard__header {
  margin-bottom: 32px;
}

.portal-dashboard__header h1 {
  font-size: 28px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.portal-dashboard__subtitle {
  color: #6b7280;
  margin: 0;
  font-size: 15px;
}

.portal-dashboard__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

@media (max-width: 900px) {
  .portal-dashboard__layout {
    grid-template-columns: 1fr;
  }
  .portal-dashboard__sidebar {
    order: -1;
  }
}

.portal-dashboard__main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.portal-dashboard__sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Portal Section */
.portal-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.portal-section__header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.portal-section__header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

/* Portal Policies List */
.portal-policies-list {
  display: flex;
  flex-direction: column;
}

.portal-policy-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s ease;
}

.portal-policy-row:last-child {
  border-bottom: none;
}

.portal-policy-row:hover {
  background: #f9fafb;
}

.portal-policy-row__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-policy-row__number {
  font-weight: 600;
  font-family: var(--font-mono);
  color: #111827;
}

.portal-policy-row__carrier {
  font-size: 13px;
  color: #6b7280;
}

.portal-policy-row__dates {
  font-size: 13px;
  color: #6b7280;
  margin-right: 12px;
}

.portal-policy-row__arrow {
  color: #9ca3af;
}

/* Portal Requests List */
.portal-requests-list {
  display: flex;
  flex-direction: column;
}

.portal-request-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s ease;
  gap: 16px;
}

.portal-request-row:last-child {
  border-bottom: none;
}

.portal-request-row:hover {
  background: #f9fafb;
}

.portal-request-row__holder {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-request-row__holder strong {
  font-size: 14px;
  color: #111827;
}

.portal-request-row__holder .text-muted {
  font-size: 12px;
}

.portal-request-row__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

/* Portal Sidebar Card */
.portal-sidebar-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}

.portal-sidebar-card--primary {
  background: white;
  border-color: #e5e7eb;
}

.portal-sidebar-card__icon {
  width: 40px;
  height: 40px;
  background: #f3f4f6;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: #6b7280;
}

.portal-sidebar-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 6px 0;
}

.portal-sidebar-card p {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.portal-agent-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.portal-agent-info strong {
  color: #111827;
}

.portal-agent-info a {
  color: #3b82f6;
  text-decoration: none;
}

/* Portal Certificate Policies */
.portal-certificate-new__policies {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.portal-certificate-new__policies h3 {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin: 0 0 12px 0;
}

.portal-certificate-policies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-certificate-coverages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-coverage-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #f3f4f6;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.portal-coverage-chip--gl {
  background: #dbeafe;
  color: #1e40af;
}

.portal-coverage-chip--auto {
  background: #dcfce7;
  color: #166534;
}

.portal-coverage-chip--cargo {
  background: #fef3c7;
  color: #92400e;
}

.portal-coverage-chip--umbrella {
  background: #e0e7ff;
  color: #3730a3;
}

.portal-coverage-chip--wc {
  background: #fce7f3;
  color: #9d174d;
}

.portal-coverage-chip--pd {
  background: #f3e8ff;
  color: #6b21a8;
}

.portal-coverage-chip--ti {
  background: #ccfbf1;
  color: #115e59;
}

.portal-coverage-chip--ntl {
  background: #fee2e2;
  color: #991b1b;
}

.portal-certificate-policy-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.portal-certificate-policy-chip strong {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #111827;
}

.portal-certificate-policy-chip span {
  font-size: 12px;
  color: #6b7280;
}

.portal-policies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.portal-policy-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.portal-policy-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.portal-policy-card__status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.portal-policy-card__status--active {
  background: var(--green-100);
  color: var(--green-700);
}

.portal-policy-card__status--processing {
  background: var(--yellow-100);
  color: var(--yellow-700);
}

.portal-policy-card__status--draft {
  background: var(--gray-100);
  color: var(--gray-600);
}

.portal-policy-card__number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.portal-policy-card__body {
  padding: 16px;
}

.portal-policy-card__company {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.portal-policy-card__details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-policy-card__detail {
  display: flex;
  justify-content: space-between;
}

.portal-policy-card__label {
  color: var(--text-secondary);
  font-size: 13px;
}

.portal-policy-card__value {
  color: var(--text-primary);
  font-size: 14px;
}

.portal-policy-card__footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* Portal Empty State */
.portal-empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.portal-empty-state svg {
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.portal-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.portal-empty-state p {
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Enhanced Portal Dashboard Styles */
.portal-dashboard__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

.portal-dashboard__greeting h1 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.portal-date-display {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
  background: #f3f4f6;
  padding: 8px 14px;
  border-radius: 8px;
}

.portal-date-display svg {
  color: #9ca3af;
}

/* Portal Section Enhancements */
.portal-section__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.portal-section__icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.portal-section__icon--teal {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.portal-section__icon--blue {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.portal-section__icon--green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.portal-section__icon--purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.portal-section__badge {
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  margin-left: auto;
}

/* Portal Policy Card */
.portal-policy-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.portal-policy-card:last-child {
  border-bottom: none;
}

.portal-policy-card:hover {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.portal-policy-card__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
}

.portal-policy-card__icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.portal-policy-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-policy-card__number {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #111827;
}

.portal-policy-card__carrier {
  font-size: 14px;
  color: #6b7280;
}

.portal-policy-card__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #059669;
}

.portal-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.portal-status-dot--active {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.portal-policy-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 16px;
  background: #f9fafb;
  border-top: 1px solid #f3f4f6;
}

.portal-policy-card__dates {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}

.portal-policy-card__dates svg {
  color: #9ca3af;
}

.portal-policy-card__arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #3b82f6;
  transition: gap 0.2s ease;
}

.portal-policy-card:hover .portal-policy-card__arrow {
  gap: 10px;
}

/* Portal Download Icon */
.portal-download-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Portal Action Cards */
.portal-action-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.portal-action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.portal-action-card--certificate::before {
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
}

.portal-action-card--endorsement::before {
  background: linear-gradient(90deg, #14b8a6 0%, #0d9488 100%);
}

.portal-action-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.portal-action-card--certificate .portal-action-card__icon {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #3b82f6;
}

.portal-action-card--endorsement .portal-action-card__icon {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  color: #14b8a6;
}

.portal-action-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
}

.portal-action-card p {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.portal-action-card__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.portal-action-card--certificate .portal-action-card__button {
  background: #4f46e5;
}

.portal-action-card--certificate .portal-action-card__button:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.portal-action-card--endorsement .portal-action-card__button {
  background: #14b8a6;
}

.portal-action-card--endorsement .portal-action-card__button:hover {
  background: #0d9488;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
}

.portal-action-card__button:hover {
  background: #374151;
  transform: translateY(-1px);
}

/* Portal Help Card */
.portal-help-card {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.portal-help-card__icon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #6b7280;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.portal-help-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
}

.portal-help-card p {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.portal-help-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.portal-help-card__link:hover {
  color: #1d4ed8;
}

/* Portal Empty State Enhancement */
.portal-empty-state__icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: #9ca3af;
}

/* Portal Policy Show */
.portal-breadcrumb {
  margin-bottom: 24px;
}

.portal-breadcrumb__link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}

.portal-breadcrumb__link:hover {
  color: var(--text-primary);
}

.portal-policy-show {
  max-width: 1000px;
  margin: 0 auto;
}

.portal-policy-show__header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
}

.portal-policy-show__header-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.portal-policy-show__title-group {
  flex: 1;
}

.portal-policy-show__title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.portal-policy-show__title-row h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.portal-policy-show__company {
  color: var(--text-secondary);
  margin: 0;
  font-size: 16px;
}

.portal-policy-show__grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
}

@media (max-width: 900px) {
  .portal-policy-show__grid {
    grid-template-columns: 1fr;
  }
}

.portal-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.portal-section--card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portal-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.portal-section__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.portal-section__header h2 {
  margin: 0;
  flex: 1;
}

.portal-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-details__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.portal-details__row:last-child {
  border-bottom: none;
}

.portal-details__row dt {
  color: var(--text-secondary);
  font-size: 14px;
}

.portal-details__row dd {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

/* Portal Table */
.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.portal-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.portal-table tbody tr:last-child td {
  border-bottom: none;
}

/* Portal Status Badges */
.portal-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.portal-status--pending {
  background: var(--yellow-100);
  color: var(--yellow-700);
}

.portal-status--active {
  background: var(--green-100);
  color: var(--green-700);
}

.portal-status--generated {
  background: var(--green-100);
  color: var(--green-700);
}

.portal-status--downloaded {
  background: var(--blue-100);
  color: var(--blue-700);
}

.portal-status--large {
  font-size: 13px;
  padding: 6px 14px;
}

.portal-empty-inline {
  color: var(--text-secondary);
  font-style: italic;
  padding: 16px 0;
}

/* Portal Card */
.portal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.portal-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.portal-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.portal-card--large {
  padding: 32px;
}

/* Portal List Items */
.portal-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.portal-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.portal-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.portal-list-item:first-child {
  padding-top: 0;
}

.portal-list-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-100, #dbeafe);
  color: var(--blue-700, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}

.portal-list-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-list-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.portal-list-item__info strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.portal-list-item__info span {
  font-size: 13px;
}

.portal-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

/* Portal Certificate Form */
.portal-certificate-new,
.portal-certificate-show {
  max-width: 700px;
  margin: 0 auto;
}

.portal-certificate-new__header,
.portal-certificate-show__header {
  margin-bottom: 32px;
  text-align: center;
}

.portal-certificate-new__header h1,
.portal-certificate-show__header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.portal-certificate-new__header p,
.portal-certificate-show__header p {
  color: var(--text-secondary);
  margin: 0;
}

.portal-certificate-new__content,
.portal-certificate-show__content {
  max-width: 700px;
  margin: 0 auto;
}

.portal-form__section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.portal-form__section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.portal-form__help {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 20px 0;
}

.portal-form__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.portal-form__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
}

.portal-form__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

.portal-form__field {
  margin-bottom: 16px;
}

.portal-form__row {
  display: grid;
  gap: 16px;
}

.portal-form__row--3 {
  grid-template-columns: 2fr 1fr 1fr;
}

@media (max-width: 600px) {
  .portal-form__row--3 {
    grid-template-columns: 1fr;
  }
}

.portal-form__search {
  margin-bottom: 16px;
}

.portal-form__search-results {
  margin-top: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.portal-form__search-result {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.portal-form__search-result:last-child {
  border-bottom: none;
}

.portal-form__search-result:hover {
  background: var(--bg-elevated);
}

.portal-form__search-result strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
}

.portal-form__search-result small {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 4px;
}

.portal-form__search-empty {
  padding: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.portal-form__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  margin: 20px auto;
  max-width: 400px;
}

.portal-form__divider::before,
.portal-form__divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.portal-form__divider span {
  padding: 0 16px;
}

.portal-form__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* Portal Certificate Show */
.portal-certificate-show__status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.portal-certificate-show__date {
  color: var(--text-secondary);
  font-size: 13px;
}

.portal-certificate-show__holder {
  margin-bottom: 24px;
}

.portal-certificate-show__holder h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  text-transform: uppercase;
}

.portal-address {
  font-style: normal;
  line-height: 1.6;
  color: var(--text-primary);
}

.portal-certificate-show__download {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.portal-certificate-show__ready {
  color: var(--green-600);
  font-weight: 500;
  margin: 0 0 16px 0;
}

.portal-certificate-show__pending {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

.portal-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Portal Loading Screen */
.portal-loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 48px 24px;
}

.portal-loading-screen__content {
  text-align: center;
  max-width: 400px;
}

/* Animated spinner with icon inside */
.portal-loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 32px auto;
}

.portal-loading-spinner__ring {
  position: absolute;
  inset: 0;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.portal-loading-spinner__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #3b82f6;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.portal-loading-screen__title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 12px 0;
}

.portal-loading-screen__message {
  color: #6b7280;
  font-size: 15px;
  margin: 0 0 8px 0;
}

.portal-loading-screen__submessage {
  color: #9ca3af;
  font-size: 13px;
  margin: 0;
}

/* Broker Search Results */
.portal-search-results {
  position: absolute;
  z-index: 100;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 320px;
  overflow-y: auto;
}

.portal-search-results__item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.portal-search-results__item:hover {
  background: var(--bg-elevated);
}

.portal-search-results__item:last-of-type {
  border-bottom: none;
}

.portal-search-results__name {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.portal-search-results__detail {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 2px;
}

.portal-search-results__empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.portal-search-results__empty p {
  margin: 0 0 12px 0;
}

.portal-search-results__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.portal-selected-broker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.portal-selected-broker__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-selected-broker__name {
  font-weight: 500;
  color: var(--text-primary);
}

.portal-selected-broker__address {
  color: var(--text-secondary);
  font-size: 13px;
}

.portal-form__search {
  position: relative;
}

/* ========================================
   Portal Endorsement Styles
   ======================================== */

.endorsement-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.endorsement-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.endorsement-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.endorsement-card--pending {
  border-left: 4px solid var(--status-warning);
}

.endorsement-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.endorsement-card__number {
  font-weight: 600;
  color: var(--text-primary);
}

.endorsement-card__badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.endorsement-card__badge--pending,
.endorsement-card__badge--intake,
.endorsement-card__badge--processing {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.endorsement-card__badge--issued {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.endorsement-card__type {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.endorsement-card__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.endorsement-card__impact {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.endorsement-card__impact--increase {
  background: #fef2f2;
  color: #dc2626;
}

.endorsement-card__impact--decrease {
  background: #f0fdf4;
  color: #16a34a;
}

.endorsement-card__action {
  margin-top: 1rem;
  text-align: right;
}

/* Changes Section */
.changes-section {
  margin-bottom: 1.5rem;
}

.changes-section:last-child {
  margin-bottom: 0;
}

.changes-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.changes-section__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.875rem;
}

.changes-section__icon--add {
  background: #dcfce7;
  color: #16a34a;
}

.changes-section__icon--remove {
  background: #fee2e2;
  color: #dc2626;
}

.changes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.changes-list__item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

.changes-list__item--add {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.changes-list__item--remove {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

/* Acknowledgment Section */
.acknowledgment-status {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
}

.acknowledgment-status--complete {
  background: #f0fdf4;
  color: #16a34a;
}

.acknowledgment-status--complete svg {
  stroke: #16a34a;
  flex-shrink: 0;
}

.acknowledgment-status--issued {
  background: #f3f4f6;
  color: #6b7280;
}

.acknowledgment-status--issued svg {
  stroke: #6b7280;
  flex-shrink: 0;
}

.acknowledgment-prompt {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 1.5rem;
}

/* =======================================
   ADMIN REPORTS
   ======================================= */

/* ---- Filter form ---- */

.report-filters {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.report-filters__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 20px;
  align-items: stretch;
}

.report-filters__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.report-filters__field--wide {
  grid-column: span 2;
}

.report-filters__field > label,
.report-filters__field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.report-filters__field input[type="date"] {
  height: 34px;
  padding: 0 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
}

.report-filters__field input[type="date"]:focus {
  border-color: var(--accent);
  outline: none;
}

/* ---- Date preset chips ---- */

.report-filters__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-filters__preset {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.report-filters__preset:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}

.report-filters__preset--active {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--text-primary);
}

/* ---- Checkbox chips ---- */

.report-filters__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-filters__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.report-filters__check:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}

.report-filters__check:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--text-primary);
}

.report-filters__check input[type="checkbox"] {
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.report-filters__check--inline {
  height: auto;
  padding: 6px 10px;
  white-space: normal;
}

.report-filters__hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.75;
}

/* ---- Form actions ---- */

.report-filters__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

/* ---- Summary strip ---- */

.report-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.report-summary__pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-width: 130px;
}

.report-summary__pill--total {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
}

.report-summary__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-summary__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- Matrix table ---- */

.data-table--report th.cell-numeric,
.data-table--report td.cell-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.cell-numeric--muted {
  color: var(--text-secondary);
  opacity: 0.4;
}

.cell-numeric--strong {
  font-weight: 600;
}

.cell-numeric--combined {
  color: var(--accent-warning, #d97706);
}

/* ---- Section row (Unmatched MGAs header) ---- */

.data-table__section-row td {
  padding: 14px 12px 10px;
  background: var(--bg-elevated);
  border-top: 2px solid var(--border-default);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table__section-row:hover td {
  background: var(--bg-elevated);
}

.data-table__section-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-warning, #d97706);
  background: color-mix(in srgb, var(--accent-warning, #d97706) 10%, transparent);
  border-radius: var(--radius-sm);
}

.data-table__section-caption {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
}

.data-table__section-caption code {
  padding: 1px 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-primary);
}

.data-table__row--unmatched td.cell-primary {
  color: var(--accent-warning, #d97706);
}

/* ---- Footnote ---- */

.report-footnote {
  margin: 12px 16px 16px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.report-footnote code {
  padding: 1px 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-primary);
}

/* ---- Misc ---- */

.link-muted {
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
}

.link-muted:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---- Drilldown ---- */

.report-cell-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: all var(--duration-fast);
}

.report-cell-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.report-drilldown {
  display: block;
  margin-top: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.report-drilldown--idle {
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-style: dashed;
}

.report-drilldown__hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.report-drilldown__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.report-drilldown__title h2 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.report-drilldown__eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.report-drilldown__meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.report-drilldown__meta strong {
  color: var(--text-primary);
}

.report-drilldown__pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
}

.report-drilldown__pill--warning {
  color: var(--accent-warning, #d97706);
  background: color-mix(in srgb, var(--accent-warning, #d97706) 12%, transparent);
}

.report-drilldown__close {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.report-drilldown__close:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
}

.report-drilldown__empty {
  padding: 20px 16px;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

.report-drilldown__kind {
  width: 28px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.report-drilldown__kind--policy {
  color: var(--accent);
}

.report-drilldown__kind--endo {
  color: var(--accent-warning, #d97706);
}

.report-drilldown__basis {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
}

.report-drilldown__policy-row.is-expandable {
  cursor: pointer;
}

.report-drilldown__policy-row.is-expandable:hover {
  background: var(--bg-hover);
}

.report-drilldown__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform var(--duration-fast);
}

.report-drilldown__policy-row.is-expanded .report-drilldown__chevron {
  transform: rotate(90deg);
  color: var(--accent-primary);
}

.report-drilldown__endo-count {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border-radius: 999px;
}

.report-drilldown__endo-detail {
  background: var(--bg-elevated);
  display: none;
}

.report-drilldown__endo-detail.is-shown {
  display: table-row;
}

.report-drilldown__endo-detail-cell {
  padding-left: 32px;
}

/* ---- Filter modal variant ---- */

.report-filters--modal {
  padding: 0;
  border-bottom: none;
}

.report-filters--modal .report-filters__row--stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.report-filters--modal .report-filters__row--stack .report-filters__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.report-filters--modal .report-filters__field--wide {
  grid-column: auto;
}

.report-filters--modal .report-filters__hint {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}
/* ==========================================================================
   ADMIN SETTINGS HUB + LIST TOOLBAR
   ========================================================================== */

/* --- Hub landing ------------------------------------------------------- */

.settings-hub__section {
  margin-top: 32px;
}

.settings-hub__section:first-of-type {
  margin-top: 16px;
}

.settings-hub__section-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.settings-hub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.settings-tile {
  display: block;
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color var(--duration-fast),
              box-shadow var(--duration-fast),
              transform var(--duration-fast);
}

.settings-tile:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.settings-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent-primary);
  margin-bottom: 10px;
}

.settings-tile__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-tile__desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* --- Back-to-hub link (replaces tab strip on list pages) --------------- */

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.admin-back:hover {
  color: var(--accent-primary);
}

.admin-back svg {
  width: 14px;
  height: 14px;
}

/* --- Shared list filter toolbar --------------------------------------- */

.admin-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.admin-filters__form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.admin-filters__search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  padding: 7px 10px 7px 32px;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-base) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 10px center;
  color: var(--text-primary);
}

.admin-filters__search:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 var(--focus-ring-size) var(--accent-muted);
}

.admin-filters__select {
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--bg-base);
  color: var(--text-primary);
  cursor: pointer;
}

.admin-filters__clear {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 8px;
}

.admin-filters__clear:hover {
  color: var(--accent-primary);
}

/* --- Global duplicate audit ------------------------------------------- */

.admin-duplicates-page {
  max-width: 1280px;
}

.admin-duplicate-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.admin-filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}

.admin-filter-pill:hover,
.admin-filter-pill.is-active {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.admin-empty-card {
  padding: 32px;
  text-align: center;
  color: var(--text-secondary);
}

.admin-empty-card__title {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.admin-duplicate-groups {
  display: grid;
  gap: 16px;
}

.admin-duplicate-card {
  overflow: hidden;
}

.admin-duplicate-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.admin-duplicate-card__eyebrow {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-duplicate-card__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
}

.admin-duplicate-card__address {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.admin-duplicate-card__count {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 700;
}

.admin-duplicate-table-wrap {
  overflow-x: auto;
}

.admin-duplicate-table th:first-child,
.admin-duplicate-table th:nth-child(2),
.admin-duplicate-table td:first-child,
.admin-duplicate-table td:nth-child(2) {
  width: 54px;
  text-align: center;
}

.admin-duplicate-table input[type="radio"],
.admin-duplicate-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.admin-usage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 160px;
}

.admin-usage-list span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.admin-duplicate-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.admin-duplicate-card__actions p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

@media (max-width: 760px) {
  .admin-duplicate-card__header,
  .admin-duplicate-card__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
/* ==========================================================================
   CLAIMS – Minimal overrides (layout uses standard dashboard components)
   ========================================================================== */

.claim-adjuster-search {
  position: relative;
  margin-bottom: 14px;
}

.claim-adjuster-search__results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.claim-adjuster-search__results[hidden] {
  display: none;
}

.claim-adjuster-search__option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.claim-adjuster-search__option:hover {
  background: var(--bg-muted);
}

.claim-adjuster-search__option:focus {
  background: var(--bg-muted);
}

.claim-adjuster-search__option:focus-visible {
  outline: var(--focus-ring-size, 2px) solid var(--focus-ring-color, var(--accent-primary));
  outline-offset: 2px;
}

.claim-adjuster-search__option span,
.claim-adjuster-search__empty {
  font-size: 12px;
  color: var(--text-muted);
}

.claim-adjuster-search__empty {
  padding: 9px 10px;
}
/*
 * ==========================================================================
 *   DYNAMIC QUOTE
 *   A beautiful, focused stylesheet for insurance quoting
 *   Dark-first design inspired by Fizzy, clean and minimal
 *   ========================================================================
 *






 *













 *




 *














 */
