/* ================================================
   DIMENSIONS COTIZADOR — Brand Style 2026
   PandaDoc-inspired proposal layout
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --navy: #0d1137;
  --navy-light: #1a1f4e;
  --navy-mid: #141847;
  --blue: #2d3adb;
  --blue-light: #4f5ae8;
  --blue-pale: #e8eafc;
  --blue-glow: rgba(45, 58, 219, 0.12);
  --accent: #3b82f6;
  --accent-light: #dbeafe;
  --beige: #ece8e1;
  --beige-light: #f4f1ec;
  --beige-dark: #d9d4cc;
  --warm-white: #faf8f5;
  --dark: #111111;
  --gray-700: #3a3a3a;
  --gray-500: #6b6b6b;
  --gray-400: #8a8a8a;
  --gray-300: #b5b5b5;
  --gray-200: #d4d4d4;
  --gray-100: #eeeeee;
  --white: #ffffff;
  --green: #22c55e;
  --green-light: #dcfce7;
  --red: #ef4444;
  --orange: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 4px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

/* PWA — iOS safe areas & standalone mode */
@supports (padding-top: env(safe-area-inset-top)) {
  .home-header, .ci-header, .portal-header, .quoter-header {
    padding-top: env(safe-area-inset-top);
  }
  .quoter-footer, .home-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (display-mode: standalone) {
  body { padding-top: 0 !important; }
  .login-screen { padding-top: env(safe-area-inset-top, 20px); }
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: #0d1137;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--dark);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  padding: 24px 16px;
  position: relative;
}

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 58, 219, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 58, 219, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridShift 20s linear infinite;
  z-index: 0;
}

@keyframes gridShift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(48px, 48px); }
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.bg-glow-1 {
  width: 600px; height: 600px;
  background: var(--blue);
  top: -200px; left: -200px;
  animation: glowFloat1 12s ease-in-out infinite;
}

.bg-glow-2 {
  width: 500px; height: 500px;
  background: #6366f1;
  bottom: -200px; right: -200px;
  animation: glowFloat2 15s ease-in-out infinite;
}

@keyframes glowFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(80px, 60px); }
}

@keyframes glowFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-60px, -80px); }
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.quoter-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.hidden { display: none !important; }

/* Global overflow protection — prevents mobile horizontal scroll */
.step, .form-grid, .form-group, .proposal, .proposal-section,
.radio-cards, .sf-grid, .deliverables-grid, .qty-grid,
.location-details, .format-cards, .map-container,
#clientHistorySection, .history-stats, .autocomplete-wrap,
.address-search-wrap, .property-intel, .travel-fee-config,
.proposal-info-bar, .pricing-cards, #similarList,
.price-optimizer, .optimizer-visual, .optimizer-adjust,
.optimizer-insights, .proposal-actions-grid,
.proposal-actions-primary, .proposal-actions-secondary {
  max-width: 100%;
  box-sizing: border-box;
}

.quoter-container.fade-in { animation: appFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   HEADER
   ============================================ */
.quoter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.quoter-header::after {
  content: '';
  position: absolute;
  right: 100px;
  top: -10px;
  bottom: -10px;
  width: 120px;
  background-image: radial-gradient(circle, rgba(45, 58, 219, 0.4) 2px, transparent 2px);
  background-size: 14px 14px;
  opacity: 0.5;
}

.logo-area { display: flex; align-items: center; gap: 14px; z-index: 1; }
.logo-main-img { height: 26px; width: auto; max-width: 160px; object-fit: contain; filter: brightness(0) invert(1); }
.tagline { font-size: 10px; color: var(--gray-400); font-weight: 400; letter-spacing: 1.5px; text-transform: uppercase; }

.header-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 600;
  background: rgba(45, 58, 219, 0.25);
  color: var(--blue-light);
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 1;
  border: 1px solid rgba(45, 58, 219, 0.3);
}

.pulse {
  width: 6px; height: 6px;
  background: var(--blue-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.5); }
}

/* ============================================
   PROGRESS BAR (new connector style)
   ============================================ */
.progress-bar {
  display: flex;
  align-items: center;
  background: var(--warm-white);
  border-bottom: 1px solid var(--gray-100);
  padding: 14px 32px;
  gap: 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  transition: all 0.3s;
}

.step-num {
  display: flex;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  background: var(--gray-200);
  color: var(--white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.3s;
}

.step-label { letter-spacing: 0.3px; }

.progress-connector {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 12px;
  transition: background 0.3s;
}

.progress-step { cursor: pointer; user-select: none; }
.progress-step:hover .step-num { transform: scale(1.1); }
.progress-step.active { color: var(--navy); }
.progress-step.active .step-num { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-glow); }
.progress-step.completed .step-num { background: var(--green); }
.progress-step.completed { color: var(--green); }
.progress-step.completed + .progress-connector { background: var(--green); }

/* Deliverable search */
.deliverable-search:focus { outline: none; border-color: var(--blue) !important; box-shadow: 0 0 0 3px var(--blue-glow); }

/* ============================================
   STEPS
   ============================================ */
.step { display: none; padding: 32px; animation: stepSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.step.active { display: block; }
.step.slide-out { animation: stepSlideOut 0.25s ease forwards; }

@keyframes stepSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes stepSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-30px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Apple-style slide-in for page transitions */
.fade-in {
  animation: appleSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes appleSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Apple-style dropdown animation */
.autocomplete-dropdown.show, .ci-search-results:not(.hidden), .addressDropdown.show {
  animation: appleDropdown 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes appleDropdown {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Apple sheet animation for modals */
@keyframes appleSheet {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Apple toast animation */
@keyframes appleToast {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Softer badge pulse */
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ============================================
   FORM
   ============================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--dark);
  transition: all var(--transition);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.form-group input:focus,
.form-group select:focus {
  border-color: rgba(45,58,219,0.4);
  box-shadow: 0 0 0 3px rgba(45,58,219,0.15);
  outline: none;
  transition: all 0.2s ease;
}

.section-subtitle { font-family: var(--font-display); font-size: 14px; color: var(--gray-500); margin-bottom: 20px; }

/* Radio Cards */
.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.property-cards .radio-card { flex: 0 1 calc(33.33% - 8px); min-width: 80px; }
.project-cards .radio-card { flex: 0 1 calc(33.33% - 8px); min-width: 80px; }
.radio-card {
  flex: 1; padding: 14px 10px;
  border: 1.5px solid var(--beige-dark);
  border-radius: var(--radius);
  text-align: center; cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-display);
  font-size: 13px; font-weight: 500;
  background: var(--white); color: var(--gray-700);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.radio-card:hover { border-color: var(--blue-light); box-shadow: var(--shadow); transform: translateY(-1px); }
.radio-card input { display: none; }
.radio-card .card-icon { font-size: 24px; margin-bottom: 6px; display: block; }
.radio-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-card.active, .radio-card:has(input:checked) {
  border-color: var(--blue); background: var(--blue-pale);
  color: var(--navy); box-shadow: 0 0 0 3px var(--blue-glow);
}
.radio-card:hover { border-color: var(--blue-light); transform: translateY(-1px); }

/* SF Grid */
.sf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sf-input label { font-size: 10px !important; font-weight: 600 !important; color: var(--gray-500) !important; margin-bottom: 4px !important; }
.sf-input input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-body);
  outline: none; background: var(--white);
  transition: border-color 0.2s;
}
.sf-input input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
.sf-input.highlight input {
  background: var(--navy); border-color: var(--navy);
  font-weight: 700; color: var(--white);
  font-family: var(--font-display); font-size: 16px;
}

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
  display: none; position: absolute; top: calc(100% + 4px);
  left: 0; right: 0; background: var(--white);
  border: 1px solid var(--beige-dark); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 100;
  max-height: 240px; overflow-y: auto;
}
.autocomplete-dropdown.show { display: block; }
.ac-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--gray-100); transition: background 0.15s; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--beige-light); }
.ac-item .ac-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--navy); }
.ac-item .ac-meta { font-size: 11px; color: var(--gray-500); margin-top: 3px; }
.ac-item .ac-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-left: 8px; letter-spacing: 0.3px; text-transform: uppercase; }
.ac-badge.recurring { background: var(--green-light); color: #15803d; }
.ac-badge.new { background: var(--blue-pale); color: var(--blue); }

.client-badge {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--navy); color: var(--white);
  border-radius: 24px; font-size: 12px; font-weight: 500;
  font-family: var(--font-display);
  transition: background 0.3s;
}
.client-badge.hidden { display: none; }
.client-badge.client-recurring { background: var(--navy); }
.client-badge.client-recurring .badge-icon { color: var(--green); }
.client-badge.client-new { background: linear-gradient(135deg, #7c3aed, #6366f1); }
.client-badge.client-new .badge-icon { color: #fbbf24; }
.badge-icon { font-weight: 700; color: var(--green); }
.badge-clear { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--gray-400); margin-left: 4px; line-height: 1; }
.badge-clear:hover { color: var(--white); }

/* Client tags in proposal */
.new-client-tag {
  display: inline-block;
  font-size: 8px; font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 6px;
}
.recurring-client-tag {
  display: inline-block;
  font-size: 8px; font-weight: 800;
  background: var(--green);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 6px;
}

.zip-badge { margin-top: 6px; font-family: var(--font-display); font-size: 11px; font-weight: 600; }
.zip-badge.hidden { display: none; }

/* Client History */
#clientHistorySection { background: var(--beige-light); border-radius: var(--radius); padding: 20px; border: 1px solid var(--beige-dark); }
#clientHistorySection h3 { font-family: var(--font-display); font-size: 13px; font-weight: 700; margin-bottom: 14px; color: var(--navy); text-transform: uppercase; letter-spacing: 1px; }
/* Client History — force contained layout */
#clientHistorySection { overflow: hidden; max-width: 100%; }
#clientHistorySection h3 { font-size: 14px; margin-bottom: 10px; }
.history-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: var(--warm-white); border-radius: var(--radius-sm); padding: 14px 12px; text-align: center; border: 1px solid var(--beige-dark); overflow: hidden; box-shadow: var(--shadow-sm); transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.stat-card:active { transform: scale(0.98); }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 9px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; font-weight: 600; }
.history-table { overflow-x: auto; }
.history-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-table th { text-align: left; padding: 8px 10px; font-family: var(--font-display); font-weight: 700; color: var(--navy); border-bottom: 2px solid var(--beige-dark); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.history-table td { padding: 8px 10px; border-bottom: 1px solid var(--beige-dark); color: var(--gray-700); }
.history-table tr:hover td { background: var(--blue-pale); }
.history-deliverables { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.history-deliverables .del-label { font-size: 11px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: 0.5px; }
.del-tag { display: inline-flex; align-items: center; gap: 3px; background: var(--blue-pale); color: var(--blue); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; border: 1px solid rgba(41,98,255,0.15); }
.del-tag small { color: var(--gray-500); font-weight: 500; }
.del-cell { font-size: 11px; color: var(--gray-500); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--blue); line-height: 1.2; }

/* Deliverables Grid */
.deliverables-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.deliverable-card {
  padding: 14px 10px; border: 1.5px solid var(--beige-dark);
  border-radius: var(--radius); text-align: center; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-display);
  font-size: 12px; font-weight: 500; background: var(--white); color: var(--gray-700);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.deliverable-card input[type="checkbox"] { display: none; }
.deliverable-card .del-icon { font-size: 22px; margin-bottom: 4px; }
.deliverable-card .del-rate { display: block; font-family: var(--font-body); font-size: 10px; color: var(--gray-400); margin-top: 3px; }
.deliverable-card:has(input:checked) { border-color: var(--blue); background: linear-gradient(135deg, var(--blue-pale) 0%, #f0f0ff 100%); color: var(--navy); transform: scale(1.02); box-shadow: 0 2px 8px rgba(45, 58, 219, 0.15); }
.deliverable-card:has(input:checked) .del-rate { color: var(--blue); }
.deliverable-card:hover { border-color: var(--blue-light); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* Inline quantity inputs inside deliverable cards */
.del-qty-inline {
  display: none;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--beige-dark);
  width: 100%;
}
.deliverable-card:has(input:checked) .del-qty-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.del-qty-inline label, .del-qty-inline .del-qty-label {
  font-size: 10px;
  color: var(--gray-500);
  white-space: nowrap;
  margin: 0;
  font-weight: 600;
}
.del-qty-inline input[type="number"] {
  width: 50px;
  padding: 4px 6px;
  border: 1px solid var(--beige-dark);
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
}

/* Quantities */
.quantities-section { background: var(--beige-light); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; border: 1px solid var(--beige-dark); }
.quantities-section h3 { font-family: var(--font-display); font-size: 13px; font-weight: 700; margin-bottom: 14px; color: var(--navy); text-transform: uppercase; }
.qty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.qty-input label { font-size: 11px; color: var(--gray-500); display: block; margin-bottom: 4px; font-weight: 500; }
.qty-input input { width: 100%; padding: 9px 12px; border: 1.5px solid var(--beige-dark); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font-body); outline: none; background: var(--white); }
.qty-input input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
.qty-input.hidden { display: none; }
.quantities-section.hidden { display: none; }

/* Address & Map */
.address-search-wrap { position: relative; z-index: 500; }
.address-dropdown {
  display: none; position: absolute; top: calc(100% + 4px);
  left: 0; right: 0; background: var(--white);
  border: 1px solid var(--beige-dark); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 1000;
  max-height: 240px; overflow-y: auto;
}
.address-dropdown.show { display: block; }
.address-dropdown .ac-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--gray-100); font-size: 13px; transition: background 0.15s; }
.address-dropdown .ac-item:hover { background: var(--beige-light); }
.address-dropdown .ac-item:last-child { border-bottom: none; }

.map-container { border-radius: var(--radius-lg); overflow: hidden; border: 1.5px solid var(--beige-dark); background: var(--gray-100); }
.map-controls { display: flex; gap: 6px; padding: 8px 10px; background: var(--warm-white); border-top: 1px solid var(--gray-100); flex-wrap: wrap; }
.map-btn { padding: 5px 12px; border: 1.5px solid var(--beige-dark); border-radius: var(--radius-sm); background: var(--warm-white); font-family: var(--font-display); font-size: 10px; font-weight: 600; cursor: pointer; color: var(--gray-500); text-decoration: none; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); text-transform: uppercase; letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 4px; }
.map-btn:hover, .map-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.map-link { margin-left: auto; }
.map-btn-property { border-color: var(--blue); color: var(--blue); }
.map-btn-property:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ============================================
   PROPERTY MARKET INTELLIGENCE PANEL
   ============================================ */
.property-intel {
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
  background: var(--warm-white);
}
.property-intel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--warm-white) 100%);
  border-bottom: 1px solid var(--beige-dark);
}
.property-intel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.property-intel-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-400);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.property-intel-close:hover { background: rgba(0,0,0,0.05); color: var(--navy); }
.property-intel-body { padding: 12px 14px; }
.property-intel-loading {
  text-align: center;
  padding: 16px 0;
  font-size: 11px;
  color: var(--gray-400);
}
.property-intel-empty {
  text-align: center;
  padding: 12px 0;
  font-size: 11px;
  color: var(--gray-400);
}

/* Property result card */
.property-result {
  padding: 10px 12px;
  background: var(--beige-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid transparent;
}
.property-result:last-child { margin-bottom: 0; }
.property-result:hover { border-color: var(--blue-pale); background: var(--blue-pale); }
.property-result-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  font-family: var(--font-display);
}
.property-result-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pi-detail {
  font-size: 10px;
  color: var(--gray-500);
  background: var(--warm-white);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
}
.pi-detail strong { color: var(--navy); font-weight: 700; }
.pi-price { color: var(--green); font-weight: 700; }
.pi-price strong { color: var(--green); }
.pi-type { font-weight: 700; text-transform: capitalize; }

/* SF match indicator */
.pi-sf-match {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.pi-sf-match.match-good { background: #dcfce7; color: #065f46; }
.pi-sf-match.match-warn { background: #fef3c7; color: #92400e; }
.pi-sf-match.match-alert { background: #fee2e2; color: #991b1b; }

/* Bottom links */
.property-intel-links {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--beige-dark);
}
.property-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.property-link.zillow { color: #006aff; border-right: 1px solid var(--beige-dark); }
.property-link.zillow:hover { background: #e8f0ff; }
.property-link.redfin { color: #a02021; }
.property-link.redfin:hover { background: #fde8e8; }

.location-details .form-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-top: 12px; }

/* Buttons */
.step-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--beige-dark); }
.btn-primary { padding: 14px 28px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%); color: var(--white); border: none; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); letter-spacing: 0.5px; text-transform: uppercase; box-shadow: 0 2px 8px rgba(45, 58, 219, 0.25); }
.btn-primary:hover { background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(13, 17, 55, 0.3); }
.btn-primary:active { transform: scale(0.96); box-shadow: 0 2px 6px rgba(13, 17, 55, 0.2); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-secondary { padding: 13px 28px; background: transparent; color: var(--navy); border: 1.5px solid var(--beige-dark); border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.btn-secondary:active { transform: scale(0.96); }
.btn-secondary:hover { background: var(--beige-light); border-color: var(--navy); }
.btn-accent { padding: 13px 28px; background: var(--navy); color: var(--white); border: none; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); text-transform: uppercase; }
.btn-accent:active { transform: scale(0.96); }
.btn-accent:hover { background: var(--navy-light); transform: translateY(-1px); }

/* ============================================
   PROPOSAL (Step 3 — PandaDoc style)
   ============================================ */
.proposal { background: var(--warm-white); }

.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
  background: var(--navy);
  border-radius: var(--radius-lg);
  color: var(--white);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.proposal-header::before {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 180px; height: 180px;
  background-image: radial-gradient(circle, rgba(45, 58, 219, 0.3) 2px, transparent 2px);
  background-size: 12px 12px;
  opacity: 0.5;
}

.proposal-header-left { display: flex; align-items: center; gap: 20px; z-index: 1; }
.proposal-logo { height: 32px; max-width: 70%; object-fit: contain; filter: brightness(0) invert(1); }
.proposal-meta { display: flex; flex-direction: column; gap: 2px; }
.proposal-id { font-family: var(--font-display); font-size: 11px; color: var(--gray-300); letter-spacing: 1px; }
.proposal-date { font-size: 11px; color: var(--gray-400); }

.proposal-total-box { text-align: right; z-index: 1; }
.proposal-total-label { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--gray-400); margin-bottom: 4px; }
.proposal-total-amount { font-family: var(--font-display); font-size: 42px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.proposal-total-persf { font-family: var(--font-display); font-size: 14px; color: var(--blue-light); margin-top: 4px; }

/* Info Bar */
.proposal-info-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--beige-dark);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.info-item {
  background: var(--warm-white);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-400); font-family: var(--font-display); }
.info-value { font-size: 13px; font-weight: 600; color: var(--navy); font-family: var(--font-display); }

/* Proposal Sections */
.proposal-section { margin-bottom: 24px; }
.proposal-section-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--navy);
}

/* Proposal Tables */
.proposal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.proposal-table th {
  text-align: left; padding: 10px 12px;
  font-family: var(--font-display); font-weight: 700;
  color: var(--gray-500); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--beige-dark);
  background: var(--beige-light);
}
.proposal-table td { padding: 10px 12px; border-bottom: 1px solid var(--beige-dark); color: var(--gray-700); }
.proposal-table tr:hover td { background: var(--blue-pale); }
.proposal-table tr.main-service td { background: var(--navy); color: var(--white); font-weight: 600; }
.proposal-table tr.main-service:hover td { background: var(--navy-light); }

/* Scope Table */
.scope-qty-input {
  width: 48px; padding: 4px 2px; border: 1.5px solid var(--beige-dark); border-radius: 4px;
  font-size: 13px; font-weight: 600; text-align: center; background: var(--white);
  font-family: var(--font-display); color: var(--navy); transition: border-color 0.2s;
}
.scope-qty-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.scope-table td:nth-child(2), .scope-table td:nth-child(3) { text-align: center; }
.scope-table td:nth-child(4) { text-align: right; font-family: var(--font-display); font-weight: 600; }
.scope-table th:nth-child(2), .scope-table th:nth-child(3) { text-align: center; }
.scope-table th:nth-child(4) { text-align: right; }
.included-badge { color: var(--green); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Pricing Cards */
.pricing-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pricing-card {
  background: var(--beige-light); border: 1px solid var(--beige-dark);
  border-radius: var(--radius); padding: 16px; text-align: center;
  transition: all var(--transition); box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.pricing-card:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.pricing-card.highlight { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); border-color: var(--navy); color: var(--white); box-shadow: 0 4px 16px rgba(13, 17, 55, 0.2); }
.pricing-card-label { font-family: var(--font-display); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); margin-bottom: 6px; }
.pricing-card.highlight .pricing-card-label { color: var(--gray-300); }
.pricing-card-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--navy); }
.pricing-card.highlight .pricing-card-value { color: var(--white); }
.pricing-card-detail { font-size: 10px; color: var(--gray-400); margin-top: 4px; }
.pricing-card.highlight .pricing-card-detail { color: var(--blue-light); }

/* Similar Projects */
#similarList { display: grid; gap: 6px; margin-top: 8px; }
.similar-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 12px;
  background: var(--beige-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--beige-dark);
  font-size: 12px;
  align-items: center;
}
.similar-row span:first-child { font-weight: 600; color: var(--navy); }

/* Client Comparison */
.comparison-card { background: var(--beige-light); border: 1px solid var(--beige-dark); border-radius: var(--radius); padding: 20px; }
.comparison-card h4 { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.comp-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--gray-700); }
.comp-value { font-family: var(--font-display); font-weight: 700; }
.comp-diff { text-align: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--beige-dark); }

/* Proposal Note */
/* Proposal alerts */
.proposal-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.proposal-alert-icon { font-size: 16px; flex-shrink: 0; line-height: 1.3; }
.proposal-alert strong { font-weight: 700; }
.proposal-alert-danger {
  background: rgba(239,68,68,0.06);
  border-left: 3px solid var(--red);
  color: #991b1b;
}
.proposal-alert-warn {
  background: rgba(245,158,11,0.06);
  border-left: 3px solid var(--orange);
  color: #92400e;
}
.proposal-alert-info {
  background: rgba(45,58,219,0.05);
  border-left: 3px solid var(--blue);
  color: var(--navy);
}
.proposal-alert-new-client {
  background: rgba(124,58,237,0.06);
  border-left: 3px solid #7c3aed;
  color: #4c1d95;
}

/* Live preview alerts */
.live-preview-alerts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.live-alert {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.live-alert-danger { background: rgba(239,68,68,0.15); color: #fca5a5; }
.live-alert-warn { background: rgba(245,158,11,0.15); color: #fcd34d; }
.live-alert-info { background: rgba(45,58,219,0.15); color: #93c5fd; }

.proposal-note {
  background: var(--beige-light); padding: 14px 18px;
  border-radius: var(--radius); font-size: 11px;
  color: var(--gray-500); line-height: 1.6;
  margin: 24px 0; border-left: 3px solid var(--blue);
}
.proposal-note strong { color: var(--navy); }

/* Proposal Actions */
.proposal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.proposal-actions-grid { display: flex; flex-direction: column; gap: 14px; }
.proposal-actions-primary { display: flex; gap: 12px; justify-content: center; }
.proposal-actions-secondary { display: flex; gap: 10px; justify-content: center; }
.btn-lg { padding: 16px 36px; font-size: 14px; }
.proposal-actions-secondary .btn-secondary,
.proposal-actions-secondary .btn-accent { padding: 10px 20px; font-size: 12px; }

/* ============================================
   FOOTER
   ============================================ */
.quoter-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 32px; background: var(--navy);
  font-size: 11px; color: var(--gray-400);
}
.quoter-footer strong { color: var(--white); font-family: var(--font-display); text-transform: uppercase; letter-spacing: 1px; }
.quoter-footer a { color: var(--blue-light); text-decoration: none; font-weight: 600; font-family: var(--font-display); }
.quoter-footer a:hover { color: var(--white); }

/* ============================================
   TOAST
   ============================================ */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px); padding: 14px 28px; border-radius: var(--radius); font-family: var(--font-display); font-size: 13px; font-weight: 600; z-index: 9999; opacity: 0; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); box-shadow: var(--shadow-lg); max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); animation: appleToast 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.toast-error { background: var(--navy); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.toast-success { background: var(--navy); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.toast-info { background: var(--navy); color: var(--blue-light); border: 1px solid rgba(45, 58, 219, 0.3); }

/* ============================================
   SPLASH
   ============================================ */
.splash { position: fixed; inset: 0; z-index: 10000; background: var(--navy); display: flex; align-items: center; justify-content: center; transition: opacity 0.9s ease, visibility 0.9s ease; }
.splash.fade-out { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; }
.splash-logo { height: 52px; width: auto; max-width: 80%; object-fit: contain; filter: brightness(0) invert(1); opacity: 0; animation: splashLogoIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.splash-bar { width: 200px; height: 3px; background: rgba(255,255,255,0.08); border-radius: 3px; margin: 28px auto 0; overflow: hidden; }
.splash-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), var(--blue-light)); border-radius: 3px; animation: splashProgress 3.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }
.splash-text { font-family: var(--font-display); font-size: 11px; color: var(--gray-400); margin-top: 20px; letter-spacing: 1.5px; opacity: 0; animation: splashTextIn 0.8s 0.6s ease forwards; }
@keyframes splashLogoIn { 0% { opacity: 0; transform: scale(0.8) translateY(8px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes splashProgress { 0% { width: 0%; } 40% { width: 35%; } 70% { width: 65%; } 90% { width: 88%; } 100% { width: 100%; } }
@keyframes splashTextIn { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: translateY(0); } }

/* ============================================
   CHAT WIDGET
   ============================================ */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 9000; font-family: var(--font-body); }
.chat-toggle { width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: var(--white); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(45, 58, 219, 0.4); transition: all 0.3s; position: relative; }
.chat-toggle:hover { background: var(--navy); transform: scale(1.08); }
.chat-toggle svg { width: 24px; height: 24px; }
.chat-toggle svg.hidden { display: none; }
.chat-badge { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; background: var(--red); color: var(--white); border-radius: 50%; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; animation: pulse 2s infinite; }

.chat-panel { position: absolute; bottom: 70px; right: 0; width: 380px; max-height: 520px; background: var(--warm-white); border-radius: var(--radius-lg); box-shadow: 0 12px 48px rgba(0,0,0,0.2); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--gray-100); }
.chat-panel.hidden { display: none; }
.chat-slide-in { animation: chatSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes chatSlideIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.chat-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--navy); color: var(--white); }
.chat-logo { height: 28px; width: 28px; border-radius: 50%; object-fit: cover; }
.chat-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
.chat-status { font-size: 10px; color: var(--gray-400); display: flex; align-items: center; gap: 4px; }
.chat-status-dot { width: 6px; height: 6px; background: #25d366; border-radius: 50%; display: inline-block; animation: pulse 2s infinite; }
.chat-close { margin-left: auto; background: none; border: none; color: var(--gray-400); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px; }
.chat-close:hover { color: var(--white); }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 340px; min-height: 200px; background: var(--beige-light); }
.chat-msg { display: flex; max-width: 85%; }
.chat-msg.user { align-self: flex-end; }
.chat-msg.bot { align-self: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.chat-msg.user .chat-bubble { background: var(--blue); color: var(--white); border-bottom-right-radius: 4px; }
.chat-msg.bot .chat-bubble { background: var(--white); color: var(--dark); border: 1px solid var(--beige-dark); border-bottom-left-radius: 4px; }
.wpp-badge { display: inline-block; background: #25d366; color: var(--white); font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-right: 6px; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle; }
.typing-dots span { display: inline-block; animation: typingBounce 1.4s infinite; font-size: 20px; line-height: 1; color: var(--gray-400); }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

.chat-input-area { display: flex; align-items: center; padding: 10px 12px; border-top: 1px solid var(--gray-100); gap: 8px; background: var(--white); }
.chat-input-area input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--beige-dark); border-radius: 24px; font-size: 13px; font-family: var(--font-body); outline: none; background: var(--beige-light); transition: border-color 0.2s; }
.chat-input-area input:focus { border-color: var(--blue); background: var(--white); }
.chat-input-area input:disabled { opacity: 0.6; }
#chatSend { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: var(--white); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); flex-shrink: 0; }
#chatSend:hover { background: var(--navy); transform: scale(1.06); }
#chatSend svg { width: 18px; height: 18px; }

/* Client search + Account ID row */
.client-search-flex {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.account-id-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.account-id-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}

/* Client history KPI grid — 4 columns desktop, 2 columns mobile */
.history-stats-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* History insight box */
.history-insight { word-break: break-word; }

/* ============================================
   RESPONSIVE
   ============================================ */

/* --- Tablet landscape / small desktop (≤1024px) --- */
@media (max-width: 1024px) {
  body { padding: 16px 12px; }
  .quoter-container { max-width: 100%; }
  .step { padding: 28px 24px; }
  .sf-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .deliverables-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .proposal-total-amount { font-size: 36px; }
  .live-preview { padding: 10px 20px; gap: 12px; }
  .live-preview-price { font-size: 20px; }
}

/* --- Tablet portrait (≤768px) --- */
@media (max-width: 768px) {
  body { padding: 10px 8px; }
  .quoter-header { padding: 14px 20px; }
  .quoter-header::after { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .sf-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .deliverables-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .radio-cards { flex-wrap: wrap; }
  .property-cards .radio-card, .project-cards .radio-card { flex: 0 1 calc(50% - 6px); min-width: 0; }
  .qty-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .step { padding: 24px 20px; }
  .progress-bar { padding: 12px 20px; }
  .proposal-header { padding: 24px 20px; }
  .proposal-total-amount { font-size: 34px; }
  .proposal-info-bar { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .pricing-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .proposal-actions-primary { flex-wrap: wrap; }
  .proposal-actions-secondary { flex-wrap: wrap; }
  .history-stats { grid-template-columns: repeat(3, 1fr); }
  .location-details .form-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .live-preview { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .live-preview-header { font-size: 9px; }
  .live-preview-price { font-size: 18px; min-width: 80px; }
  .live-preview-details { font-size: 11px; gap: 6px; }
  .live-preview-bar { min-width: 50px; max-width: 80px; }
  .chat-panel { width: calc(100vw - 24px); }
  .adjust-quick-actions { flex-wrap: wrap; gap: 8px; }
  .btn-quick { padding: 8px 16px; font-size: 11px; }
  .quick-label { font-size: 14px; }
  .methods-grid { grid-template-columns: 1fr; }
  #map { height: 240px !important; }
}

/* --- Mobile (≤640px) — Complete responsive overhaul --- */
@media (max-width: 640px) {
  body { padding: 0; overflow-x: hidden !important; }
  html { overflow-x: hidden !important; }
  .quoter-container { border-radius: 0; border: none; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; width: 100%; max-width: 100vw; }
  .leads-portal { overflow-x: hidden; width: 100%; }
  .bg-glow { display: none; }

  /* ---- LOGIN ---- */
  .login-card { width: 92%; max-width: 360px; padding: 32px 24px 28px; }
  .login-logo { height: 28px; margin-bottom: 18px; }
  .login-title { font-size: 18px; }
  .login-subtitle { font-size: 12px; margin-bottom: 24px; }
  .login-field { margin-bottom: 14px; }
  .login-field label { font-size: 9px; }
  .login-field input { padding: 10px 12px; font-size: 14px; }
  .login-btn { padding: 12px; font-size: 13px; }
  .login-footer { font-size: 10px; margin-top: 16px; }

  /* ---- SPLASH ---- */
  .splash-logo { height: 30px; }
  .splash-text { font-size: 11px; }

  /* ---- HEADER (cotizador) ---- */
  .quoter-header { padding: 10px 12px; gap: 6px; }
  .logo-area { gap: 6px; overflow: hidden; min-width: 0; }
  .logo-main-img { height: 18px; width: auto; max-width: 110px; object-fit: contain; }
  .tagline { font-size: 7px; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
  .header-badge { font-size: 7px; padding: 3px 6px; gap: 4px; white-space: nowrap; }
  .quoter-header::after { display: none; }

  /* ---- PROGRESS BAR ---- */
  .progress-bar { padding: 8px 12px; }
  .step-label { display: block; font-size: 8px; }
  .step-num { width: 24px; height: 24px; font-size: 10px; }
  .progress-step { gap: 2px; }
  .progress-connector { margin: 0 4px; flex: 1; }

  /* ---- LIVE PREVIEW ---- */
  .live-preview { padding: 8px 12px; gap: 6px; flex-wrap: wrap; }
  .live-preview-header { font-size: 8px; gap: 4px; }
  .live-preview-price { font-size: 16px; min-width: 60px; }
  .live-preview-details { display: none; }
  .live-preview-bar { flex: 1; min-width: 40px; max-width: 100%; }
  .live-preview-alerts { font-size: 10px; padding: 3px 6px; }

  /* ---- FORM ---- */
  .form-grid { grid-template-columns: 1fr; gap: 14px; overflow: hidden; width: 100%; }
  .form-group { overflow: hidden !important; max-width: 100% !important; }
  .form-group.full-width { overflow: hidden !important; }
  .step { padding: 16px 12px; overflow: hidden; width: 100%; }
  .form-group label { font-size: 10px; letter-spacing: 0.8px; }
  .form-group input, .form-group select { font-size: 14px; padding: 10px 12px; max-width: 100%; box-sizing: border-box; }
  .field-hint { font-size: 10px; }

  /* ---- CLIENT SEARCH ROW ---- */
  .client-search-flex { flex-wrap: wrap; gap: 8px; }
  .account-id-wrap { flex-basis: 100%; flex-direction: row; align-items: center; gap: 8px; }
  .account-id-wrap input { flex: 1; width: 100% !important; }

  /* ---- CLIENT BADGE ---- */
  .client-badge { font-size: 11px; padding: 8px 10px; flex-wrap: wrap; }

  /* ---- CLIENT HISTORY ---- */
  .history-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .stat-card { padding: 10px 8px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 9px; }
  .history-deliverables { font-size: 11px; flex-wrap: wrap; gap: 4px; }
  .del-tag { font-size: 10px; padding: 2px 6px; }
  .history-table { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px; }
  .history-table table { min-width: 480px; font-size: 11px; }

  /* ---- PROPERTY / PROJECT TYPE CARDS ---- */
  .radio-cards { flex-wrap: wrap; gap: 6px; overflow: hidden; width: 100%; }
  .property-cards .radio-card,
  .project-cards .radio-card {
    flex: 0 1 calc(33.33% - 4px); min-width: 0 !important;
    padding: 10px 4px; gap: 4px; overflow: hidden;
  }
  .property-cards .radio-card .card-icon,
  .project-cards .radio-card .card-icon { font-size: 20px; margin-bottom: 2px; }
  .property-cards .radio-card span,
  .project-cards .radio-card span { font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ---- OUTPUT FORMAT (CAD / BIM) ---- */
  .format-cards { gap: 6px; }
  .format-cards .radio-card { flex: 1; min-width: 0; padding: 12px 8px; overflow: hidden; }
  .format-cards .radio-card .card-icon { font-size: 16px; }
  .format-cards .radio-card span { font-size: 11px; }
  .format-cards .radio-card small { font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

  /* ---- SF BREAKDOWN ---- */
  .sf-grid { grid-template-columns: 1fr; gap: 8px; overflow: hidden; width: 100%; }
  .sf-input { overflow: hidden; max-width: 100%; }
  .sf-input label { font-size: 10px; }
  .sf-input input { font-size: 14px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
  .sf-input.highlight input { font-size: 16px; font-weight: 700; }

  /* ---- DELIVERABLES ---- */
  .deliverables-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .deliverable-card { padding: 10px 8px; font-size: 11px; gap: 4px; }
  .del-icon { font-size: 20px; }
  .del-rate { font-size: 9px; }
  .del-counter { font-size: 11px; }
  .deliverable-search { font-size: 12px !important; padding: 7px 12px 7px 28px !important; }
  .qty-grid { grid-template-columns: 1fr; gap: 8px; }

  /* ---- ADDRESS / MAP ---- */
  .autocomplete-wrap, .address-search-wrap { overflow: hidden; max-width: 100%; }
  .autocomplete-wrap input,
  .address-search-wrap input { font-size: 13px; width: 100%; box-sizing: border-box; }
  .ac-item { padding: 8px 10px; }
  .ac-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  .ac-meta { font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
  #map { height: 180px !important; width: 100% !important; }
  .map-container { overflow: hidden !important; max-width: 100% !important; border-radius: var(--radius); }
  .map-controls { flex-wrap: wrap; gap: 4px; overflow: hidden; }
  .map-btn { font-size: 10px; padding: 5px 8px; }
  .location-details { overflow: hidden; max-width: 100%; }
  .location-details .form-row { grid-template-columns: 1fr; gap: 8px; overflow: hidden; }
  .location-details .form-group input { width: 100%; box-sizing: border-box; }
  .zip-badge { font-size: 10px; word-break: break-word; }

  /* ---- PROPERTY INTEL ---- */
  .property-intel { margin-top: 6px; }
  .property-intel-header { padding: 8px 10px; }
  .property-intel-title { font-size: 12px; }
  .property-link { font-size: 11px; padding: 6px 10px; }

  /* ---- TRAVEL FEE ---- */
  .travel-fee-config { flex-wrap: wrap; gap: 6px; }
  .travel-fee-config label { font-size: 10px; }
  .travel-fee-config input { width: 80px; font-size: 13px; }

  /* ---- STEP ACTIONS ---- */
  .step-actions { flex-direction: column; gap: 8px; }
  .step-actions .btn-primary,
  .step-actions .btn-secondary { width: 100%; text-align: center; justify-content: center; }

  /* ---- CLIENT HISTORY (Step 1 — fix overflow) ---- */
  #clientHistorySection { overflow: hidden !important; max-width: 100% !important; width: 100% !important; }
  .history-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 6px; }
  .history-stats-kpi { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card { padding: 8px 6px; overflow: hidden; }
  .stat-value { font-size: 14px; word-break: break-all; }
  .stat-label { font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .history-insight { font-size: 11px !important; padding: 6px 10px !important; }
  .history-deliverables { font-size: 10px; flex-wrap: wrap; gap: 3px; overflow: hidden; }
  .del-tag { font-size: 9px; padding: 2px 5px; }
  .history-table { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .history-table table { min-width: 380px; font-size: 10px; table-layout: fixed; width: 100%; }
  .history-table th, .history-table td { padding: 4px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Hide Deliverables column (last) on mobile — Status stays visible */
  .history-table th:nth-child(6), .history-table td:nth-child(6) { display: none; }
  .history-table th:nth-child(1) { width: 30%; }
  .history-table th:nth-child(2), .history-table th:nth-child(3), .history-table th:nth-child(4) { width: 18%; }
  .history-table th:nth-child(5) { width: 16%; }

  /* ---- MAP & LOCATION (Step 1 — fix overflow) ---- */
  #map { height: 180px !important; }
  .map-container { overflow: hidden; border-radius: var(--radius); }
  .map-controls { flex-wrap: wrap; gap: 3px; padding: 4px 6px; }
  .map-btn { font-size: 9px; padding: 4px 6px; white-space: nowrap; }
  .map-link { overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
  .map-btn-property { font-size: 9px; }
  .location-details .form-row { grid-template-columns: 1fr; gap: 8px; }

  /* ---- OUTPUT FORMAT CAD/BIM (Step 1 — fix overflow) ---- */
  .format-cards { gap: 6px; }
  .format-cards .radio-card {
    flex: 1; min-width: 0; padding: 12px 8px;
    overflow: hidden;
  }
  .format-cards .radio-card .card-icon { font-size: 16px; }
  .format-cards .radio-card span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .format-cards .radio-card small { font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }

  /* ---- PROPERTY INTEL ---- */
  .property-intel { margin-top: 6px; }
  .property-intel-header { padding: 8px 10px; flex-wrap: wrap; }
  .property-intel-title { font-size: 11px; }
  .property-intel-body { padding: 10px; font-size: 12px; }
  .property-intel-links { padding: 6px 10px; gap: 6px; flex-wrap: wrap; }
  .property-link { font-size: 11px; padding: 4px 8px; }

  /* ---- TRAVEL FEE ---- */
  .travel-fee-config { flex-wrap: wrap; gap: 4px; }
  .travel-fee-config label { font-size: 10px; }
  .travel-fee-config input { width: 70px; font-size: 13px; }

  /* ---- PROPOSAL (Step 3) ---- */
  .proposal { overflow: hidden; }
  .proposal-header { flex-direction: column; gap: 12px; text-align: center; padding: 16px 12px; }
  .proposal-header-left { flex-direction: column; align-items: center; gap: 6px; }
  .proposal-logo { height: 20px; }
  .proposal-meta { text-align: center; }
  .proposal-id { font-size: 10px; }
  .proposal-date { font-size: 9px; }
  .proposal-total-box { text-align: center; padding: 12px; }
  .proposal-total-label { font-size: 9px; }
  .proposal-total-amount { font-size: 26px; }
  .proposal-total-persf { font-size: 10px; }

  /* Proposal info bar */
  .proposal-info-bar { grid-template-columns: 1fr 1fr; gap: 3px; padding: 8px 10px; }
  .info-item { padding: 5px; overflow: hidden; }
  .info-label { font-size: 7px; }
  .info-value { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Proposal sections */
  .proposal-section { padding: 12px 10px; overflow: hidden; }
  .proposal-section-title { font-size: 12px; margin-bottom: 8px; }

  /* All proposal tables — wrap in scrollable container */
  .proposal-section { overflow-x: hidden; }
  .proposal-table { font-size: 10px; width: 100%; table-layout: auto; }
  .proposal-table th { font-size: 8px; padding: 5px 4px; white-space: nowrap; }
  .proposal-table td { padding: 5px 4px; vertical-align: top; word-break: break-word; }

  /* SF breakdown — simple, fits in mobile */
  .proposal-table:not(.scope-table) td { white-space: nowrap; padding: 4px 6px; }

  /* Scope table — compact for mobile */
  .scope-table { font-size: 10px; }
  .scope-table th { font-size: 7px; padding: 4px 3px; }
  .scope-table th:nth-child(1) { width: 45%; }
  .scope-table th:nth-child(2),
  .scope-table th:nth-child(3) { width: 15%; }
  .scope-table th:nth-child(4) { width: 25%; }
  .scope-table td { padding: 5px 3px; font-size: 10px; }
  .scope-table td:first-child { font-size: 10px; line-height: 1.3; }
  .scope-table td:first-child strong { font-size: 10px; display: block; margin-bottom: 2px; }

  /* Pricing Basis cards */
  .pricing-cards { grid-template-columns: 1fr 1fr; gap: 5px; }
  .pricing-card { padding: 10px 8px; overflow: hidden; }
  .pricing-card-label { font-size: 8px; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pricing-card-value { font-size: 16px; }
  .pricing-card-detail { font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Similar Projects */
  .similar-row { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; padding: 6px 8px; font-size: 10px; }
  .similar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Client comparison */
  .comparison-card { padding: 12px; }
  .comparison-card h4 { font-size: 10px; }
  .comp-row { font-size: 12px; flex-wrap: wrap; }
  .comp-diff { font-size: 16px; }

  /* Proposal alerts */
  .proposal-alert { font-size: 11px; padding: 10px; line-height: 1.4; }
  .proposal-alert-icon { font-size: 16px; }
  .proposal-note { padding: 10px; font-size: 10px; line-height: 1.5; }

  /* ---- PRICE OPTIMIZER ---- */
  .price-optimizer { padding: 0; overflow: hidden; }
  .optimizer-visual { padding: 8px; }
  .price-range-bar { height: 20px; border-radius: 4px; overflow: hidden; }
  .price-range-labels { font-size: 9px; flex-wrap: wrap; }
  .price-range-legend { flex-wrap: wrap; gap: 4px; font-size: 8px; }
  .legend-item { white-space: nowrap; }
  .price-range-source { font-size: 9px; word-break: break-word; }
  .marker-label { font-size: 10px; white-space: nowrap; }
  .optimizer-adjust { padding: 10px; }
  .adjust-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .adjust-gauge { text-align: center; }
  .adjust-gauge-value { font-size: 18px; }
  .adjust-gauge-label { font-size: 9px; }
  .adjust-price-box { text-align: center; }
  .adjust-label { font-size: 9px; }
  .adjust-price-input { width: 100%; max-width: 180px; font-size: 20px; margin: 0 auto; display: block; }
  .adjust-persf { font-size: 11px; text-align: center; }
  .adjust-slider-wrap { padding: 8px 0; }
  .slider-ticks { font-size: 9px; }
  .adjust-quick-actions { flex-direction: column; gap: 6px; }
  .btn-quick { width: 100%; font-size: 11px; padding: 10px; }
  .quick-label { font-size: 11px; text-align: center; display: block; }
  .adjust-feedback { font-size: 10px; padding: 8px; word-break: break-word; }

  /* Optimizer insights */
  .optimizer-insights { font-size: 11px; }
  .optimizer-insights > div { padding: 8px; word-break: break-word; line-height: 1.4; }
  .methods-grid { grid-template-columns: 1fr; }

  /* ---- PROPOSAL ACTIONS ---- */
  .proposal-actions-grid { padding: 12px 10px; }
  .proposal-actions-primary { flex-direction: column; gap: 6px; }
  .proposal-actions-primary .btn-primary,
  .proposal-actions-primary .btn-accent { width: 100%; }
  .proposal-actions-secondary { flex-direction: column; gap: 5px; }
  .proposal-actions-secondary .btn-secondary,
  .proposal-actions-secondary .btn-accent,
  .proposal-actions-secondary .btn-portal-back { width: 100%; text-align: center; }
  .btn-primary, .btn-secondary, .btn-accent { padding: 12px 16px; font-size: 12px; }
  .btn-lg { padding: 13px 16px; font-size: 12px; }

  /* ---- FOOTER ---- */
  .quoter-footer { flex-direction: column; gap: 4px; text-align: center; padding: 10px 12px; font-size: 10px; }

  /* ---- CHAT WIDGET ---- */
  .chat-widget { bottom: 10px; right: 10px; }
  .chat-toggle { width: 44px; height: 44px; }
  .chat-panel { width: calc(100vw - 16px); right: 0; bottom: 0; border-radius: var(--radius) var(--radius) 0 0; max-height: 70vh; }
  .chat-header { padding: 10px 12px; }
  .chat-title { font-size: 13px; }
  .chat-status { font-size: 10px; }
  .chat-logo { width: 28px; height: 28px; }
  .chat-messages { padding: 10px; }
  .chat-bubble { font-size: 12px; padding: 8px 10px; }
  .chat-input-area { padding: 8px; }
  .chat-input-area input { font-size: 13px; padding: 8px 10px; }

  /* ---- NEW CLIENT ALERT ---- */
  .proposal-alert { font-size: 12px; padding: 10px 12px; }
  .proposal-alert-icon { font-size: 14px; }
}

/* --- Small mobile / iPhone 13 and smaller (≤420px) --- */
@media (max-width: 420px) {
  /* Login tighter */
  .login-card { padding: 28px 20px 24px; }
  .login-logo { height: 24px; }
  .login-title { font-size: 16px; }

  /* Header tighter */
  .quoter-header { padding: 8px 10px; }
  .logo-main-img { height: 16px; max-width: 100px; }
  .tagline { font-size: 6px; max-width: 80px; }
  .header-badge { font-size: 6px; padding: 2px 5px; }

  /* Progress bar */
  .progress-bar { padding: 6px 10px; }
  .step-num { width: 20px; height: 20px; font-size: 9px; }
  .progress-connector { margin: 0 4px; }

  /* Cards — 2 per row instead of 3 */
  .property-cards .radio-card,
  .project-cards .radio-card {
    flex: 0 1 calc(50% - 4px); min-width: 0;
    padding: 8px 4px;
  }
  .property-cards .radio-card .card-icon,
  .project-cards .radio-card .card-icon { font-size: 18px; }
  .property-cards .radio-card span,
  .project-cards .radio-card span { font-size: 9px; }

  /* Deliverables */
  .deliverables-grid { gap: 5px; }
  .deliverable-card { padding: 8px 6px; }
  .del-icon { font-size: 16px; }
  .deliverable-card span { font-size: 10px; }

  /* Proposal */
  .proposal-total-amount { font-size: 24px; }
  .proposal-info-bar { grid-template-columns: 1fr; }
  .step { padding: 14px 10px; }

  /* Live preview */
  .live-preview { padding: 6px 10px; }
  .live-preview-price { font-size: 15px; }
  .live-preview-alerts { font-size: 9px; }

  /* History */
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 8px; }

  /* Inputs smaller */
  .form-group input, .form-group select { font-size: 13px; padding: 8px 10px; }
  .sf-input input { font-size: 13px; }

  /* Map */
  #map { height: 150px !important; }
  .map-btn { font-size: 9px; padding: 3px 6px; }

  /* Chat */
  .chat-toggle { width: 40px; height: 40px; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  body { padding: 0; background: white; }
  body::before, .bg-grid, .bg-glow { display: none; }
  .quoter-container { box-shadow: none; max-width: 100%; border: none; }
  .quoter-header, .proposal-header { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .progress-bar, .step-1, .step-2, .proposal-actions, .quoter-footer, .toast, .chat-widget, .splash { display: none !important; }
  .step-3 { display: block !important; padding: 20px; }
  .proposal-note { break-inside: avoid; }
}

/* ================================================
   LOGIN SCREEN
   ================================================ */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.login-screen.visible {
  opacity: 1;
}

.login-screen.login-exit {
  opacity: 0;
  transform: scale(0.97) translateY(-10px);
  pointer-events: none;
}

.login-card {
  width: 90%;
  max-width: 380px;
  padding: 44px 36px 32px;
  background: var(--navy-light);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 100px rgba(45, 58, 219, 0.06);
  text-align: center;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-screen.visible .login-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.login-logo {
  height: 36px;
  width: auto;
  max-width: 80%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  margin-bottom: 24px;
  opacity: 0;
  animation: loginLogoIn 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginLogoIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.login-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--gray-400);
  margin: 0 0 32px;
}

.login-field {
  margin-bottom: 18px;
  text-align: left;
}

.login-field label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.login-field input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  box-sizing: border-box;
}

.login-field input::placeholder {
  color: var(--gray-500);
}

.login-field input:focus {
  border-color: var(--blue);
  background: rgba(45, 58, 219, 0.06);
  box-shadow: 0 0 0 3px rgba(45, 58, 219, 0.15);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.pass-toggle:hover {
  color: var(--white);
}

.login-error {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  text-align: center;
}

.login-error.shake {
  animation: shakeError 0.45s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.login-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.login-btn:hover {
  background: var(--blue-light);
  box-shadow: 0 6px 24px rgba(45, 58, 219, 0.35);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: scale(0.96);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  margin-top: 28px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
}

/* Login background subtle glow */
.login-screen::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(45, 58, 219, 0.12) 0%, transparent 70%);
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ================================================
   PRICING OPTIMIZER — Interactive Price Tuning
   ================================================ */

.price-optimizer {
  background: var(--warm-white);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

/* --- Price Range Bar (visual positioning) --- */
.optimizer-visual { margin-bottom: 24px; }

.price-range-bar {
  position: relative;
  height: 32px;
  border-radius: 16px;
  overflow: visible;
  display: flex;
  margin-bottom: 8px;
  border: 1px solid var(--beige-dark);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.price-range-zone {
  height: 100%;
  transition: width 0.4s ease;
}

.zone-low {
  background: linear-gradient(90deg, #dbeafe, #93c5fd);
  border-radius: 16px 0 0 16px;
}

.zone-sweet {
  background: linear-gradient(90deg, #86efac, #22c55e);
  position: relative;
}

.zone-sweet::after {
  content: 'WIN ZONE';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}

.zone-high {
  background: linear-gradient(90deg, #fca5a5, #ef4444);
  border-radius: 0 16px 16px 0;
}

/* Price marker (current position on the bar) */
.price-marker {
  position: absolute;
  top: -8px;
  transform: translateX(-50%);
  z-index: 10;
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  cursor: grab;
}

.marker-label {
  background: var(--navy);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.price-range-bar:active { cursor: grabbing; }
.price-range-bar:active .price-marker {
  cursor: grabbing;
  transition: none;
}

.marker-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--navy);
}

.marker-line {
  width: 3px;
  height: 44px;
  background: var(--navy);
  margin: 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
}

/* Range labels */
.price-range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.range-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
}

.range-sweet-label {
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.price-range-source {
  text-align: center;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.price-range-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--gray-500);
  font-family: var(--font-display);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-low { background: #93c5fd; }
.legend-sweet { background: #22c55e; }
.legend-high { background: #ef4444; }

/* --- Adjustable Price Section --- */
.optimizer-adjust {
  background: var(--beige-light);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius);
  padding: 20px;
}

.adjust-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.adjust-gauge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--warm-white);
  transition: border-color 0.3s;
}

.adjust-gauge-value {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-display);
  line-height: 1;
  transition: color 0.3s;
}

.adjust-gauge-label {
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--gray-500);
  margin-top: 4px;
  white-space: nowrap;
}

.adjust-price-box {
  flex: 1;
}

.adjust-label {
  display: block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.adjust-input-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}

.adjust-currency {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}

.adjust-price-input {
  width: 180px;
  padding: 8px 12px;
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.adjust-price-input::-webkit-inner-spin-button,
.adjust-price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.adjust-price-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.adjust-persf {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--blue);
  font-weight: 600;
  margin-top: 4px;
}

/* --- Slider --- */
.adjust-slider-wrap {
  margin-bottom: 12px;
}

.price-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #93c5fd 0%, #22c55e 40%, #22c55e 65%, #ef4444 100%);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: grab;
  transition: transform 0.15s;
}

.price-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.price-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.price-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: grab;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px 0;
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--gray-400);
}

/* --- Feedback message --- */
.adjust-feedback {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-body);
  transition: all 0.3s;
}

.adjust-feedback.feedback-strong {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid var(--green);
  color: #15803d;
}

.adjust-feedback.feedback-fair {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--orange);
  color: #92400e;
}

.adjust-feedback.feedback-aggressive {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--red);
  color: #991b1b;
}

/* Apply Recommended button inside feedback */
.btn-apply-recommended {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 20px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-apply-recommended:hover {
  background: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 58, 219, 0.3);
}

/* Quick actions row */
.adjust-quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 0;
}

.btn-quick {
  padding: 10px 20px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.btn-quick:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.quick-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

/* --- Optimizer Insights (compact) --- */
.optimizer-insights {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insight-item {
  font-family: 'Inter', sans-serif;
  transition: background 0.2s;
}

.insight-item:hover {
  background: rgba(0,0,0,0.04) !important;
}

/* Format cards styling */
.format-cards {
  display: flex;
  gap: 12px;
}

.format-cards .radio-card {
  flex: 1;
  text-align: center;
}

.format-cards .radio-card small {
  display: block;
}

/* ================================================
   LIVE PRICE PREVIEW (floating widget)
   ================================================ */
.live-preview {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--white);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(45, 58, 219, 0.3);
  animation: livePreviewIn 0.3s ease;
}

.live-preview.hidden { display: none !important; }

@keyframes livePreviewIn {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

.live-preview-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-400);
  white-space: nowrap;
}

.live-preview-icon {
  font-size: 14px;
  animation: pulse 2s infinite;
}

.live-preview-price {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  min-width: 100px;
}

.live-preview-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-300);
  font-family: var(--font-display);
}

.live-preview-dot {
  width: 3px;
  height: 3px;
  background: var(--gray-500);
  border-radius: 50%;
}

.live-preview-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
  max-width: 120px;
}

.live-preview-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.5s ease;
  background: var(--green);
}

.live-preview-bar-fill.cr-medium { background: var(--orange); }
.live-preview-bar-fill.cr-low { background: var(--red); }

/* Deliverable counter */
.del-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  background: var(--blue-pale);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

#delCountNum {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 11px;
}

/* Button icon */
.btn-icon {
  margin-right: 4px;
  font-size: 14px;
}

/* Save feedback */
.btn-primary.saving {
  opacity: 0.7;
  pointer-events: none;
}

.btn-primary.saved {
  background: var(--green) !important;
}

/* ================================================
   UX ENHANCEMENTS — Micro-interactions & Polish
   ================================================ */

/* SF input formatted numbers — exclude .highlight (Total SF has navy bg) */
.sf-input input::placeholder { color: var(--gray-300); }
.sf-input:not(.highlight) input:not(:placeholder-shown):not(:focus) { font-weight: 600; color: var(--navy); }

/* Form field filled state */
.form-group input:not(:placeholder-shown):not([readonly]):not(:focus) {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.03);
}

/* Radio card selection ripple */
.radio-card { position: relative; overflow: hidden; }
.radio-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--blue);
  opacity: 0;
  border-radius: inherit;
  transform: scale(0.5);
  transition: opacity 0.3s, transform 0.3s;
}
.radio-card:active::after {
  opacity: 0.06;
  transform: scale(1);
}

/* Deliverable card checkmark animation */
.deliverable-card { position: relative; overflow: hidden; }
.deliverable-card::before {
  content: '\\2713';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.deliverable-card:has(input:checked)::before {
  opacity: 1;
  transform: scale(1);
}

/* Del counter pulse animation when count changes */
.del-counter.pulse-count {
  animation: counterPulse 0.3s ease;
}
@keyframes counterPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Progress connector fill animation */
.progress-connector { transition: background 0.4s ease; }
.progress-step { transition: all 0.3s ease; }
.progress-step.completed .step-num {
  animation: stepComplete 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes stepComplete {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Live preview price counter animation */
.live-preview-price {
  transition: color 0.3s;
}

/* Proposal total amount entrance animation */
.proposal-total-amount {
  animation: priceReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes priceReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Pricing cards stagger entrance */
.pricing-card {
  animation: cardStagger 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.pricing-card:nth-child(1) { animation-delay: 0.05s; }
.pricing-card:nth-child(2) { animation-delay: 0.10s; }
.pricing-card:nth-child(3) { animation-delay: 0.15s; }
.pricing-card:nth-child(4) { animation-delay: 0.20s; }
.pricing-card:nth-child(5) { animation-delay: 0.25s; }
.pricing-card:nth-child(6) { animation-delay: 0.30s; }

@keyframes cardStagger {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Insight items stagger */
.insight-item {
  animation: insightSlide 0.35s ease backwards;
}
.insight-item:nth-child(1) { animation-delay: 0.1s; }
.insight-item:nth-child(2) { animation-delay: 0.15s; }
.insight-item:nth-child(3) { animation-delay: 0.2s; }
.insight-item:nth-child(4) { animation-delay: 0.25s; }
.insight-item:nth-child(5) { animation-delay: 0.3s; }
.insight-item:nth-child(6) { animation-delay: 0.35s; }
.insight-item:nth-child(7) { animation-delay: 0.4s; }

@keyframes insightSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Proposal sections stagger */
.proposal-section {
  animation: sectionFade 0.4s ease backwards;
}
.proposal-section:nth-child(1) { animation-delay: 0.1s; }
.proposal-section:nth-child(2) { animation-delay: 0.2s; }
.proposal-section:nth-child(3) { animation-delay: 0.3s; }
.proposal-section:nth-child(4) { animation-delay: 0.4s; }

@keyframes sectionFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tooltip helper text */
.field-hint {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 4px;
  font-style: italic;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.form-group:focus-within .field-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth scrollbar */
.quoter-container {
  scroll-behavior: smooth;
}

/* Button loading spinner */
.btn-primary.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* Next button hover arrow animation */
.btn-primary span {
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn-primary:hover span {
  transform: translateX(3px);
}

/* Back button hover arrow animation */
.btn-secondary span {
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn-secondary:hover span {
  transform: translateX(-3px);
}

/* Similar projects row hover */
.similar-row {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.similar-row:hover {
  background: var(--blue-pale);
  transform: translateX(4px);
}

/* Toast entrance improvement */
.toast {
  backdrop-filter: blur(12px);
}

/* Map container loading state */
.map-container.loading #map {
  opacity: 0.5;
  pointer-events: none;
}

/* Empty state for SF inputs */
.sf-input input[type="number"]::-webkit-inner-spin-button {
  opacity: 0;
  transition: opacity 0.2s;
}
.sf-input input[type="number"]:hover::-webkit-inner-spin-button,
.sf-input input[type="number"]:focus::-webkit-inner-spin-button {
  opacity: 1;
}

/* ================================================
   LEADS PORTAL — Pipeline View (Premium)
   ================================================ */

/* --- Entrance Animations --- */
@keyframes cardFadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes portalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes heartPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ================================================
   HOME DASHBOARD — Dimensions Hub
   ================================================ */
.home-dashboard {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: var(--navy);
}

.home-bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(45,58,219,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(124,58,237,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.home-dashboard.fade-in { animation: appleSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* Home Header */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  position: relative;
  z-index: 2;
}

.home-logo {
  height: 24px;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.home-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-user {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: capitalize;
}

.home-logout-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all var(--transition);
}
.home-logout-btn:hover { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.2); }

/* Home Content */
.home-content {
  flex: 1;
  padding: 0 32px 32px;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* Welcome — Apple style: subtitle above, big greeting below */
.home-welcome {
  text-align: center;
}

.home-subtitle {
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin: 0 0 4px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
}

.home-greeting {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
  letter-spacing: -0.8px;
  line-height: 1.15;
}

/* App Cards Grid */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.home-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 24px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 120%;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  filter: blur(60px);
  transition: opacity 0.4s ease;
}

.home-card:hover::before { opacity: 0.08; }

.home-card-quote::before { background: #4f5ae8; }
.home-card-clients::before { background: #8b5cf6; }

.home-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.home-card:active {
  transform: scale(0.98);
}

/* Card top row — icon + badge */
.home-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* No hard border-top — Apple uses subtle glow instead */
.home-card-quote { }
.home-card-clients { }
/* Card Icon — Apple-style rounded square */
.home-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--white);
}

.home-card-quote .home-card-icon { background: linear-gradient(135deg, #2d3adb, #4f5ae8); }
.home-card-clients .home-card-icon { background: linear-gradient(135deg, #7c3aed, #a78bfa); }

.home-card-badge {
  min-width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.home-card-badge:empty, .home-card-badge[data-count="0"] { display: none; }

/* Card Title & Desc */
.home-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
  letter-spacing: -0.2px;
}

.home-card-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin: 2px 0 0;
  line-height: 1.4;
}

/* Card Stats — clean grid */
.home-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.home-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-stat-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.home-stat-label {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Card Action — minimal */
.home-card-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
}
.home-card:hover .home-card-action { color: rgba(255,255,255,0.7); }

/* Quick Stats — Apple-style centered pills */
.home-quick-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.home-quick-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
}

.home-quick-value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}

.home-quick-label {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Home Footer */
.home-footer {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.15);
  padding-top: 4px;
  letter-spacing: 0.5px;
}

/* ---- Home Dashboard Mobile ---- */
@media (max-width: 640px) {
  .home-header { padding: 12px 16px; }
  .home-logo { height: 20px; max-width: 120px; }
  .home-content { padding: 0 16px 20px; gap: 24px; justify-content: flex-start; padding-top: 10px; }
  .home-greeting { font-size: 24px; }
  .home-subtitle { font-size: 9px; letter-spacing: 2px; }
  .home-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-card { padding: 20px; gap: 12px; border-radius: 20px; }
  .home-card-icon { width: 40px; height: 40px; border-radius: 10px; }
  .home-card-icon svg { width: 20px; height: 20px; }
  .home-card-title { font-size: 15px; }
  .home-card-desc { font-size: 11px; }
  .home-card-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .home-stat-value { font-size: 16px; }
  .home-card-action { font-size: 10px; }
  .home-quick-stats { flex-direction: row; gap: 6px; flex-wrap: wrap; justify-content: center; }
  .home-quick-stat { padding: 8px 14px; }
  .home-quick-value { font-size: 13px; }
  .home-user { font-size: 11px; }
}

@media (max-width: 420px) {
  .home-greeting { font-size: 20px; }
  .home-card { padding: 16px; }
  .home-card-title { font-size: 15px; }
  .home-card-icon { width: 42px; height: 42px; border-radius: 12px; }
}

/* ================================================
   CLIENT INTELLIGENCE — 3-Zone Layout (Apple Design)
   ================================================ */
.ci-screen {
  width: 100%; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  position: relative; z-index: 1; overflow: hidden;
  background: var(--navy);
}
.ci-screen.fade-in { animation: appleSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* CI Header */
.ci-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 56px; min-height: 56px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative; z-index: 2; flex-shrink: 0;
}
.ci-header-left { display: flex; align-items: center; gap: 12px; }
.ci-header-right { display: flex; align-items: center; gap: 10px; }
.ci-back-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.3s ease-out;
}
.ci-back-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.ci-back-btn:active { transform: scale(0.98); }
.ci-header-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.3s ease-out;
}
.ci-header-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.ci-header-btn:active { transform: scale(0.98); }
.ci-logo { height: 18px; max-width: 100px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.65; }
.ci-header-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.07); }
.ci-title { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.85); margin: 0; letter-spacing: 0.2px; }
.ci-client-count { font-family: var(--font-display); font-size: 11px; color: rgba(255,255,255,0.3); font-weight: 400; }

/* Top Bar */
.ci-topbar {
  padding: 16px 24px; flex-shrink: 0;
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ci-topbar-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.ci-topbar-title {
  font-family: var(--font-display); font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.35);
  display: flex; gap: 8px; align-items: center;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.ci-topbar-scroll {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 4px; scrollbar-width: thin;
}
.ci-topbar-scroll::-webkit-scrollbar { height: 3px; }
.ci-topbar-scroll::-webkit-scrollbar-track { background: transparent; }
.ci-topbar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 2px; }
.ci-topbar-card {
  min-width: 180px; padding: 14px 16px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px; border-left: 3px solid rgba(255,255,255,0.07);
  cursor: pointer; scroll-snap-align: start; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); flex-shrink: 0;
}
.ci-topbar-card:hover { background: rgba(255,255,255,0.05); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.ci-topbar-card:active { transform: scale(0.98); }
.ci-topbar-card[data-rank="1"] { border-left-color: rgba(251,191,36,0.6); }
.ci-topbar-card[data-rank="2"] { border-left-color: rgba(148,163,184,0.5); }
.ci-topbar-card[data-rank="3"] { border-left-color: rgba(205,127,50,0.5); }
.ci-topbar-card-name { font-family: var(--font-display); font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); }
.ci-topbar-card-city { font-size: 10px; color: rgba(255,255,255,0.28); font-weight: 400; }
.ci-topbar-card-value { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: rgba(255,255,255,0.9); margin: 6px 0; }
.ci-topbar-card-meta { font-size: 10px; color: rgba(255,255,255,0.28); display: flex; gap: 12px; font-weight: 400; }
.ci-filter-select {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; color: rgba(255,255,255,0.8); font-size: 11px; padding: 7px 12px;
  font-family: var(--font-body); outline: none; cursor: pointer; transition: all 0.3s ease-out;
}
.ci-filter-select:hover { background: rgba(255,255,255,0.06); }
.ci-filter-select option { background: var(--navy); color: white; }

/* Body: Sidebar + Panel */
.ci-body { flex: 1; display: flex; overflow: hidden; }

/* Sidebar */
.ci-sidebar {
  width: 280px; min-width: 240px;
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex; flex-direction: column; flex-shrink: 0;
  background: rgba(255,255,255,0.015);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.ci-sidebar-header {
  padding: 20px 20px 10px; display: flex; justify-content: space-between; align-items: baseline;
}
.ci-sidebar-title { font-family: var(--font-display); font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); margin: 0; letter-spacing: 0.3px; }
.ci-sidebar-count { font-size: 11px; color: rgba(255,255,255,0.28); font-weight: 400; }
.ci-sidebar-search { padding: 0 20px 12px; }

/* Search (shared) */
.ci-search-wrap { position: relative; }
.ci-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.25); pointer-events: none; }
.ci-search-input {
  width: 100%; padding: 11px 14px 11px 38px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px; font-family: var(--font-body); font-size: 12px;
  color: rgba(255,255,255,0.9); outline: none; transition: all 0.3s ease-out;
}
.ci-search-input::placeholder { color: rgba(255,255,255,0.22); }
.ci-search-input:focus { border-color: rgba(99,102,241,0.3); background: rgba(255,255,255,0.05); box-shadow: 0 0 0 3px rgba(99,102,241,0.08); }

/* Filter Tabs */
.ci-filter-tabs { display: flex; gap: 6px; padding: 0 20px 12px; overflow-x: auto; }
.ci-filter-tab {
  padding: 7px 14px; border-radius: 10px; font-size: 11px; font-family: var(--font-body);
  background: transparent; color: rgba(255,255,255,0.35); font-weight: 400;
  border: 1px solid rgba(255,255,255,0.05); cursor: pointer;
  display: flex; align-items: center; gap: 5px; white-space: nowrap; transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ci-filter-tab:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.5); }
.ci-filter-tab.active { background: rgba(99,102,241,0.1); color: rgba(255,255,255,0.85); border-color: rgba(99,102,241,0.2); }

/* Sort */
.ci-sidebar-sort { display: flex; gap: 6px; padding: 0 20px 12px; align-items: center; }
.ci-sort-select {
  flex: 1; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; color: rgba(255,255,255,0.8); font-size: 11px; padding: 7px 12px;
  font-family: var(--font-body); outline: none; cursor: pointer; transition: all 0.3s ease-out;
}
.ci-sort-select option { background: var(--navy); color: white; }
.ci-sort-dir {
  width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.35); cursor: pointer; transition: all 0.3s ease-out; flex-shrink: 0;
}
.ci-sort-dir:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.8); }
.ci-sort-dir:active { transform: scale(0.98); }

/* Sidebar List */
.ci-sidebar-list { flex: 1; overflow-y: auto; }
.ci-sidebar-list::-webkit-scrollbar { width: 3px; }
.ci-sidebar-list::-webkit-scrollbar-track { background: transparent; }
.ci-sidebar-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 2px; }
.ci-sidebar-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ci-sidebar-item:hover { background: rgba(255,255,255,0.03); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.ci-sidebar-item:active { transform: scale(0.98); }
.ci-sidebar-item.active { background: rgba(99,102,241,0.08); border-left: 2px solid rgba(99,102,241,0.5); }
.ci-sidebar-rank {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.05); flex-shrink: 0;
}
.ci-sidebar-info { flex: 1; min-width: 0; overflow: hidden; }
.ci-sidebar-name {
  font-family: var(--font-display); font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.85);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ci-sidebar-meta { font-size: 10px; color: rgba(255,255,255,0.28); font-weight: 400; }
.ci-sidebar-loading { padding: 24px; text-align: center; }

/* Service Badges */
.ci-service-badge {
  font-size: 8px; font-weight: 500; padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ci-service-badge.siteplan { background: rgba(34,197,94,0.1); color: rgba(74,222,128,0.8); }
.ci-service-badge.as-built { background: rgba(59,130,246,0.1); color: rgba(96,165,250,0.8); }
.ci-service-badge.reality { background: rgba(139,92,246,0.1); color: rgba(167,139,250,0.8); }

/* Right Panel */
.ci-panel { flex: 1; overflow-y: auto; padding: 28px; }
.ci-panel::-webkit-scrollbar { width: 5px; }
.ci-panel::-webkit-scrollbar-track { background: transparent; }
.ci-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 3px; }
.ci-panel-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; opacity: 0.4;
}
.ci-panel-content { animation: fadeIn 0.4s ease-out; }

/* Profile Header */
.ci-profile-header {
  display: flex; align-items: center; gap: 20px;
  padding: 24px; margin-bottom: 20px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 20px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.ci-profile-avatar {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.8) 0%, rgba(139,92,246,0.7) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 20px; font-weight: 600; color: white;
  flex-shrink: 0; box-shadow: 0 8px 32px rgba(99,102,241,0.15);
}
.ci-profile-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: rgba(255,255,255,0.9); margin: 0; letter-spacing: -0.2px; }
.ci-profile-meta { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.ci-profile-type { font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1.5px; }
.ci-profile-id { font-family: monospace; font-size: 10px; color: rgba(255,255,255,0.2); }
.ci-profile-account-ids { font-size: 10px; color: rgba(255,255,255,0.25); }

/* Contact Row */
.ci-contact-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.ci-contact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: rgba(255,255,255,0.03); border-radius: 14px;
  font-size: 12px; color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.04); overflow: hidden; transition: all 0.3s ease-out;
}
.ci-contact-item:hover { background: rgba(255,255,255,0.05); }
.ci-contact-item svg { flex-shrink: 0; color: rgba(255,255,255,0.2); }
.ci-contact-item span, .ci-contact-item a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Address Row */
.ci-address-row {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 16px; background: rgba(255,255,255,0.025); border-radius: 14px;
  margin-bottom: 20px; font-size: 12px; color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.04); transition: all 0.3s ease-out;
}
.ci-address-row:hover { background: rgba(255,255,255,0.04); }
.ci-address-row svg { flex-shrink: 0; color: rgba(255,255,255,0.2); }

/* KPI Grid */
.ci-kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px;
}
.ci-kpi-7 { grid-template-columns: repeat(7, 1fr); }
.ci-kpi {
  padding: 16px 14px; text-align: center;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ci-kpi:hover { background: rgba(255,255,255,0.05); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.ci-kpi:active { transform: scale(0.98); }
.ci-kpi-primary { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.12); }
.ci-kpi-value { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: rgba(255,255,255,0.9); display: block; }
.ci-kpi-label { font-size: 9px; color: rgba(255,255,255,0.28); text-transform: uppercase; letter-spacing: 1.2px; margin-top: 4px; display: block; font-weight: 400; }

/* Sections */
.ci-section {
  margin-bottom: 20px; padding: 20px;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.ci-section-title {
  font-family: var(--font-display); font-size: 10px; font-weight: 400;
  color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 2px;
  margin: 0 0 16px; display: flex; align-items: center; gap: 8px;
}

/* Profile Text */
.ci-profile-text { font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.7; margin: 0; font-weight: 400; }

/* Deliverables */
.ci-deliverables { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-del-tag {
  font-size: 10px; font-weight: 500; padding: 6px 12px; border-radius: 8px;
  background: rgba(99,102,241,0.08); color: rgba(165,180,252,0.8);
  border: 1px solid rgba(99,102,241,0.12); transition: all 0.3s ease-out;
}
.ci-del-tag:hover { background: rgba(99,102,241,0.12); }
.ci-del-tag.active { background: rgba(34,197,94,0.08); color: rgba(74,222,128,0.7); border-color: rgba(34,197,94,0.12); }

/* Project Filters */
.ci-project-filters { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }

/* Year Groups */
.ci-year-group { margin-bottom: 10px; }
.ci-year-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer;
  font-family: var(--font-display); font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.45);
  transition: color 0.3s ease-out;
}
.ci-year-header:hover { color: rgba(255,255,255,0.7); }
.ci-year-header .chevron { transition: transform 0.3s ease-out; font-size: 10px; }
.ci-year-header.collapsed .chevron { transform: rotate(-90deg); }
.ci-year-projects { padding-left: 0; }
.ci-project-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 4px;
  background: rgba(255,255,255,0.02); font-size: 11px; color: rgba(255,255,255,0.5);
  transition: all 0.3s ease-out;
}
.ci-project-item:hover { background: rgba(255,255,255,0.04); }

/* Status Badges */
.ci-status-badge {
  font-size: 8px; font-weight: 500; padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ci-status-badge.accepted { background: rgba(34,197,94,0.08); color: rgba(74,222,128,0.7); }
.ci-status-badge.rejected { background: rgba(239,68,68,0.08); color: rgba(248,113,113,0.7); }
.ci-status-badge.pending { background: rgba(245,158,11,0.08); color: rgba(251,191,36,0.7); }

/* Actions */
.ci-actions { padding: 20px 0; }
.ci-btn-quote {
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.8) 0%, rgba(129,140,248,0.7) 100%);
  color: white; font-family: var(--font-display); font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 1.5px; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); box-shadow: 0 4px 16px rgba(99,102,241,0.15);
}
.ci-btn-quote:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.2); background: linear-gradient(135deg, rgba(99,102,241,0.9) 0%, rgba(129,140,248,0.8) 100%); }
.ci-btn-quote:active { transform: scale(0.96); box-shadow: 0 4px 16px rgba(99,102,241,0.12); }

/* CI Responsive */
@media (max-width: 900px) {
  .ci-body { flex-direction: column; }
  .ci-sidebar { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.04); max-height: 40vh; }
  .ci-topbar-scroll { gap: 10px; }
  .ci-topbar-card { min-width: 160px; padding: 12px; }
  .ci-kpi-7 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .ci-topbar { padding: 12px 16px; }
  .ci-topbar-card { min-width: 140px; padding: 10px; }
  .ci-topbar-card-value { font-size: 14px; }
  .ci-sidebar { max-height: 35vh; }
  .ci-sidebar-header { padding: 14px 14px 8px; }
  .ci-filter-tabs { padding: 0 14px 10px; }
  .ci-sidebar-sort { padding: 0 14px 10px; }
  .ci-panel { padding: 20px 16px; }
  .ci-kpi-7 { grid-template-columns: repeat(2, 1fr); }
  .ci-contact-row { flex-direction: column; gap: 8px; }
  .ci-profile-header { flex-direction: column; gap: 14px; }
  .ci-profile-name { font-size: 18px; }
}

/* --- Portal Container --- */
.leads-portal {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(45,58,219,0.06) 0%, transparent 50%),
    radial-gradient(circle at 85% 90%, rgba(124,58,237,0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 0%, rgba(59,130,246,0.04) 0%, transparent 35%),
    linear-gradient(160deg, #f5f3f0 0%, #eceae6 25%, #f0eef5 65%, #eae7f2 100%);
  padding-top: 0;
}
.leads-portal.fade-in { animation: appleSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* --- Header bar --- */
.portal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 56px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #1e2460 100%);
  z-index: 50;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(13, 17, 55, 0.35);
  margin: 12px 12px 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.portal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.portal-header-logo {
  height: 20px;
  max-width: 120px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}
.portal-header-logo:hover {
  opacity: 1;
  transform: scale(1.08);
}
.portal-header-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.12);
}
.portal-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.2px;
}
.portal-heartbeat {
  display: flex;
  align-items: center;
  color: rgba(255,255,255,0.15);
  transition: color 0.3s;
  margin-left: 4px;
}
.portal-heartbeat.active {
  color: var(--green);
  animation: heartPulse 1.5s ease infinite;
}

/* --- KPI pills (inline in header) --- */
.portal-kpis {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.portal-kpi {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(99,102,241,0.15) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  transition: all var(--transition);
}
.portal-kpi:hover { background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(99,102,241,0.2) 100%); }
.portal-kpi-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.portal-kpi-label {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* --- Header action buttons --- */
.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}
.portal-header-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.portal-header-btn:active { transform: scale(0.96); }
.portal-header-btn:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.08); }
.portal-back-btn { color: rgba(255,255,255,0.6); margin-right: 2px; }
.portal-back-btn:hover { color: #fff; background: rgba(79,90,232,0.2); }
.portal-header-btn.refreshing svg { animation: spin 0.8s linear infinite; }
.portal-header-btn-logout:hover { color: #fca5a5; background: rgba(239,68,68,0.1); }

/* --- Content Area (fills remaining viewport) --- */
.portal-content {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  position: relative;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%230d1137' stroke-opacity='0.03' stroke-width='0.5'%3E%3Cpath d='M0 30h60M30 0v60'/%3E%3C/g%3E%3Ccircle cx='30' cy='30' r='1' fill='%230d1137' fill-opacity='0.025'/%3E%3C/svg%3E");
}
.portal-content::before {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,58,219,0.07) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
  animation: portalOrb1 20s ease-in-out infinite;
  z-index: 0;
}
.portal-content::after {
  content: '';
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.05) 0%, transparent 70%);
  bottom: -80px;
  left: -80px;
  pointer-events: none;
  animation: portalOrb2 25s ease-in-out infinite;
  z-index: 0;
}
@keyframes portalOrb1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-60px, 40px); }
}
@keyframes portalOrb2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -50px); }
}
.leads-grid, .leads-loading, .leads-empty { position: relative; z-index: 1; }

/* --- Loading State --- */
.leads-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-400);
}
.leads-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255,255,255,0.06);
  border-top-color: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
.leads-loading p {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  margin: 0;
}

/* --- Empty State --- */
.leads-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-400);
}
.leads-empty svg {
  margin-bottom: 10px;
  opacity: 0.2;
}
.leads-empty p {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
  margin: 0;
}

/* Refresh button in empty state */
.btn-portal-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--beige-dark);
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-top: 10px;
  font-family: var(--font-display);
}
.btn-portal-refresh:hover { background: var(--warm-white); border-color: var(--blue); color: var(--blue); }

/* --- Leads Grid --- */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  align-content: start;
}

/* --- Lead Card --- */
.lead-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease, border-color 0.25s ease;
  opacity: 0;
  animation: cardFadeInUp 0.35s ease forwards;
  animation-delay: calc(var(--card-index, 0) * 40ms);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.05),
    0 8px 24px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.8);
}
.lead-card::after {
  content: '';
  position: absolute;
  top: 12px;
  right: -18px;
  width: 56px;
  height: 56px;
  background: url('logo-icon.png') no-repeat center/contain;
  opacity: 0.03;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lead-card:hover::after { opacity: 0.06; }
.lead-card:hover {
  transform: translateY(-1px) scale(1.015);
  border-color: rgba(79,90,232,0.3);
  box-shadow:
    0 8px 24px rgba(45,58,219,0.12),
    0 4px 12px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.9);
}
.lead-card:active {
  transform: translateY(-1px) scale(0.998);
  box-shadow: 0 4px 12px rgba(45,58,219,0.08);
}

/* Top accent bar by property type */
.lead-card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light), var(--accent));
  transition: height 0.3s;
}
.lead-card:hover::before { height: 5px; }
.lead-card.commercial::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24, #fde68a); }
.lead-card.industrial::before  { background: linear-gradient(90deg, #ec4899, #f472b6, #fbcfe8); }
.lead-card.retail::before      { background: linear-gradient(90deg, var(--green), #4ade80, #86efac); }
.lead-card.hospitality::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa, #c4b5fd); }
.lead-card.mixeduse::before    { background: linear-gradient(90deg, #06b6d4, #22d3ee, #67e8f9); }

/* --- Card Header --- */
.lead-card-header {
  padding: 12px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.lead-card-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.2px;
}
.lead-card-client {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  margin-top: 2px;
}

.lead-card-type {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  background: var(--blue-pale);
  color: var(--blue);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.lead-card-type.commercial { background: #fef3c7; color: #92400e; }
.lead-card-type.industrial { background: #fce7f3; color: #9d174d; }
.lead-card-type.retail     { background: #dcfce7; color: #065f46; }
.lead-card-type.hospitality { background: #ede9fe; color: #5b21b6; }
.lead-card-type.mixeduse   { background: #cffafe; color: #155e75; }

/* --- Contact Info Row --- */
.lead-card-contact {
  padding: 0 14px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.lead-card-contact .contact-name {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--gray-500);
}
.lead-card-contact .contact-email {
  font-size: 9px;
  color: var(--gray-400);
}
.lead-card-contact .contact-name::after {
  content: '·';
  margin-left: 4px;
  color: var(--gray-300);
}

/* --- Card Body --- */
.lead-card-body {
  padding: 4px 14px 8px;
}

/* --- Metrics Grid (inline) --- */
.lead-card-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lead-metric {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px;
  background: linear-gradient(135deg, rgba(244,241,236,0.8) 0%, rgba(45,58,219,0.04) 100%);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.04);
  transition: all var(--transition);
}
.lead-card:hover .lead-metric {
  background: linear-gradient(135deg, rgba(232,234,252,0.6) 0%, rgba(45,58,219,0.08) 100%);
  border-color: rgba(45,58,219,0.12);
  transform: translateY(-1px);
}
.lead-metric .metric-label {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-400);
}
.lead-metric .metric-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  font-family: var(--font-display);
}

/* --- SF Breakdown mini-line --- */
.lead-card-sf-breakdown {
  font-size: 9px;
  color: var(--gray-400);
  font-weight: 500;
  margin-top: 4px;
}

/* --- Deliverable Tags --- */
.lead-card-dels {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.lead-card-del {
  font-size: 8px;
  font-weight: 600;
  background: var(--blue-pale);
  color: var(--blue);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.lead-card:hover .lead-card-del { border-color: rgba(45,58,219,0.15); }
.lead-card-del:nth-child(even) {
  background: #f0edf8;
  color: #5b4fc7;
}
.lead-card-del:nth-child(3n) {
  background: #e0f2fe;
  color: #0369a1;
}
.lead-card-del.extra {
  background: var(--beige-light);
  color: var(--gray-400);
  font-weight: 700;
}

/* --- Card Footer --- */
.lead-card-footer {
  border-top: 1px solid rgba(0,0,0,0.05);
  background: linear-gradient(180deg, rgba(244,241,236,0.5) 0%, rgba(236,232,225,0.4) 100%);
}
.lead-card-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
}
.lead-card-date {
  font-size: 9px;
  color: var(--gray-300);
  font-weight: 500;
}
.lead-card-price {
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--navy);
}
.lead-card-price.pending {
  font-size: 9px;
  font-weight: 600;
  color: var(--gray-400);
  font-style: italic;
}

/* --- Card Actions --- */
.lead-card-actions {
  display: flex;
  border-top: 1px solid rgba(0,0,0,0.05);
  gap: 0;
}
.lead-card-actions button {
  flex: 1;
  padding: 10px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-display);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.btn-card-quote {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.btn-card-quote:hover {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  box-shadow: 0 4px 12px rgba(45,58,219,0.25);
}

.btn-card-send {
  background: var(--warm-white);
  color: var(--gray-500);
  border-left: 1px solid var(--beige-dark) !important;
  position: relative;
}
.btn-card-send::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--green);
  border-radius: 2px;
  transition: height 0.2s ease;
}
.btn-card-send:hover {
  background: #f0fdf4;
  color: #16a34a;
}
.btn-card-send:hover::before { height: 60%; }

/* --- Lead Modal --- */
.lead-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(13,17,55,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.lead-modal {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow:
    0 24px 80px rgba(13,17,55,0.28),
    0 0 0 1px rgba(13,17,55,0.05);
  position: relative;
  animation: appleSheet 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lead-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: var(--warm-white);
  border: 1px solid var(--beige-dark);
  font-size: 20px;
  color: var(--gray-400);
  cursor: pointer;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.lead-modal-close:hover {
  background: var(--beige-light);
  color: var(--navy);
  border-color: var(--gray-300);
}

.lead-modal-header {
  padding: 28px 28px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  background: linear-gradient(180deg, rgba(232,234,252,0.25) 0%, transparent 100%);
}
.lead-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), var(--beige-dark) 50%, transparent);
}
.lead-modal-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.2px;
}
.lead-modal-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  background: var(--blue-pale);
  color: var(--blue);
  flex-shrink: 0;
}

.lead-modal-body { padding: 24px 28px; }
.lead-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.lead-modal-field {
  padding: 12px 14px;
  background: var(--beige-light);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.lead-modal-field:hover { border-color: var(--beige-dark); }
.lead-modal-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.lead-modal-field p {
  font-size: 14px;
  color: var(--navy);
  margin: 0;
  font-weight: 600;
}
.lead-modal-field.full-width { grid-column: 1 / -1; }

.modal-del-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.modal-del-tags .del-tag {
  font-size: 11.5px;
  font-weight: 600;
  background: var(--blue-pale);
  color: var(--blue);
  padding: 4px 12px;
  border-radius: 20px;
}

.lead-modal-actions {
  display: flex;
  gap: 12px;
  padding: 20px 28px 28px;
  border-top: 1px solid var(--beige-dark);
}
.btn-quote-lead {
  flex: 1;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(45,58,219,0.2);
  letter-spacing: 0.2px;
}
.btn-quote-lead:hover {
  background: linear-gradient(135deg, var(--blue-light) 0%, #6366f1 100%);
  box-shadow: 0 6px 20px rgba(45,58,219,0.3);
  transform: translateY(-1px);
}
.btn-send-proposal {
  flex: 1;
  padding: 13px 20px;
  background: var(--warm-white);
  color: var(--navy);
  border: 1.5px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}
.btn-send-proposal:hover {
  border-color: var(--green);
  color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(34,197,94,0.12);
}

/* --- Confirm Send Dialog --- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(13,17,55,0.70);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.confirm-dialog {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.3),
    0 0 0 1px rgba(13,17,55,0.05);
  animation: appleSheet 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.confirm-icon { margin-bottom: 18px; }
.confirm-dialog h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
  letter-spacing: -0.2px;
}
.confirm-dialog p {
  font-size: 14px;
  color: var(--gray-500);
  margin: 0 0 28px;
  line-height: 1.55;
}
.confirm-actions { display: flex; gap: 10px; }
.btn-confirm-cancel {
  flex: 1;
  padding: 12px;
  background: var(--warm-white);
  color: var(--gray-700);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.btn-confirm-cancel:hover { background: var(--beige-light); }
.btn-confirm-send {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, var(--green) 0%, #16a34a 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(34,197,94,0.25);
}
.btn-confirm-send:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 4px 16px rgba(34,197,94,0.35);
}

/* --- Back to Portal button (in cotizador) --- */
.btn-portal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-display);
  box-shadow: 0 2px 6px rgba(13,17,55,0.15);
}
.btn-portal-back:hover {
  background: var(--blue);
  box-shadow: 0 4px 12px rgba(45,58,219,0.2);
  transform: translateY(-1px);
}

/* --- Add-on button (in scope table) --- */
.btn-add-addon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  background: linear-gradient(135deg, var(--blue-pale) 0%, #dfe3fb 100%);
  color: var(--blue);
  border: 1.5px solid rgba(45,58,219,0.15);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-add-addon:hover {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: 0 3px 10px rgba(45,58,219,0.2);
  transform: translateY(-1px);
}
.addon-row td {
  font-style: italic;
  border-top: 1px dashed var(--beige-dark);
}

/* Special add-ons (tangible items like Point Cloud) */
.special-addon-row td { font-style: normal; }
.special-addon-btn {
  background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%) !important;
  border-color: rgba(124,58,237,0.25) !important;
  color: #7c3aed !important;
}
.special-addon-btn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%) !important;
  color: #fff !important;
  border-color: #7c3aed !important;
}
.special-addon-btn.active {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%) !important;
  color: #fff !important;
  border-color: #7c3aed !important;
  box-shadow: 0 3px 10px rgba(124,58,237,0.25);
}
.special-addon-active td { background: rgba(124,58,237,0.04); }

/* --- Add-on search bar in proposal --- */
.addon-search-wrap {
  position: relative;
}
.addon-search-input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1.5px dashed var(--beige-dark);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-body);
  background: var(--warm-white);
  color: var(--dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.addon-search-input:focus {
  outline: none;
  border-color: var(--blue);
  border-style: solid;
  box-shadow: 0 0 0 3px var(--blue-glow);
  background: var(--white);
}
.addon-search-input::placeholder {
  color: var(--gray-400);
  font-style: italic;
}
.addon-search-results {
  display: none;
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  background: var(--white);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  max-height: 220px;
  overflow-y: auto;
}
.addon-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  gap: 8px;
}
.addon-search-item:hover {
  background: var(--blue-pale);
}
.addon-search-item + .addon-search-item {
  border-top: 1px solid var(--gray-100);
}
.addon-search-item-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.addon-search-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}
.addon-search-item-hrs {
  font-size: 10px;
  color: var(--gray-400);
  white-space: nowrap;
}
.addon-search-empty {
  padding: 12px;
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  font-style: italic;
}
.addon-search-item .btn-add-addon {
  font-size: 11px;
  padding: 4px 12px;
  flex-shrink: 0;
}

/* --- Travel fee row in scope table --- */
.travel-fee-row td {
  background: rgba(245,158,11,0.06);
  border-top: 1px solid rgba(245,158,11,0.15);
}

/* --- Travel fee config input --- */
.travel-fee-config {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--warm-white);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.travel-fee-config label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
}
.travel-fee-config input {
  width: 90px;
  padding: 6px 10px;
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  font-family: var(--font-body);
}
.travel-fee-config .travel-zone-label {
  font-size: 11px;
  color: var(--gray-400);
  margin-left: auto;
}

/* --- Responsive (Portal) --- */
@media (max-width: 1024px) {
  .leads-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
  .portal-kpi { padding: 4px 10px; }
}
@media (max-width: 768px) {
  .portal-header { padding: 0 16px; height: 48px; min-height: 48px; gap: 10px; margin: 8px 8px 0; border-radius: 14px; }
  .portal-header-logo { height: 16px; }
  .portal-title { font-size: 13px; }
  .portal-kpis { gap: 3px; }
  .portal-kpi { padding: 3px 8px; }
  .portal-kpi-value { font-size: 12px; }
  .portal-kpi-label { font-size: 7px; }
  .portal-content { padding: 14px 16px; }
  .leads-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lead-modal-grid { grid-template-columns: 1fr; }
  .lead-modal-actions { flex-direction: column; }
  .lead-modal-header { padding: 18px 16px 14px; }
  .lead-modal-body { padding: 16px; }
  .lead-modal-actions { padding: 12px 16px 18px; }
}
@media (max-width: 480px) {
  /* Portal header */
  .portal-header { padding: 0 10px; height: 42px; min-height: 42px; gap: 4px; margin: 6px 6px 0; border-radius: 12px; }
  .portal-header-logo { height: 14px; max-width: 90px; object-fit: contain; }
  .portal-header-left { gap: 4px; overflow: hidden; }
  .portal-title { font-size: 11px; white-space: nowrap; }
  .portal-kpis { gap: 2px; overflow: hidden; }
  .portal-kpi { padding: 2px 4px; }
  .portal-kpi-value { font-size: 10px; }
  .portal-kpi-label { display: none; }
  .portal-header-sep { display: none; }
  .portal-header-actions { gap: 2px; }
  .portal-header-btn { padding: 4px 6px; }
  .portal-header-btn svg { width: 12px; height: 12px; }

  /* Portal content */
  .portal-content { padding: 8px; }
  .leads-grid { grid-template-columns: 1fr; gap: 8px; }

  /* Lead cards */
  .lead-card { border-radius: 8px; }
  .lead-card-header { padding: 10px 12px 8px; }
  .lead-card-name { font-size: 14px; font-weight: 700; }
  .lead-card-client { font-size: 11px; }
  .lead-card-type { font-size: 8px; padding: 2px 6px; }
  .lead-card-contact { font-size: 10px; padding: 2px 12px 6px; color: var(--gray-400); }
  .lead-card-body { padding: 0 12px 8px; }
  .lead-card-metrics { grid-template-columns: 1fr 1fr; gap: 4px; }
  .lead-metric { padding: 4px 6px; }
  .metric-label { font-size: 8px; }
  .metric-value { font-size: 12px; }
  .lead-card-sf-breakdown { font-size: 10px; padding: 4px 0; }
  .lead-card-dels { padding: 4px 0; gap: 3px; }
  .lead-card-del { font-size: 9px; padding: 2px 5px; }
  .lead-card-footer { padding: 6px 12px; }
  .lead-card-date { font-size: 10px; }
  .lead-card-price { font-size: 12px; }
  .lead-card-actions { flex-direction: row; }
  .lead-card-actions button { font-size: 11px; padding: 8px; }

  /* Lead modal */
  .lead-modal-overlay { padding: 6px; align-items: flex-end; }
  .lead-modal { max-height: 92vh; border-radius: 12px 12px 0 0; }
  .lead-modal-header { padding: 14px 14px 10px; }
  .lead-modal-header h2 { font-size: 15px; }
  .lead-modal-badge { font-size: 10px; }
  .lead-modal-body { padding: 12px 14px; }
  .lead-modal-grid { grid-template-columns: 1fr; gap: 10px; }
  .lead-modal-field label { font-size: 9px; }
  .lead-modal-field p { font-size: 13px; }
  .modal-del-tags { gap: 3px; }
  .modal-del-tags .del-tag { font-size: 10px; }
  .lead-modal-actions { padding: 12px 14px 16px; flex-direction: column; gap: 6px; }
  .btn-quote-lead, .btn-send-proposal { width: 100%; font-size: 12px; padding: 12px; }

  /* Confirm dialog */
  .confirm-dialog { margin: 16px; padding: 20px 16px; }
  .confirm-dialog h3 { font-size: 15px; }
  .confirm-dialog p { font-size: 12px; }
  .confirm-actions { flex-direction: column; gap: 6px; }
  .confirm-actions button { width: 100%; }
}

/* ================================================
   APPLE-STYLE GLOBAL ENHANCEMENTS
   ================================================ */

/* Global custom scrollbar — thin Apple style */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Smooth scroll for scrollable panels */
.ci-sidebar-list, .ci-panel, .portal-content, .ci-topbar-scroll {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Apple-style input focus ring (global fallback) */
input:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45,58,219,0.15);
  border-color: rgba(45,58,219,0.4);
  transition: all 0.2s ease;
}

/* Desktop: remove body padding so screens fill viewport fully */
@media (min-width: 1024px) {
  body {
    padding: 0;
  }
  .home-dashboard, .ci-screen, .leads-portal, .login-screen {
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .quoter-container {
    min-height: 100vh;
    min-height: 100dvh;
  }
}
