/* ==========================================================================
   CERO IMPACTO - SOLARPRO DESIGN SYSTEM
   Modern, Ultra-responsive, Glassmorphic & Solar-themed Aesthetic
   ========================================================================== */

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

:root {
  --bg-primary: #090D16;
  --bg-secondary: #0F172A;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(245, 158, 11, 0.35);

  /* Brand Accents */
  --solar-amber: #F59E0B;
  --solar-amber-light: #FDE68A;
  --solar-gradient: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  --eco-emerald: #10B981;
  --eco-emerald-glow: rgba(16, 185, 129, 0.25);
  --eco-gradient: linear-gradient(135deg, #10B981 0%, #047857 100%);
  --sky-blue: #0284C7;
  --sky-gradient: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);

  /* Text Colors */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.05);
  --glow-solar: 0 0 25px rgba(245, 158, 11, 0.2);
  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

/* ==========================================================================
   NAVIGATION & HEADER
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo-img {
  height: 42px;
  max-width: 175px;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transition: var(--transition);
}

.brand-logo-img:hover {
  transform: scale(1.02);
}

.brand-badge {
  font-size: 0.65rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.3rem;
  gap: 0.25rem;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: var(--solar-gradient);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.header-status-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.firebase-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.75rem;
  color: var(--solar-amber-light);
  font-weight: 600;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ==========================================================================
   APP CONTAINER & VIEWS
   ========================================================================== */
.main-wrapper {
  max-width: 1560px;
  margin: 1.5rem auto;
  padding: 0 1.25rem 5rem 1.25rem;
}

.view-section {
  display: none;
  animation: fadeIn 0.35s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   CALCULATOR VIEW LAYOUT (2 STEPS: ONBOARDING & RESULTS)
   ========================================================================== */
.calc-step-wrapper {
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-intro-banner {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 2rem auto;
}

.step-intro-banner h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 0.5rem 0;
  background: linear-gradient(135deg, #FFFFFF 30%, #FBBF24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.step-intro-banner p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.calc-onboarding-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 920px;
  margin: 0 auto;
}

.step-number-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--solar-gradient);
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.generate-cta-container {
  text-align: center;
  margin: 2.5rem auto 1rem auto;
  max-width: 720px;
}

.btn-generate-hero {
  width: 100%;
  padding: 1.15rem 2rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  background: var(--solar-gradient);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.4), 0 0 20px rgba(245, 158, 11, 0.2);
  cursor: pointer;
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: var(--transition);
}

.btn-generate-hero:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.55), 0 0 30px rgba(245, 158, 11, 0.35);
}

.generate-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

/* Collapsible Advanced Accordion */
.advanced-settings-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.accordion-toggle-btn {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.accordion-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.accordion-icon {
  transition: transform 0.25s ease;
}

.accordion-icon.open {
  transform: rotate(180deg);
}

/* Results Toolbar */
.results-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.assistant-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-tour-trigger {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFFFFF;
  border: none;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
  transition: var(--transition);
}

.btn-tour-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.btn-inspect-trigger {
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  color: #FFFFFF;
  border: none;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}

.btn-inspect-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-inspect-trigger.active {
  background: #F59E0B;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

/* Inspect Mode Banner */
.inspect-mode-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid var(--solar-amber);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.15rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
  animation: slideDown 0.3s ease-out;
}

.inspect-banner-text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.inspect-banner-text i {
  color: var(--solar-amber);
  font-size: 1.1rem;
}

.btn-close-inspect {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-close-inspect:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #EF4444;
}

/* Inspectable Item Hover & Active Effects */
.inspectable-item {
  position: relative;
  transition: var(--transition);
}

.inspect-tag {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--solar-amber);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.inspect-mode-active .inspectable-item {
  cursor: pointer !important;
  outline: 2px dashed rgba(245, 158, 11, 0.4);
  outline-offset: 4px;
}

body.inspect-mode-active .inspectable-item:hover {
  outline: 2px solid var(--solar-amber) !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35) !important;
  transform: translateY(-2px);
}

body.inspect-mode-active .inspectable-item:hover .inspect-tag {
  display: block;
}

.calc-results-layout {
  max-width: 1300px;
  margin: 0 auto;
}

/* Card Styling */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title-box h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
}

.card-title-box .title-icon {
  color: var(--solar-amber);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.925rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--solar-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

/* Custom Segmented Buttons / Toggles */
.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.toggle-btn.active {
  background: var(--solar-gradient);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   INTERACTIVE MAP & SATELLITE RADAR WIDGET
   ========================================================================== */
.map-container-box {
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
  background: #000;
}

.map-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.95);
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.map-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.map-search-input {
  width: 100%;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem 0.4rem 2rem;
  font-size: 0.8rem;
  color: #fff;
}

.map-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.map-actions {
  display: flex;
  gap: 0.35rem;
}

.map-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.map-tool-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--solar-amber);
}

.map-tool-btn.active {
  background: var(--solar-gradient);
  color: #fff;
  border-color: transparent;
}

#solarMap {
  width: 100%;
  height: 280px;
  z-index: 10;
}

/* Solar Radar Overlay Card */
.solar-climate-radar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid var(--border-color);
}

@media (max-width: 640px) {
  .solar-climate-radar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.radar-stat-item {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
}

.radar-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.radar-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--solar-amber-light);
}

.radar-source-tag {
  grid-column: 1 / -1;
  font-size: 0.68rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

/* Roof Type Grid */
.roof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.5rem;
}

@media (max-width: 500px) {
  .roof-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.roof-option-card {
  border: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.roof-option-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(30, 41, 59, 0.6);
}

.roof-option-card.selected {
  border-color: var(--solar-amber);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.roof-option-card .roof-icon {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  display: block;
  color: var(--solar-amber);
}

.roof-option-card .roof-name {
  font-size: 0.75rem;
  font-weight: 600;
  display: block;
  line-height: 1.2;
}

.roof-option-card .roof-loss {
  font-size: 0.65rem;
  color: #EF4444;
  margin-top: 0.25rem;
  display: block;
}

/* ==========================================================================
   CALCULATOR KPIS & RESULTS (RIGHT COLUMN)
   ========================================================================== */
.kpi-main-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.kpi-main-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.banner-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--solar-amber-light);
  font-weight: 700;
}

.banner-price-box {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.banner-price {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.banner-price-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.kpi-grid-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
  .kpi-grid-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.65rem;
  text-align: center;
}

.kpi-box-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-box-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.2rem;
}

.kpi-box-val.highlight {
  color: var(--solar-amber);
}

.kpi-box-val.eco {
  color: #34D399;
}

/* Secondary KPI strip */
.kpi-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 680px) {
  .kpi-details-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.kpi-mini-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.kpi-mini-icon.gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--solar-amber);
}

.kpi-mini-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
}

.kpi-mini-icon.blue {
  background: rgba(2, 132, 199, 0.15);
  color: #38BDF8;
}

.kpi-mini-text h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.kpi-mini-text p {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Charts Grid */
.charts-container-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 800px) {
  .charts-container-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.chart-card-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-canvas-box {
  position: relative;
  height: 200px;
  width: 100%;
}

/* ==========================================================================
   CERO IMPACTO ENVIRONMENTAL BADGE
   ========================================================================== */
.eco-impact-banner {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.4) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.eco-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.eco-leaf-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--eco-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: var(--glow-emerald);
}

.eco-stats-row {
  display: flex;
  gap: 1.5rem;
}

.eco-stat-unit {
  text-align: center;
}

.eco-stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #34D399;
}

.eco-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ACTION BUTTONS & TOOLBARS
   ========================================================================== */
.action-buttons-bar {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--solar-gradient);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background: #1EBE5D;
  transform: translateY(-2px);
}

.btn-pdf {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
}

.btn-pdf:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   QUOTATIONS TABLE VIEW
   ========================================================================== */
.table-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.quotes-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.quotes-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.quotes-table th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.quotes-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.quotes-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.Borrador {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
}

.status-badge.Enviada {
  background: rgba(2, 132, 199, 0.2);
  color: #38BDF8;
}

.status-badge.Aceptada {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.status-badge.Rechazada {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

/* ==========================================================================
   QUOTATION ACTION BUTTONS (PDF, EDIT, LOAD, DELETE)
   ========================================================================== */
.btn-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-action:hover {
  transform: translateY(-2px) scale(1.08);
}

.btn-action.view-quote {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #10B981;
}

.btn-action.view-quote:hover {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.45);
  color: #34D399;
}

.quote-id-click {
  cursor: pointer;
  transition: all 0.2s ease;
}

.quote-id-click:hover {
  color: #FBBF24 !important;
  text-decoration: underline;
}

.btn-action.print-quote {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

.btn-action.print-quote:hover {
  background: rgba(239, 68, 68, 0.28);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

.btn-action.edit-quote {
  background: rgba(2, 132, 199, 0.15);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0284C7;
}

.btn-action.edit-quote:hover {
  background: rgba(2, 132, 199, 0.28);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

.btn-action.load-quote {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--solar-amber);
}

.btn-action.load-quote:hover {
  background: rgba(245, 158, 11, 0.28);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.btn-action.delete-quote {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.3);
  color: var(--text-muted);
}

.btn-action.delete-quote:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

/* Edit Quote Modal Dialog */
.edit-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .edit-modal-grid {
    grid-template-columns: 1fr;
  }
}

.edit-section-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
}

/* ==========================================================================
   PROPOSAL MODAL / PRINTABLE PDF VIEW
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #0F172A;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Printable Sheet */
.printable-quote-sheet {
  background: #FFFFFF;
  color: #1E293B;
  border-radius: var(--radius-sm);
  padding: 2.5rem;
  margin-top: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.printable-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   ROOF MEASUREMENT ON-MAP FLOATING BAR & VERTEX HANDLES
   ========================================================================== */
.roof-draw-guide-bar {
  position: absolute;
  top: 48px;
  left: 10px;
  right: 10px;
  z-index: 500;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--solar-amber);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.25);
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.guide-info {
  font-size: 0.8rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.guide-info i {
  color: var(--solar-amber);
}

.guide-stats {
  display: flex;
  gap: 0.5rem;
}

.guide-stat-badge {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.guide-stat-badge strong {
  color: var(--solar-amber-light);
}

.guide-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-guide-confirm {
  background: var(--solar-gradient);
  border: none;
  color: #fff;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.btn-guide-cancel {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.roof-vertex-circle {
  background: #F59E0B;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.9);
  cursor: grab;
}

.roof-vertex-circle:active {
  cursor: grabbing;
}

/* ==========================================================================
   PRINTABLE PROPOSAL STYLES
   ========================================================================== */
.print-brand-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.print-logo-img {
  height: 52px;
  max-width: 200px;
  object-fit: contain;
  margin-bottom: 0.3rem;
}

.print-brand-subtitle {
  font-size: 0.85rem;
  color: #334155;
  font-weight: 600;
}

.print-brand-legal {
  font-size: 0.72rem;
  color: #64748B;
}

.print-client-summary-box {
  background: #F8FAFC;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #E2E8F0;
}

.print-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: #1E293B;
}

.p-label {
  color: #64748B;
  font-size: 0.75rem;
  display: block;
}

.print-quote-id {
  color: #0F172A;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.print-quote-info {
  text-align: right;
  font-size: 0.85rem;
  color: #64748B;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.print-table th {
  background: #F1F5F9;
  color: #0F172A;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid #CBD5E1;
}

.print-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #E2E8F0;
  color: #1E293B;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1E293B;
  border: 1px solid var(--border-color);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.3s ease-out;
}

.toast.success {
  border-color: #10B981;
}

/* ==========================================================================
   MODAL DE INCENTIVO DE COMPRA Y CONVERSIÓN SOLAR VIP
   ========================================================================== */
.purchase-incentive-dialog {
  max-width: 680px;
  width: 95%;
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 0.2);
  border-radius: 18px;
  overflow: hidden;
  animation: modalPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-buy-incentive-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6) !important;
  filter: brightness(1.08);
}

/* ==========================================================================
   ANIMATED LOGO ASSISTANT & GUIDED TOUR STYLES
   ========================================================================== */
.welcome-tour-dialog {
  max-width: 520px;
  text-align: center;
  background: #0F172A;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(245, 158, 11, 0.25);
  padding: 2.2rem 2rem;
}

.welcome-avatar-wrap {
  position: relative;
  width: 95px;
  height: 95px;
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animated-globe-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.5));
}

.animated-globe-logo.spin-pulse {
  animation: spinGlobe3D 6s infinite linear;
}

.assistant-halo-pulse,
.assistant-solar-corona {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.6) 0%, rgba(16, 185, 129, 0.3) 70%, transparent 100%);
  animation: pulseCorona 3s infinite ease-in-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes spinGlobe3D {
  0% {
    transform: perspective(400px) rotateY(0deg) scale(1);
  }

  50% {
    transform: perspective(400px) rotateY(180deg) scale(1.08);
  }

  100% {
    transform: perspective(400px) rotateY(360deg) scale(1);
  }
}

@keyframes pulseCorona {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.5;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), 0 0 35px rgba(16, 185, 129, 0.3);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.95;
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), 0 0 60px rgba(16, 185, 129, 0.6);
  }
}

.welcome-tour-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.welcome-tour-box h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.welcome-tour-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.welcome-tour-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* SPOTLIGHT TOUR OVERLAY */
.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 1800;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.tour-spotlight-active {
  position: relative !important;
  z-index: 1850 !important;
  box-shadow: 0 0 0 3px #F59E0B, 0 0 35px rgba(245, 158, 11, 0.8) !important;
  border-color: #F59E0B !important;
}

.tour-popover {
  position: fixed;
  z-index: 2000;
  background: #0F172A;
  border: 2px solid var(--solar-amber);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(245, 158, 11, 0.35);
  max-width: 440px;
  width: 90%;
  padding: 1.25rem;
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tour-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tour-step-counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--solar-amber);
  background: rgba(245, 158, 11, 0.15);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.tour-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.tour-close-btn:hover {
  color: #fff;
}

.tour-assistant-mini {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.tour-avatar-mini {
  width: 32px;
  height: 32px;
  object-fit: contain;
  animation: spinGlobe3D 7s infinite linear;
}

.tour-assistant-mini h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.tour-voice-tag {
  font-size: 0.68rem;
  color: #34D399;
  display: block;
}

.tour-popover-body p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.tour-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* CONCEPT EXPLANATION DIALOG */
.explain-concept-dialog {
  max-width: 580px;
  background: #0F172A;
  border: 1px solid var(--solar-amber);
  box-shadow: var(--shadow-lg), 0 0 35px rgba(245, 158, 11, 0.3);
  padding: 2rem;
}

.explain-assistant-wrap {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

@media (max-width: 580px) {
  .explain-assistant-wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.animated-logo-assistant-box {
  position: relative;
  width: 85px;
  height: 85px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.assistant-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--solar-amber);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.explain-assistant-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.explain-modal-body {
  color: #CBD5E1;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.explain-modal-body strong {
  color: var(--solar-amber-light);
}

.explain-modal-body ul {
  margin: 0.5rem 0 0.5rem 1.2rem;
}

.explain-modal-body li {
  margin-bottom: 0.35rem;
}

.explain-modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   CUSTOMER ONBOARDING STEP 1 & INTERACTIVE ASSISTANT
   ========================================================================== */
.calc-step-wrapper {
  animation: fadeIn 0.35s ease-in-out;
}

.step-intro-banner {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 2rem auto;
  padding: 1.5rem 1rem 0.5rem 1rem;
}

.step-intro-banner h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.75rem 0 0.5rem 0;
  line-height: 1.25;
}

.step-intro-banner p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.calc-onboarding-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.step-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--solar-gradient);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 800;
  margin-right: 0.5rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.accordion-toggle-btn {
  width: 100%;
  background: rgba(30, 41, 59, 0.6);
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.accordion-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-primary);
  border-color: var(--solar-amber);
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-icon.open {
  transform: rotate(180deg);
}

.generate-cta-container {
  text-align: center;
  max-width: 700px;
  margin: 2.5rem auto 3rem auto;
}

.btn-generate-hero {
  font-size: 1.15rem;
  padding: 1.15rem 2.8rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--solar-gradient);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4), 0 0 20px rgba(245, 158, 11, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-generate-hero:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 40px rgba(245, 158, 11, 0.6), 0 0 30px rgba(245, 158, 11, 0.4);
}

.generate-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* TOP TOOLBAR IN RESULTS VIEW */
.results-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.assistant-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-tour-trigger {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-tour-trigger:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #FFFFFF;
  border-color: #10B981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-inspect-trigger {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--solar-amber);
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-inspect-trigger:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #FFFFFF;
  border-color: var(--solar-amber);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* INSPECT MODE ACTIVE BANNER */
.inspect-mode-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  border: 1px solid var(--solar-amber);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.inspect-banner-text {
  font-size: 0.88rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.inspect-banner-text i {
  color: var(--solar-amber);
  font-size: 1.1rem;
}

.btn-close-inspect {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-close-inspect:hover {
  background: #EF4444;
  border-color: #EF4444;
}

/* INSPECTABLE ITEMS IN RESULTS */
.inspectable-item {
  position: relative;
  transition: all 0.25s ease;
}

.inspect-tag {
  display: none;
}

body.inspect-mode-active .inspectable-item {
  cursor: pointer !important;
  outline: 2px dashed rgba(245, 158, 11, 0.6);
  outline-offset: 4px;
}

body.inspect-mode-active .inspectable-item:hover {
  outline: 2px solid var(--solar-amber);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
}

body.inspect-mode-active .inspectable-item .inspect-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--solar-amber);
  color: #0F172A;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   THEME TOGGLE (LIGHT / DARK MODE)
   ========================================================================== */
.btn-theme-toggle {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FBBF24;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-theme-toggle:hover {
  transform: scale(1.08);
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.55);
  color: #F59E0B;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.btn-theme-toggle i {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.btn-theme-toggle:active i {
  transform: scale(0.85);
}

/* ==========================================================================
   DISCREET ADMIN ACCESS & AUTHENTICATION STYLES
   ========================================================================== */
.btn-discreet-admin {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-discreet-admin:hover {
  color: var(--solar-amber);
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
  transform: scale(1.05);
}

.admin-logged-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.btn-logout-mini {
  background: transparent;
  border: none;
  color: #F87171;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.btn-logout-mini:hover {
  transform: scale(1.15);
  color: #EF4444;
}

.admin-login-dialog {
  max-width: 420px;
  background: #0F172A;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.2rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
}

.admin-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--solar-amber);
  color: var(--solar-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 0.85rem auto;
}

.admin-login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.admin-login-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.admin-login-header p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.admin-login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.admin-login-footer {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* FORMATTED MONEY INPUTS */
.money-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 600;
}

/* ==========================================================================
   PRINT MEDIA QUERY - ROBUST, NO BLANK PAGES, LETTER SIZE WITH LOGO
   ========================================================================== */
@media print {

  /* Reset document flow */
  html,
  body {
    background: #FFFFFF !important;
    color: #0F172A !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    font-size: 9.5pt !important;
  }

  /* Completely hide everything that is not the proposal sheet */
  .app-header,
  .main-wrapper,
  .toast-container,
  .modal-close-btn,
  .modal-dialog>div:first-child,
  .btn,
  .map-actions,
  .nav-tabs,
  .header-status-box {
    display: none !important;
  }

  /* Unset modal overlay constraints */
  .modal-overlay {
    position: static !important;
    display: block !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .modal-dialog {
    position: static !important;
    display: block !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .printable-quote-sheet {
    position: static !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  .printable-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    border-bottom: 2px solid #0F172A !important;
    padding-bottom: 0.6rem !important;
    margin-bottom: 0.75rem !important;
  }

  .print-logo-img {
    height: 48px !important;
    max-width: 190px !important;
    display: block !important;
  }

  .print-table {
    margin: 0.6rem 0 !important;
    font-size: 8.5pt !important;
  }

  .print-table th {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    padding: 0.35rem 0.5rem !important;
    border-bottom: 1px solid #94A3B8 !important;
  }

  .print-table td {
    padding: 0.35rem 0.5rem !important;
    border-bottom: 1px solid #E2E8F0 !important;
    color: #1E293B !important;
  }

  /* Prevent awkward page breaks */
  .printable-header,
  .print-client-summary-box,
  .print-table,
  .print-table tr,
  .printable-quote-sheet>div {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  @page {
    size: letter portrait;
    margin: 1cm 1.2cm;
  }
}

/* ==========================================================================
   FICHA TÉCNICA DEL PROYECTO & UBICACIÓN SATELITAL EN DETALLES
   ========================================================================== */
.project-details-card {
  position: relative;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.project-details-card:hover {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.6), var(--glow-solar);
}

.project-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.details-pre-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #34D399;
  margin-bottom: 0.35rem;
}

.details-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.3;
}

.details-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  max-width: 780px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-client-type {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-status {
  background: rgba(245, 158, 11, 0.15);
  color: var(--solar-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-climate {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.project-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.details-info-box {
  background: rgba(9, 13, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.details-info-box:hover {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(245, 158, 11, 0.25);
}

.box-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--solar-amber);
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.box-head h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.details-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.details-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  gap: 0.75rem;
}

.details-item .d-label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.details-item .d-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.details-item .highlight-cost {
  color: #10B981;
  font-weight: 700;
}

.details-item .highlight-amber {
  color: var(--solar-amber);
  font-weight: 700;
}

.phone-link {
  color: #25D366;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.phone-link:hover {
  color: #4ade80;
  text-decoration: underline;
}

.d-value-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--solar-amber-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: inline-block;
  text-align: right;
}

.d-value-pill.pill-ongrid {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.25);
}

.d-value-pill.pill-hybrid {
  background: rgba(245, 158, 11, 0.15);
  color: var(--solar-amber);
  border-color: rgba(245, 158, 11, 0.35);
}

.coords-tag {
  font-family: monospace;
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.1);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.maps-link-row {
  margin-top: 0.35rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.btn-maps-satellite {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  width: 100%;
  justify-content: center;
}

.btn-maps-satellite:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
  border-color: #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* DETALLES: MAPA SATELITAL DE LA INSTALACIÓN */
.details-satellite-section {
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.75rem;
}

.details-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.map-title-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.map-badges-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.details-map-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: var(--solar-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.details-map-badge.gps-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.3);
}

.details-map-frame {
  height: 290px;
  width: 100%;
  position: relative;
  background: #000;
}

#detailsSolarMap {
  width: 100%;
  height: 100%;
  z-index: 10;
}

.roof-details-tooltip {
  background: rgba(33, 65, 66, 0.95) !important;
  color: #F8FAFC !important;
  border: 1px solid var(--solar-amber) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN FOR MOBILE & TABLETS
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 0.45rem 0.75rem;
  }

  .header-container {
    gap: 0.4rem;
  }

  .brand-logo-img {
    height: 30px;
    max-width: 110px;
  }

  .brand-badge {
    display: none;
  }

  .nav-tabs {
    padding: 0.2rem;
    gap: 0.2rem;
    max-width: 52vw;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .header-status-box {
    gap: 0.35rem;
  }

  .firebase-badge {
    padding: 0.35rem 0.55rem;
  }

  .firebase-badge #firebaseStatusText {
    display: none;
  }

  .btn-discreet-admin {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .admin-logged-pill {
    padding: 2px 7px;
    font-size: 0.7rem;
  }

  .project-details-grid {
    grid-template-columns: 1fr;
  }

  .details-map-frame {
    height: 220px;
  }

  .details-title {
    font-size: 1.15rem;
  }
}

@media (max-width: 600px) {
  .main-wrapper {
    margin: 0.4rem auto;
    padding: 0 0.5rem 3.5rem 0.5rem;
  }

  .step-intro-banner {
    margin: 0 auto 1.15rem auto;
  }

  .step-intro-banner h2 {
    font-size: 1.3rem;
    line-height: 1.25;
    margin: 0.35rem 0;
  }

  .step-intro-banner p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .calc-onboarding-grid {
    gap: 0.85rem;
  }

  .glass-card {
    padding: 1rem 0.75rem;
    border-radius: var(--radius-md);
  }

  .card-title-box {
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .card-title-box h3 {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .step-number-badge {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  /* Force single-column form rows on mobile */
  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
  }

  .form-group {
    margin-bottom: 0.65rem;
  }

  .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
  }

  .form-control {
    font-size: 0.875rem;
    padding: 0.55rem 0.75rem;
  }

  /* Segmented buttons / toggles */
  .toggle-group {
    padding: 0.2rem;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
  }

  .toggle-btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.25rem;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  /* Roof type grid */
  .roof-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem;
  }

  .roof-option-card {
    padding: 0.6rem 0.35rem;
  }

  .roof-option-card .roof-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }

  .roof-option-card .roof-name {
    font-size: 0.72rem;
  }

  .roof-option-card .roof-loss {
    font-size: 0.62rem;
  }

  /* Satellite Map & Toolbar on Mobile */
  .map-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.5rem;
  }

  .map-search-wrapper {
    width: 100%;
    min-width: 0;
  }

  .map-search-input {
    font-size: 0.75rem;
    padding: 0.45rem 0.65rem 0.45rem 1.85rem;
  }

  .map-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    width: 100%;
  }

  .map-tool-btn {
    width: 100%;
    justify-content: center;
    padding: 0.45rem 0.3rem;
    font-size: 0.72rem;
    gap: 0.25rem;
  }

  #solarMap {
    height: 250px;
  }

  /* Floating roof drawing guide bar */
  .roof-draw-guide-bar {
    top: 6px;
    left: 6px;
    right: 6px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.5rem;
  }

  .guide-info {
    font-size: 0.75rem;
  }

  .guide-stats {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
  }

  .guide-stat-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .guide-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  .btn-guide-confirm,
  .btn-guide-cancel {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    justify-content: center;
  }

  /* Solar Climate Radar */
  .solar-climate-radar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.35rem;
    padding: 0.5rem;
  }

  .radar-stat-item {
    padding: 0.4rem 0.25rem;
  }

  .radar-label {
    font-size: 0.6rem;
  }

  .radar-value {
    font-size: 0.95rem;
  }

  .radar-source-tag {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 0.62rem;
  }

  /* Hero Generation Button */
  .generate-cta-container {
    margin-top: 1.25rem;
  }

  .btn-generate-hero {
    width: 100% !important;
    font-size: 0.95rem !important;
    padding: 0.85rem 0.85rem !important;
    gap: 0.45rem !important;
    justify-content: center !important;
    letter-spacing: 0 !important;
  }

  .generate-subtext {
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.35;
  }

  /* Results Top Toolbar */
  .results-top-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem;
  }

  #btnBackToInputs {
    width: 100%;
    font-size: 0.8rem;
    justify-content: center;
  }

  .assistant-buttons-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    width: 100%;
  }

  .btn-tour-trigger,
  .btn-inspect-trigger {
    width: 100% !important;
    font-size: 0.72rem !important;
    padding: 0.45rem 0.3rem !important;
    justify-content: center !important;
  }

  /* Inspect mode banner */
  .inspect-mode-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem;
    font-size: 0.75rem;
  }

  .btn-close-inspect {
    width: 100%;
    text-align: center;
  }

  /* Ficha Técnica Card on Mobile */
  .project-details-card {
    padding: 1rem 0.75rem;
    border-radius: var(--radius-md);
  }

  .project-details-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding-bottom: 0.75rem;
  }

  .details-title {
    font-size: 1.15rem;
    line-height: 1.25;
  }

  .details-subtitle {
    font-size: 0.78rem;
  }

  .header-badges {
    gap: 0.35rem;
  }

  .badge-pill,
  .details-pre-title {
    font-size: 0.65rem;
  }

  .project-details-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
    margin: 0.85rem 0;
  }

  .details-info-box {
    padding: 0.75rem 0.65rem;
  }

  .box-head h4 {
    font-size: 0.85rem;
  }

  .details-item {
    font-size: 0.8rem;
  }

  .d-value-pill {
    font-size: 0.72rem;
    padding: 1px 6px;
  }

  .coords-tag {
    font-size: 0.72rem;
  }

  .btn-maps-satellite {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
  }

  .details-map-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .details-map-badge {
    font-size: 0.68rem;
    padding: 1px 6px;
  }

  .details-map-frame {
    height: 220px;
  }

  /* KPI Main Banner */
  .kpi-main-banner {
    padding: 1rem 0.75rem;
    border-radius: var(--radius-md);
  }

  .banner-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
  }

  .banner-title {
    font-size: 0.78rem;
  }

  .banner-price-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .banner-price {
    font-size: 1.65rem;
  }

  .banner-price-tag {
    font-size: 0.75rem;
  }

  .kpi-grid-metrics {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
  }

  .kpi-box {
    padding: 0.5rem 0.35rem;
  }

  .kpi-box-label {
    font-size: 0.65rem;
  }

  .kpi-box-val {
    font-size: 1.05rem;
  }

  /* Eco Impact Banner */
  .eco-impact-banner {
    padding: 1rem 0.75rem;
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .eco-left {
    gap: 0.65rem;
  }

  .eco-leaf-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .eco-left h4 {
    font-size: 0.95rem !important;
  }

  .eco-left p {
    font-size: 0.72rem !important;
  }

  .eco-stats-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }

  .eco-stat-val {
    font-size: 1rem;
  }

  .eco-stat-lbl {
    font-size: 0.62rem;
  }

  /* KPI Mini cards */
  .kpi-details-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
  }

  .kpi-mini-card {
    padding: 0.75rem;
  }

  .kpi-mini-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .kpi-mini-text h4 {
    font-size: 0.78rem;
  }

  .kpi-mini-text p {
    font-size: 1.05rem;
  }

  /* Charts Container */
  .charts-container-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }

  .chart-card {
    padding: 0.85rem 0.65rem;
  }

  .chart-canvas-box {
    height: 230px !important;
  }

  /* Tables & Horizontal Scrolls */
  .amortization-table-wrap,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Action Buttons Bar */
  .action-buttons-bar {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .action-buttons-bar .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.7rem 1rem;
  }

  /* Modals on Mobile */
  .modal-dialog {
    margin: 0.5rem;
    padding: 1.25rem 0.85rem;
    max-height: 94vh;
    width: calc(100% - 1rem);
    border-radius: var(--radius-md);
  }

  .modal-close-btn {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* Guided Tour Popover on Mobile (Docked bottom card) */
  .tour-popover {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 12px !important;
    top: auto !important;
    transform: none !important;
    padding: 1rem 0.85rem !important;
    border-radius: var(--radius-md) !important;
  }

  .tour-popover-body p {
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
    margin-bottom: 0.75rem !important;
  }

  .tour-popover-footer {
    gap: 0.35rem;
  }

  .btn-tour-nav {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.75rem !important;
  }

  /* Inspect concept modal on mobile */
  .explain-modal-dialog {
    margin: 0.5rem;
    padding: 1.15rem 0.85rem;
    width: calc(100% - 1rem);
  }

  .explain-assistant-wrap {
    flex-direction: column !important;
    gap: 0.65rem !important;
    text-align: center;
  }

  .explain-logo-3d {
    width: 48px;
    height: 48px;
    margin: 0 auto;
  }

  .explain-body {
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .brand-logo-img {
    max-width: 85px;
    height: 24px;
  }

  .nav-tab-btn {
    padding: 0.3rem 0.45rem;
    font-size: 0.68rem;
  }

  .btn-generate-hero {
    font-size: 0.85rem !important;
  }
}

/* LEAFLET LAYER SELECTOR & CONTROLS */
.leaflet-control-layers {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #F8FAFC !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.78rem !important;
  backdrop-filter: blur(12px) !important;
}

.leaflet-control-layers-toggle {
  background-color: rgba(15, 23, 42, 0.85) !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.leaflet-control-layers-expanded {
  padding: 8px 12px !important;
}

.leaflet-control-layers-base label {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  margin: 4px 0 !important;
  cursor: pointer !important;
  color: #CBD5E1 !important;
  font-weight: 500 !important;
  transition: var(--transition) !important;
}

.leaflet-control-layers-base label:hover {
  color: var(--solar-amber) !important;
}

.leaflet-control-layers-base input[type="radio"] {
  accent-color: var(--solar-amber) !important;
  cursor: pointer !important;
}

/* ==========================================================================
   SMOOTH THEME TRANSITIONS
   ========================================================================== */
body, 
.app-header, 
.glass-card, 
.project-details-card, 
.kpi-main-banner, 
.chart-card, 
.modal-dialog, 
.form-control, 
.nav-tabs, 
.btn-secondary {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

/* ==========================================================================
   LIGHT THEME DESIGN SYSTEM & COLOR PALETTE
   Ultra-clean, modern, solar-accented executive aesthetics
   ========================================================================== */
[data-theme="light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #FFFFFF;
  --bg-input: #FFFFFF;
  --border-color: #E2E8F0;
  --border-hover: rgba(217, 119, 6, 0.5);

  --solar-amber: #D97706;
  --solar-amber-light: #B45309;
  --solar-gradient: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  --eco-emerald: #059669;
  --eco-emerald-glow: rgba(5, 150, 105, 0.2);
  --eco-gradient: linear-gradient(135deg, #10B981 0%, #047857 100%);
  --sky-blue: #0284C7;
  --sky-gradient: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 0 20px rgba(217, 119, 6, 0.05);
  --glow-solar: 0 0 25px rgba(245, 158, 11, 0.15);
  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] body {
  background-color: #F8FAFC;
  color: #0F172A;
  background-image:
    radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
}

/* Header in Light Mode */
[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-tabs {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .nav-tab-btn {
  color: #475569;
}

[data-theme="light"] .nav-tab-btn:hover {
  color: #0F172A;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-tab-btn.active {
  background: var(--solar-gradient);
  color: #FFFFFF;
}

[data-theme="light"] .firebase-badge {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}

[data-theme="light"] .btn-theme-toggle {
  background: #FEF3C7;
  border-color: #FDE68A;
  color: #D97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15);
}

[data-theme="light"] .btn-theme-toggle:hover {
  background: #FDE68A;
  border-color: #F59E0B;
  color: #B45309;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .btn-discreet-admin {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: #64748B;
}

[data-theme="light"] .btn-discreet-admin:hover {
  color: #D97706;
  border-color: #F59E0B;
  background: #FEF3C7;
}

/* Step Intro & Typography */
[data-theme="light"] .step-intro-banner h2 {
  background: linear-gradient(135deg, #0F172A 30%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .step-intro-banner p {
  color: #475569;
}

/* Glass Cards & Containers */
[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .glass-card:hover {
  border-color: #CBD5E1;
}

[data-theme="light"] .card-title-box {
  border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .card-title-box h3 {
  color: #0F172A;
}

/* Form Controls */
[data-theme="light"] .form-label {
  color: #334155;
}

[data-theme="light"] .form-control {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

[data-theme="light"] .form-control:focus {
  border-color: #D97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

[data-theme="light"] .form-control::placeholder {
  color: #94A3B8;
}

/* Toggle Group & Buttons */
[data-theme="light"] .toggle-group {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .toggle-btn {
  color: #475569;
}

[data-theme="light"] .toggle-btn.active {
  background: var(--solar-gradient);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

/* Accordion & Advanced Settings */
[data-theme="light"] .advanced-settings-accordion {
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
}

[data-theme="light"] .accordion-toggle-btn {
  color: #334155;
}

[data-theme="light"] #batteryConfigGroup {
  background: #FFFBEB !important;
  border: 1px solid #FDE68A !important;
}

/* Roof Option Cards */
[data-theme="light"] .roof-option-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .roof-option-card:hover {
  background: #FFFBEB;
  border-color: #F59E0B;
}

[data-theme="light"] .roof-option-card.selected {
  background: #FEF3C7;
  border-color: #D97706;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.18);
}

[data-theme="light"] .roof-name {
  color: #1E293B;
}

/* Map Header Bar & Tools */
[data-theme="light"] .map-container-box {
  border: 1px solid #CBD5E1;
}

[data-theme="light"] .map-header-bar {
  background: rgba(241, 245, 249, 0.96);
  border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .map-search-input {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

[data-theme="light"] .map-tool-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #1E293B;
}

[data-theme="light"] .map-tool-btn:hover {
  background: #FEF3C7;
  border-color: #D97706;
  color: #B45309;
}

[data-theme="light"] .map-tool-btn.active {
  background: var(--solar-gradient);
  color: #FFFFFF;
}

[data-theme="light"] .solar-climate-radar {
  background: #F1F5F9;
  border-top: 1px solid #E2E8F0;
}

[data-theme="light"] .radar-stat-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .radar-label {
  color: #64748B;
}

[data-theme="light"] .radar-value {
  color: #B45309;
}

[data-theme="light"] .roof-draw-guide-bar {
  background: rgba(255, 255, 255, 0.96);
  border-color: #D97706;
  color: #0F172A;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .guide-stat-badge {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #0F172A;
}

/* KPI Banners */
[data-theme="light"] .kpi-main-banner {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFBEB 100%);
  border: 1px solid rgba(217, 119, 6, 0.35);
  box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.1), 0 4px 10px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .banner-title {
  color: #B45309;
}

[data-theme="light"] .banner-price {
  color: #0F172A;
}

[data-theme="light"] .kpi-grid-metrics {
  border-top: 1px solid #E2E8F0;
}

[data-theme="light"] .kpi-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .kpi-box-label {
  color: #64748B;
}

[data-theme="light"] .kpi-box-val {
  color: #0F172A;
}

[data-theme="light"] .kpi-mini-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .kpi-mini-text h4 {
  color: #64748B;
}

[data-theme="light"] .kpi-mini-text p {
  color: #0F172A;
}

/* Eco Impact Banner */
[data-theme="light"] .eco-impact-banner {
  background: linear-gradient(135deg, #ECFDF5 0%, #FFFFFF 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.08);
}

[data-theme="light"] .eco-impact-banner h4 {
  color: #065F46 !important;
}

[data-theme="light"] .eco-impact-banner p {
  color: #047857 !important;
}

[data-theme="light"] .eco-stat-val {
  color: #059669;
}

/* Chart Cards */
[data-theme="light"] .chart-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .chart-card-header {
  color: #334155;
}

/* Project Technical Sheet */
[data-theme="light"] .project-details-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .project-details-header {
  border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .details-title {
  color: #0F172A;
}

[data-theme="light"] .details-info-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .details-info-box:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
}

[data-theme="light"] .box-head {
  border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .box-head h4 {
  color: #0F172A;
}

[data-theme="light"] .details-item .d-label {
  color: #64748B;
}

[data-theme="light"] .details-item .d-value {
  color: #0F172A;
}

[data-theme="light"] .coords-tag {
  background: #E2E8F0;
  color: #334155;
}

[data-theme="light"] .details-satellite-section {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .details-map-header {
  background: #F1F5F9;
  border-bottom: 1px solid #E2E8F0;
  color: #0F172A;
}

[data-theme="light"] .details-map-badge {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
}

/* Secondary Button */
[data-theme="light"] .btn-secondary {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #1E293B;
}

[data-theme="light"] .btn-secondary:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #0F172A;
}

/* Modals & Popovers */
[data-theme="light"] .modal-dialog {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #0F172A;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .modal-close-btn {
  background: #F1F5F9;
  color: #475569;
}

[data-theme="light"] .modal-close-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

[data-theme="light"] .tour-popover {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #0F172A;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .tour-popover-header {
  border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .tour-popover-footer {
  border-top: 1px solid #E2E8F0;
}

[data-theme="light"] .tour-close-btn {
  color: #64748B;
}

[data-theme="light"] #tourStepTitle {
  color: #0F172A;
}

[data-theme="light"] #tourStepText {
  color: #475569;
}

[data-theme="light"] .admin-login-dialog {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .admin-login-header h3 {
  color: #0F172A;
}

[data-theme="light"] .admin-login-header p {
  color: #64748B;
}

[data-theme="light"] .admin-login-footer {
  border-top: 1px solid #E2E8F0;
  color: #64748B;
}

[data-theme="light"] .explain-assistant-content h3 {
  color: #0F172A;
}

[data-theme="light"] .explain-assistant-content p {
  color: #475569;
}

[data-theme="light"] .welcome-tour-dialog {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .welcome-tour-box h3 {
  color: #0F172A;
}

[data-theme="light"] .welcome-tour-box p {
  color: #475569;
}

[data-theme="light"] .purchase-incentive-dialog {
  background: #FFFFFF;
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25), 0 0 30px rgba(245, 158, 11, 0.15);
}

[data-theme="light"] .purchase-incentive-dialog .incentive-kpi-card {
  background: #F8FAFC !important;
}

[data-theme="light"] .purchase-incentive-dialog .incentive-bonus-box {
  background: #FFFBEB !important;
  border-color: #F59E0B !important;
}

/* Quotes Table */
[data-theme="light"] .quotes-table-container {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .quotes-table th {
  background: #F1F5F9;
  color: #475569;
  border-bottom: 1px solid #CBD5E1;
}

[data-theme="light"] .quotes-table td {
  border-bottom: 1px solid #F1F5F9;
  color: #0F172A;
}

[data-theme="light"] .quotes-table tr:hover td {
  background: #F8FAFC;
}

[data-theme="light"] .status-select {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme="light"] .edit-section-card {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

[data-theme="light"] .btn-action.view-quote {
  background: #D1FAE5;
  border-color: #A7F3D0;
  color: #059669;
}

[data-theme="light"] .btn-action.view-quote:hover {
  background: #A7F3D0;
  color: #047857;
}

[data-theme="light"] .btn-action.print-quote {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
}

[data-theme="light"] .btn-action.print-quote:hover {
  background: #FECACA;
  color: #B91C1C;
}

[data-theme="light"] .btn-action.edit-quote {
  background: #E0F2FE;
  border-color: #BAE6FD;
  color: #0284C7;
}

[data-theme="light"] .btn-action.edit-quote:hover {
  background: #BAE6FD;
  color: #0369A1;
}

[data-theme="light"] .btn-action.load-quote {
  background: #FEF3C7;
  border-color: #FDE68A;
  color: #D97706;
}

[data-theme="light"] .btn-action.load-quote:hover {
  background: #FDE68A;
  color: #B45309;
}

[data-theme="light"] .btn-action.delete-quote {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: #64748B;
}

[data-theme="light"] .btn-action.delete-quote:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #EF4444;
}

/* Inspect Mode Banner */
[data-theme="light"] .inspect-mode-banner {
  background: linear-gradient(135deg, #FEF3C7 0%, #D1FAE5 100%);
  border-color: #F59E0B;
}

[data-theme="light"] .inspect-banner-text {
  color: #0F172A;
}

[data-theme="light"] .btn-close-inspect {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: #0F172A;
}

/* Leaflet in Light Mode */
[data-theme="light"] .leaflet-control-layers {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .leaflet-control-layers-toggle {
  background-color: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
}

[data-theme="light"] .leaflet-control-layers-base label {
  color: #334155 !important;
}

/* ==========================================================================
   20-DAY VALIDITY, URGENT ALERTS & PAYMENT STATUS STYLES
   ========================================================================== */
.validity-dashboard-section {
  width: 100%;
}

.quotes-alert-card {
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
}

.quotes-alert-card.urgent-alert-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}

.quotes-alert-card.finalized-alert-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.4) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.alert-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pulse-alert-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 1px solid rgba(245, 158, 11, 0.4);
  animation: urgentPulse 1.8s infinite;
}

.finalized-alert-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

@keyframes urgentPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.badge-count.urgent {
  background: #F59E0B;
  color: #0F172A;
}

.badge-count.info {
  background: #38BDF8;
  color: #0F172A;
}

/* Urgent Quotes Cards Grid */
.urgent-quotes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.urgent-quote-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  transition: transform 0.2s, border-color 0.2s;
}

.urgent-quote-item:hover {
  transform: translateY(-2px);
  border-color: #F59E0B;
}

.urgent-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.urgent-item-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.urgent-item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.btn-whatsapp-motivate {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #FFFFFF !important;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  text-decoration: none;
  flex: 1;
  justify-content: center;
}

.btn-whatsapp-motivate:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}

/* Finalized Strip KPIs */
.finalized-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.fin-stat-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fin-stat-box.success {
  border-left: 3px solid #10B981;
}

.fin-stat-box.danger {
  border-left: 3px solid #EF4444;
}

.fin-stat-box.accent {
  border-left: 3px solid #38BDF8;
}

.fin-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fin-stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
}

.fin-stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Finalized Mini Table */
.finalized-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.finalized-mini-table th {
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.finalized-mini-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

/* Payment Status Toggle Button */
.btn-pay-status {
  border: none;
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.btn-pay-status.paid {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid #10B981;
  color: #10B981;
}

.btn-pay-status.paid:hover {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-pay-status.unpaid {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #F87171;
}

.btn-pay-status.unpaid:hover {
  background: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Validity Clock Badges */
.badge-validity {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-validity.badge-active {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-validity.badge-urgent {
  background: rgba(245, 158, 11, 0.18);
  color: #F59E0B;
  border: 1px solid #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
  animation: subtlePulse 2s infinite ease-in-out;
}

.badge-validity.badge-expired {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-validity.badge-paid {
  background: rgba(5, 150, 105, 0.15);
  color: #34D399;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

@keyframes subtlePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Light mode adjustments */
[data-theme="light"] .quotes-alert-card.urgent-alert-card {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #FDE68A;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.12);
}

[data-theme="light"] .quotes-alert-card.finalized-alert-card {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border: 1px solid #BAE6FD;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.08);
}

[data-theme="light"] .urgent-quote-item {
  background: #FFFFFF;
  border: 1px solid #FDE68A;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .fin-stat-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="light"] .fin-stat-val {
  color: #0F172A;
}

[data-theme="light"] .finalized-mini-table th {
  background: #F1F5F9;
  color: #475569;
  border-bottom: 1px solid #CBD5E1;
}

[data-theme="light"] .finalized-mini-table td {
  border-bottom: 1px solid #E2E8F0;
  color: #1E293B;
}

[data-theme="light"] .btn-pay-status.paid {
  background: #D1FAE5;
  border-color: #34D399;
  color: #065F46;
}

[data-theme="light"] .btn-pay-status.unpaid {
  background: #FEE2E2;
  border-color: #F87171;
  color: #991B1B;
}

[data-theme="light"] .badge-validity.badge-active {
  background: #ECFDF5;
  color: #047857;
  border-color: #A7F3D0;
}

[data-theme="light"] .badge-validity.badge-urgent {
  background: #FEF3C7;
  color: #92400E;
  border-color: #F59E0B;
}

[data-theme="light"] .badge-validity.badge-expired {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FCA5A5;
}

[data-theme="light"] .badge-validity.badge-paid {
  background: #D1FAE5;
  color: #065F46;
  border-color: #6EE7B7;
}