/* =============================================================
   SimulaSubsidio — Rediseño Profesional con Sidebar
   ============================================================= */


/* ---------------------------------------------------------------
   1. VARIABLES Y RESET
--------------------------------------------------------------- */
:root {
  --brand:        #0C0CAF;
  --brand-dark:   #07076E;
  --brand-light:  #E8E8FF;
  --brand-mid:    #2525C8;
  --accent:       #00D4AA;
  --accent-dark:  #00A88A;
  --warn:         #F59E0B;
  --danger:       #EF4444;
  --success:      #10B981;

  --sidebar-w:    260px;
  --sidebar-bg:   #0A0A72;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-act:  rgba(255,255,255,0.12);

  --bg:           #F4F6FB;
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFD;
  --border:       #E4E9F2;
  --text-primary: #111827;
  --text-secondary:#6B7280;
  --text-muted:   #9CA3AF;

  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    24px;

  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow:       0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
  --shadow-brand: 0 4px 20px rgba(12,12,175,0.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ---------------------------------------------------------------
   TOPNAV — Barra superior azul full-width
--------------------------------------------------------------- */
#app-topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: #0D0D8A;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  gap: 1rem;
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;

 
}

.topnav-logo-icon {
   width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}
.topnav-logo-icon svg, .topnav-logo-icon img { width: 100%; height: 100%; display: block; }

.topnav-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.topnav-brand span {
   color: rgba(255, 255, 255, 0.65);
}
.topnav-tagline {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.03em;
}

/*.topnav-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}*/

.topnav-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.40rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px;
  padding: 0.25rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
}

.topnav-spacer { flex: 1; }

.topnav-uf {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
}
.topnav-uf-label {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.topnav-uf-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  padding:0.10rem ;
}
.topnav-uf-time {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  line-height: 1;
  margin-top: 1px;
}
.topnav-uf-refresh {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.6rem;
  transition: 0.25s;
  flex-shrink: 0;
}
.topnav-uf-refresh:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
  transform: rotate(180deg);
}

/* ---------------------------------------------------------------
   2. LAYOUT — Sidebar + Main (below topnav)
--------------------------------------------------------------- */
#app-sidebar {
  position: fixed;
  top: 60px; left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - 60px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

#app-main {
  margin-left: var(--sidebar-w);
  margin-top: 60px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
}

/* Sidebar Header — hidden (logo moved to topnav) */
.sidebar-header {
  display: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
}

.sidebar-logo-icon svg { width: 24px; height: 24px; }

.sidebar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand span { color: var(--brand); }

.sidebar-tagline {
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* UF Widget en sidebar */
.sidebar-uf {
  margin: 0.85rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-uf-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 0.9rem;
}

.sidebar-uf-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.sidebar-uf-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-uf-refresh {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  font-size: 0.65rem;
  transition: 0.3s;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  border: 1px solid #C7D2FE;
}

.sidebar-uf-refresh:hover {
  background: var(--brand);
  color: #fff;
  transform: rotate(180deg);
}

/* Nav Items */
.sidebar-nav {
  padding: 0.5rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav-group {
  margin: 0.5rem 0rem;
}

.sidebar-nav-group-label {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.3rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  color: var(--brand);
   font-weight: 600;
}

.sidebar-nav-item.active {
 
  color: var(--brand);
  font-weight: 600;
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 40%;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}

.sidebar-nav-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: 0.2s;
}

.sidebar-nav-item.active .sidebar-nav-icon,
.sidebar-nav-item:hover .sidebar-nav-icon {
  color: var(--brand);
}

.sidebar-nav-item.active .sidebar-nav-icon {

  color: var(--brand);
}

.sidebar-nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

.sidebar-nav-badge--soon {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.58rem;
}

/* Collapsible sidebar groups */
.sidebar-collapsible .sidebar-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsible.open .sidebar-group-items {
  max-height: 400px;
}

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  text-align: left;
}

.sidebar-group-toggle:hover {
  background: rgba(0,0,0,0.03);
}

.sidebar-group-label-text {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
}

.sidebar-group-chevron {
  font-size: 0.55rem;
  color: var(--text-muted);
  transition: transform 0.25s;
}

.sidebar-collapsible.open .sidebar-group-chevron {
  transform: rotate(180deg);
}

/* Colored dots per DS group */
.sidebar-group-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-group-dot--ds1  { background: var(--brand); }
.sidebar-group-dot--ds52 { background:var(--brand); }
.sidebar-group-dot--ds49 { background: var(--text-muted); }

/* Disabled nav item */
.sidebar-nav-item--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* ---------------------------------------------------------------
   3. MAIN — Topbar + Content
--------------------------------------------------------------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  font-size: 0.9rem;
}

.topbar-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.topbar-badge.blue {
  background: var(--brand-light);
  color: var(--brand);
  border-color: #C7D2FE;
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  width: 100%;
}

/* ---------------------------------------------------------------
   4. TABS (ocultamos el contenido antiguo de tabs)
--------------------------------------------------------------- */
.hidden { display: none !important; }

.fade-in {
  animation: fadeIn 0.35s ease;
}

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

/* ---------------------------------------------------------------
   5. CARDS
--------------------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-color: transparent;
}

.stat-card.highlight .stat-card-label { color: rgba(255,255,255,0.65); }
.stat-card.highlight .stat-card-value { color: #fff; }
.stat-card.highlight .stat-card-sub   { color: rgba(255,255,255,0.6); }

/* ---------------------------------------------------------------
   6. FORM FIELDS
--------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .icon {
  position: absolute;
  left: 0.875rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}

.input-wrap input,
.input-wrap select {
  width: 100%;
  height: 44px;
  padding: 0 1rem 0 2.5rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.2s;
  appearance: none;
}

.input-wrap input::placeholder {
  color: #B0BAC9;
  font-style: italic;
  font-size: 0.82rem;
}

.input-wrap select option[value=""] {
  color: #B0BAC9;
  font-style: italic;
}

.input-wrap input:focus,
.input-wrap select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(12,12,175,0.1);
}

.input-wrap input.error,
.input-wrap select.error {
  border-color: var(--danger);
  background: #FEF2F2;
}

.input-wrap .chevron {
  position: absolute;
  right: 0.875rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  pointer-events: none;
}

.field-help {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.4;
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 500;
}

/* Hide the exclamation icon in error messages */
.field-error i { display: none; }

/* Info tooltip for help texts */
.field-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 0.5rem;
  cursor: help;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.field-help-icon:hover .tooltip-content,
.field-help-icon:focus .tooltip-content {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tooltip-content {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1F2937;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 400;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 240px;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  line-height: 1.4;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-align: left;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1F2937;
}

/* Improved detail factor cards — minimalist */
.detalle-factor {
  border-radius: 10px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.detalle-factor--zero {
  border-color: #E9ECF0;
  opacity: 0.85;
}

.factor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem;
  background: var(--surface);
}

.factor-num {
  width: 22px;
  height: 22px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 0;
  flex-shrink: 0;
}

.factor-num--zero {
  background: var(--surface-2);
  color: var(--text-muted);
}

.factor-score-badge {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 6px;
  padding: 0.25rem 0.625rem;
  letter-spacing: -0.01em;
}

.factor-score-badge--zero {
  color: var(--text-muted);
  background: var(--surface-2);
  font-weight: 600;
}

.factor-items {
  border-top: 1px solid var(--border);
  padding: 0.375rem 1.125rem 0.625rem;
  background: var(--surface-2);
}

.factor-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.8rem;
  gap: 0.5rem;
}

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

.factor-item--zero .factor-item-label {
  color: var(--text-muted);
  font-style: italic;
}

.factor-item--zero .factor-item-pts {
  color: var(--text-muted);
}

.factor-item-label {
  color: var(--text-secondary);
  flex: 1;
  line-height: 1.4;
}

.factor-item-pts {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Result card action row */
.resultado-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.resultado-tramo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid #C7D2FE;
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Improved exceso / planificador detail style */
.desglose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.desglose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  gap: 0.5rem;
}

.desglose-row:last-child { border-bottom: none; }

.desglose-row.active-band {
  background: var(--brand-light);
}

.desglose-row.active-band .desglose-label { color: var(--brand); font-weight: 600; }
.desglose-row.active-band .desglose-pts   { color: var(--brand); font-weight: 800; }

.desglose-label { color: var(--text-secondary); flex: 1; }
.desglose-rate  { color: var(--text-muted); font-size: 0.75rem; margin: 0 0.5rem; white-space: nowrap; }
.desglose-pts   { font-weight: 700; color: var(--text-primary); white-space: nowrap; }

.desglose-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.75rem 0 0.375rem;
}

/* Insufficient savings alert */
.ahorro-insuficiente {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.875rem;
}

.ahorro-insuficiente-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #991B1B;
  margin-bottom: 0.25rem;
}

.ahorro-insuficiente-msg {
  font-size: 0.8rem;
  color: #B91C1C;
  line-height: 1.5;
}

/* ---------------------------------------------------------------
   7. FORMULARIO — Steps (integrated progress bar)
--------------------------------------------------------------- */
.section-nav {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.section-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  position: relative;
}

/* Connector line between steps */
.section-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: var(--border);
  transition: background 0.4s;
  z-index: 0;
}

.section-step.done:not(:last-child)::after {
  background: var(--brand);
}

.step-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.25s;
  position: relative;
  z-index: 1;
}

.step-circle.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(12,12,175,0.15);
}

.step-circle.done {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.step-label {
  font-size: 0.67rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1;
}

.step-label.active {
  color: var(--brand);
  font-weight: 700;
}

.step-label.done {
  color: var(--brand);
  font-weight: 600;
}

/* Hidden legacy progress bar — kept for JS compatibility but invisible */
.progress-bar {
  display: none;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 99px;
  transition: width 0.35s ease;
}

/* ---------------------------------------------------------------
   STEP NAV — new .step-item / .step-connector style (arriendo + future)
--------------------------------------------------------------- */
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  margin-bottom: 1.25rem;
  transition: background 0.35s;
  max-width: 60px;
}
.step-connector.done { background: var(--brand); }

/* ---------------------------------------------------------------
   SECTION TITLE ROW (arriendo form sections)
--------------------------------------------------------------- */
.section-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.section-badge {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: #FFFFFF;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Form nav row (Anterior / Siguiente buttons) */
.form-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Form sub-section label */
.form-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.875rem;
  margin-top: 0.5rem;
}
/* ---------------------------------------------------------------
   8. BUTTONS
--------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(12,12,175,0.35);
}

.btn-primary:active { transform: none; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

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

.btn-ghost {
  color: var(--brand);
  background: var(--brand-light);
}

.btn-ghost:hover { background: #D1D5FF; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
}

.btn-accent:hover { filter: brightness(1.05); }

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-full { width: 100%; }

/* ---------------------------------------------------------------
   9. INFO BOXES
--------------------------------------------------------------- */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  border: 1px solid;
}

.info-box-blue {
  background: #EFF6FF;
  border-color: var(--brand);
  color: #1E40AF;
}

.info-box-yellow {
  background: #FFFBEB;
  border-color: var(--warn);
  color: #92400E;
}

.info-box-green {
  background: #F0FDF4;
  border-color: var(--success);
  color: #065F46;
}

.info-box-red {
  background: #FEF2F2;
  border-color: var(--danger);
  color: #991B1B;
}

/* ---------------------------------------------------------------
   10. RESULTADO
--------------------------------------------------------------- */
.resultado-hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.resultado-hero::after {
  content: '';
  position: absolute;
  right: -40px; bottom: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.resultado-score {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.resultado-score-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.25rem;
}

.resultado-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.resultado-meta-item {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
}

.resultado-meta-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.resultado-meta-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

/* Factor detail cards */
.detalle-factor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.factor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.factor-num {
  width: 28px; height: 28px;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.factor-items {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  background: var(--surface-2);
}

.factor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

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

/* ---------------------------------------------------------------
   11. EXCESO DE AHORRO
--------------------------------------------------------------- */
.exc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.exc-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.exc-card-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.exc-card-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.exc-card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.exc-card.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
  border-color: transparent;
}

.exc-card.primary .exc-card-value { color: #fff; }
.exc-card.primary .exc-card-label { color: rgba(255,255,255,0.65); }
.exc-card.primary .exc-card-sub   { color: rgba(255,255,255,0.7); }

.puntaje-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.puntaje-item.activo {
  background: var(--brand-light);
  border-color: #C7D2FE;
  color: var(--brand);
}

/* ---------------------------------------------------------------
   12. PLANIFICADOR
--------------------------------------------------------------- */
.semestre-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.semestre-btn {
  padding: 0.45rem 0.875rem;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: 0.2s;
}

.semestre-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.semestre-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

/* ---------------------------------------------------------------
   13. FACTORES ACCORDION
--------------------------------------------------------------- */
.factor-card {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.625rem;
  text-align: left;
  transition: all 0.2s;
  overflow: hidden;
}

.factor-card:hover {
  border-color: #C7D2FE;
  box-shadow: var(--shadow);
}

.factor-card.open {
  border-color: var(--brand);
}

.factor-card-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
}

.factor-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.factor-card-content {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ---------------------------------------------------------------
   14. GRADIENT UTILITIES
--------------------------------------------------------------- */
.gradient-primary   { background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid)); }
.gradient-secondary { background: linear-gradient(135deg, #020265, #1515a0); }
.gradient-success   { background: linear-gradient(135deg, #00b09b, #96c93d); }
.gradient-warning   { background: linear-gradient(135deg, #f7971e, #ffd200); }
.gradient-danger    { background: linear-gradient(135deg, #ff416c, #ff4b2b); }
.gradient-blue      { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.gradient-green     { background: linear-gradient(135deg, #22c55e, #16a34a); }
.gradient-orange    { background: linear-gradient(135deg, #f97316, #ea580c); }

/* ---------------------------------------------------------------
   15. UTILITIES
--------------------------------------------------------------- */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gap-4 { gap: 1rem; margin-bottom: 15px; }
.gap-6 { gap: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.rounded-lg { border-radius: var(--radius); }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

/* Color utilities */
.text-gray-500 { color: var(--text-muted); }
.text-gray-600 { color: var(--text-secondary); }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1F2937; }
.text-gray-900 { color: #111827; }
.text-blue-600 { color: #2563EB; }
.text-blue-700 { color: #1D4ED8; }
.text-green-500 { color: #22C55E; }
.text-green-600 { color: #16A34A; }
.text-red-500 { color: #EF4444; }
.text-yellow-500 { color: #F59E0B; }
.text-orange-600 { color: #EA580C; }
.text-white { color: #fff; }
.bg-gray-50 { background: #F9FAFB; }
.bg-blue-50 { background: #EFF6FF; }
.bg-green-50 { background: #F0FDF4; }

/* Loading shimmer */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,170,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(0,212,170,0); }
}

.pulse-animation { animation: pulse 2s infinite; }

/* ---------------------------------------------------------------
   16. RESPONSIVE
--------------------------------------------------------------- */
@media (max-width: 768px) {
  /* ── Sidebar ── */
  #app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    top: 60px;
    height: calc(100vh - 60px);
  }
  #app-sidebar.open {
    transform: translateX(0);
  }

  /* ── Main layout ── */
  #app-main {
    margin-left: 0;
    margin-top: 60px;
  }

  /* ── Topbar ── */
  .topbar {
    padding: 0 1rem;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    position: sticky;
    top: 60px;
  }
  .topbar-title { flex: 1; min-width: 0; }
  .topbar-heading { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-sub { font-size: 0.68rem; }
  .topbar-actions { width: 100%; }
  .topbar-badge { font-size: 0.68rem; padding: 0.25rem 0.6rem; }

  /* ── Main content ── */
  .main-content {
    padding: 0.75rem;
    max-width: 100%;
  }

  /* ── Cards ── */
  .card { padding: 1rem; }
  .card-header { gap: 0.75rem; margin-bottom: 1rem; padding-bottom: 1rem; }
  .card-icon { width: 38px; height: 38px; font-size: 0.95rem; border-radius: 10px; }
  .card-title { font-size: 0.95rem; }
  .card-subtitle { font-size: 0.73rem; }

  /* ── Step nav ── */
  .section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0;
    padding: 3px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .section-nav::-webkit-scrollbar { display: none; }
  .section-step {
    flex: 1 0 auto;
    min-width: 50px;
    padding: 0.3rem 0;
    gap: 0.25rem;
  }
  .section-step:not(:last-child)::after { top: 16px; }
  .step-circle { width: 28px; height: 28px; font-size: 0.6rem; }
  .step-label { font-size: 0.6rem; white-space: nowrap; }

  /* ── Grids ── */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .grid-cols-2 { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; gap: 0.75rem !important; }
  .exc-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .resultado-meta-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .resultado-stats { grid-template-columns: 1fr; gap: 0.5rem; }

  /* ── Result card ── */
  .resultado-card-header {
    padding: 1.25rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .resultado-score { font-size: 2.75rem; }
  .resultado-card-body { padding: 1rem; }
  .resultado-meta-item { padding: 0.625rem; }
  .resultado-meta-value { font-size: 1.1rem; }
  .resultado-meta-label { font-size: 0.62rem; }

  /* ── Stat cards ── */
  .stat-card { padding: 0.875rem; }
  .stat-card-value { font-size: 1.4rem; }

  /* ── Buttons ── */
  .btn-mobile-full { width: 100%; }
  /* Keep justify-between rows (prev/next nav) as rows */
  .flex.justify-between { flex-direction: row !important; }

  /* ── Form fields ── */
  .input-wrap input,
  .input-wrap select { height: 46px; font-size: 0.875rem; }
  .field label { font-size: 0.72rem; }

  /* ── Info boxes ── */
  .info-box { font-size: 0.8rem; padding: 0.75rem 1rem; }

  /* ── Factor items ── */
  .factor-header { padding: 0.875rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .factor-items { padding: 0.625rem 1rem; }

  /* ── Planificador ── */
  .semestre-grid { gap: 0.4rem; }
  .semestre-btn { font-size: 0.72rem; padding: 0.4rem 0.75rem; }

  /* ── Exceso de ahorro ── */
  .exc-card { padding: 0.875rem; }
  .exc-card-value { font-size: 1.1rem; }

  /* ── Topnav ── */
  .topnav-uf { display: none; }
  .topnav-badge { display: none; }
  .topnav-divider { display: none; }
  .topnav-tagline { display: none; }
   .topnav-brand { display: none; }
 

  /* Center logo between hamburger and right edge */
  #app-topnav {
    justify-content: space-between;
  }
  .topnav-logo {
    position: absolute;
    left: 93%;
    transform: translateX(-50%);
  }
  .topnav-spacer { display: none; }
}

.sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand);
  align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  border: none;
}

/* The topnav toggle is always shown on mobile */
#app-topnav .sidebar-toggle {
  display: flex;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
}
@media (min-width: 769px) {
  #app-topnav .sidebar-toggle { display: none; }
  #topbar .sidebar-toggle { display: none !important; }
}
/* On mobile: topbar already has topnav toggle above — hide duplicate in white topbar */
@media (max-width: 768px) {
  #topbar .sidebar-toggle,
  .topbar .sidebar-toggle {
    display: none !important;
  }
}

/* ── Extra small screens (< 400px) ── */
@media (max-width: 400px) {
  .resultado-meta-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-heading { font-size: 0.82rem; }
  .resultado-score { font-size: 2.25rem; }
}

/* ── Footer mobile ── */
@media (max-width: 600px) {
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .app-footer-links { flex-wrap: wrap; gap: 0.5rem; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* ---------------------------------------------------------------
   RESULTADO — Card style (replaces hero gradient)
--------------------------------------------------------------- */
.resultado-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.resultado-card-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.resultado-score-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.resultado-score {
  font-size: 3.5rem;
  font-weight: 900;
  
  line-height: 1;
  color: #fff;
}

.resultado-score-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

.resultado-card-body {
  padding: 1.5rem 2rem;
}

.resultado-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.resultado-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.resultado-stat-value {
  font-size: 1.4rem;
  font-weight: 800;

  color: var(--brand);
}

.resultado-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* =============================================================
   ESTILOS DE ANUNCIOS — SimulaSubsidio Ads
   ============================================================= */

/* ── Footer ── */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.app-footer-copy { font-size: .7rem; color: var(--text-muted); }
.app-footer-links { display: flex; gap: 1rem; }
.app-footer-links a { font-size: .7rem; color: var(--text-muted); transition: color .2s; }
.app-footer-links a:hover { color: var(--brand); }

/* ── Zona sidebar ── */
.ad-slot-sidebar { display: none; }

/* ── Zona content-top (banner sobre formulario) ── */
.ad-slot-content-top { display: none; }

/* ── Zona después del resultado ── */
.ad-slot-after-result { display: none; }

/* ── Anuncios DEMO (visibles mientras no hay AdSense real) ── */
/* Responsive ads */
@media (max-width: 768px) {
  .ad-slot-content-top { display: none; }
  .ad-demo-leaderboard .ad-demo-body-horizontal { flex-wrap: wrap; gap: .5rem; }
  .ad-demo-leaderboard .ad-demo-cta { margin-left: 0; }
}
/* ---------------------------------------------------------------
   PUNTAJE DE CORTE — Estilos del panel de estadísticas
--------------------------------------------------------------- */
.corte-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.corte-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.corte-panel-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.corte-panel-title {
  font-size: .9rem; font-weight: 700; color: var(--text-primary);
}
.corte-panel-sub {
  font-size: .75rem; color: var(--text-secondary); margin-top: .15rem;
}
.corte-panel--neutral {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
}
.corte-panel-body { padding: 1.25rem 1.5rem; }

/* Tabla de puntajes de corte */
#corte-tabla-container table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
#corte-tabla-container table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
#corte-tabla-container table tr:last-child td { border-bottom: none; }

/* Responsive */
@media (max-width: 640px) {
  .corte-panel-header { padding: 1rem; }
  .corte-panel-body   { padding: 1rem; }
  #corte-tabla-container { font-size: .78rem; }
}

/* ---------------------------------------------------------------
   PUBLICIDAD — Etiquetas y slots reales AdSense
--------------------------------------------------------------- */
.ad-label-small {
  font-size: .6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: center;
  margin-bottom: .25rem;
}
.ad-label-bar {
  font-size: .62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: center;
  padding: .15rem 0 .2rem;
}
.ad-slot-mid-form {
  border-radius: var(--radius);
  overflow: hidden;
}
.ad-slot-footer-leaderboard {
  padding: .5rem 1.5rem;
}

/* ---------------------------------------------------------------
   PÁGINAS DE TEXTO (legales, contacto, guías)
   Antes repetido en línea en cada página.
--------------------------------------------------------------- */
.legal-content { max-width: 820px; }
.legal-content--ancho { max-width: 900px; }
.legal-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.5rem 1.75rem; margin-bottom: 1rem; }
.legal-section h2 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: .875rem; display: flex; align-items: center; gap: .6rem; }
.legal-section h2 i { color: var(--brand); font-size: .9rem; }
.legal-section h3 { font-size: .9rem; font-weight: 700; color: var(--text-primary); margin: 1rem 0 .5rem; }
.legal-section p { font-size: .875rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: .65rem; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul, .legal-section ol { padding-left: 1.25rem; margin: .25rem 0 .65rem; }
.legal-section li { font-size: .875rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: .25rem; }
.legal-section a:not(.official-link-card):not(.email-channel):not(.btn) { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: .15em; }
.legal-badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--brand-light); color: var(--brand); border: 1px solid #C7D2FE; border-radius: 99px; padding: .3rem .85rem; font-size: .75rem; font-weight: 600; margin-bottom: 1.25rem; }
.legal-fecha { font-size: .78rem; color: var(--text-muted); margin: -.5rem 0 1.25rem; }
.highlight-box { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; font-size: .875rem; color: #92400E; line-height: 1.65; }
.alert-box { background: #FEF2F2; border: 1px solid #FECACA; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; font-size: .875rem; color: #991B1B; line-height: 1.65; }
.official-links { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
.official-link-card { display: flex; align-items: center; gap: .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; color: var(--text-primary); transition: .2s; font-size: .85rem; font-weight: 500; }
.official-link-card:hover { background: var(--brand-light); border-color: #C7D2FE; color: var(--brand); }
.official-link-card i { color: var(--brand); font-size: 1rem; flex-shrink: 0; }
.tabla-legal { width: 100%; border-collapse: collapse; font-size: .82rem; margin: .5rem 0 .75rem; }
.tabla-legal th, .tabla-legal td { text-align: left; vertical-align: top; padding: .55rem .65rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.tabla-legal th { background: var(--brand-light); color: var(--brand); font-weight: 700; font-size: .75rem; }
.tabla-scroll { overflow-x: auto; }
@media (max-width: 640px) { .official-links { grid-template-columns: 1fr; } .legal-section { padding: 1.25rem; } }

/* Preguntas frecuentes */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { cursor: pointer; font-size: .9rem; font-weight: 700; color: var(--text-primary); padding: .85rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand); font-weight: 800; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item > p, .faq-item > ul { padding-bottom: .5rem; }

/* Contacto */
.contact-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.contact-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 860px) { .contact-layout, .contact-fila { grid-template-columns: 1fr; } }
.email-channel { display: flex; align-items: center; gap: .875rem; padding: 1.1rem 1.25rem; background: var(--brand-light); border: 1.5px solid #C7D2FE; border-radius: var(--radius); color: var(--text-primary); transition: background .18s, border-color .18s; margin-top: .5rem; }
.email-channel:hover { background: #E0E7FF; border-color: #A5B4FC; }
.email-icon { width: 40px; height: 40px; flex-shrink: 0; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .95rem; color: #fff; }
.email-label { font-size: .7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .15rem; }
.email-value { font-size: .9rem; font-weight: 700; color: var(--brand); }
.form-success { text-align: center; padding: 2.5rem 1.5rem; }
.form-success:focus { outline: none; }
.form-success-icon { width: 60px; height: 60px; background: linear-gradient(135deg, #10B981, #059669); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; margin: 0 auto 1.25rem; }
.form-success-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin-bottom: .5rem; }
.form-success-sub { font-size: .875rem; color: var(--text-secondary); line-height: 1.7; }
.form-estado { font-size: .8rem; color: var(--text-secondary); margin-top: .75rem; min-height: 1.2em; }
.form-estado--error { color: #B91C1C; font-weight: 600; }
.form-nota { font-size: .75rem; color: var(--text-muted); margin-top: .875rem; line-height: 1.5; }
.form-nota a { color: var(--brand); text-decoration: underline; }
.tag-chip { display: inline-block; background: var(--brand-light); color: var(--brand); padding: .25rem .7rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.tag-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.field textarea { width: 100%; padding: .75rem 1rem; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; color: var(--text-primary); resize: vertical; transition: border-color .2s, box-shadow .2s; line-height: 1.5; }
.field textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(12,12,175,0.1); }
.oculto-bot { position: absolute; left: -9999px; }

/* ---------------------------------------------------------------
   ACORDEÓN DE FACTORES — contenido
--------------------------------------------------------------- */
.factor-card-header { width: 100%; text-align: left; color: inherit; }
.fac-fuente { font-size: .78rem; color: var(--text-muted); margin-bottom: .75rem; padding: .5rem .75rem; background: #F8FAFC; border-radius: 6px; }
.fac-row { display: flex; justify-content: space-between; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid #F1F5F9; gap: .75rem; }
.fac-row-label { font-size: .85rem; color: #374151; }
.fac-row-note { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.fac-row-pts { font-weight: 700; color: var(--brand); white-space: nowrap; font-size: .85rem; }
.fac-formula { text-align: center; margin-bottom: 1rem; padding: .75rem; background: linear-gradient(135deg, #EFF6FF, #DBEAFE); border-radius: .5rem; }
.fac-formula-label { font-size: .75rem; color: #1D4ED8; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.fac-formula-value { font-size: 1.05rem; font-weight: 800; color: #1E40AF; }
.fac-barra { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; background: #F8FAFC; border-radius: .5rem; margin-bottom: .4rem; border: 1px solid #E2E8F0; }
.fac-barra-rango { width: 8rem; flex-shrink: 0; font-size: .8rem; font-weight: 600; color: #374151; }
.fac-barra-track { flex: 1; height: 8px; background: #E5E7EB; border-radius: 99px; overflow: hidden; }
.fac-barra-track div { height: 100%; border-radius: 99px; }
.fac-barra-pts { width: 4rem; text-align: right; font-weight: 800; font-size: .875rem; }
.fac-destacado { background: linear-gradient(to right, #F0FDF4, #DCFCE7); border-radius: .5rem; padding: .875rem 1rem; margin-bottom: .5rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.fac-destacado-titulo { font-weight: 600; color: #166534; font-size: .875rem; }
.fac-destacado-sub { font-size: .75rem; color: #15803D; margin-top: .1rem; }
.fac-destacado-pts { font-weight: 800; color: #15803D; font-size: 1rem; white-space: nowrap; }
.fac-destacado--naranjo { background: linear-gradient(135deg, #FFF7ED, #FFEDD5); }
.fac-destacado--naranjo .fac-destacado-titulo { color: #92400E; }
.fac-destacado--naranjo .fac-destacado-sub,
.fac-destacado--naranjo .fac-destacado-pts { color: #B45309; }
.fac-subtitulo { font-weight: 600; color: #374151; font-size: .875rem; margin: .75rem 0 .5rem; }
.fac-texto { font-size: .8rem; color: var(--text-secondary); margin-bottom: .5rem; line-height: 1.6; }
.fac-banda { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem .75rem; background: #F0FDF4; border-radius: .5rem; margin-bottom: .3rem; font-size: .85rem; color: #374151; }
.fac-banda strong { color: #15803D; white-space: nowrap; }
.fac-banda--alt { background: #DCFCE7; }
.fac-banda--naranjo { background: #FFF7ED; }
.fac-banda--naranjo.fac-banda--alt { background: #FFEDD5; }
.fac-banda--naranjo strong { color: #B45309; }

/* ---------------------------------------------------------------
   PLANIFICADOR — condiciones de permanencia
--------------------------------------------------------------- */
.perm-row { display: grid; grid-template-columns: 9rem 1fr auto; gap: .75rem; align-items: center; padding: .65rem .875rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .4rem; background: var(--surface-2); font-size: .82rem; }
.perm-row--ok { background: #F0FDF4; border-color: #A7F3D0; }
.perm-row-sem { font-weight: 700; color: var(--text-primary); }
.perm-row-cond { color: var(--text-secondary); }
.perm-row-pts { font-weight: 800; color: var(--text-muted); white-space: nowrap; }
.perm-row--ok .perm-row-pts { color: #059669; }
.plan-ahorro-total { margin-top: .625rem; text-align: right; font-size: .875rem; font-weight: 700; color: var(--brand); }
@media (max-width: 640px) { .perm-row { grid-template-columns: 1fr auto; } .perm-row-cond { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------
   TABLA DE PUNTAJES DE CORTE
--------------------------------------------------------------- */
.corte-tabla-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
.corte-tabla { width: 100%; border-collapse: collapse; font-size: .84rem; }
.corte-tabla thead th { background: linear-gradient(to right, var(--brand), #3B3BDB); text-align: left; padding: .75rem 1rem; font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.92); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.corte-tabla th.num, .corte-tabla td.num { text-align: center; }
.corte-th-sub { display: block; font-weight: 400; font-size: .68rem; text-transform: none; letter-spacing: 0; opacity: .85; }
.corte-tabla tbody th, .corte-tabla tbody td { padding: .625rem 1rem; border-bottom: 1px solid var(--border); }
.corte-tabla tbody th[scope="row"] { text-align: left; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.corte-row { background: var(--surface); transition: background .15s; }
.corte-row:hover { background: var(--brand-light); }
.corte-region-num { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.corte-valor { display: inline-block; font-weight: 800; color: var(--brand); font-size: .9rem; font-variant-numeric: tabular-nums; }
.corte-sub { display: block; font-size: .65rem; color: var(--text-muted); margin-top: .05rem; }
.corte-vacio { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 20px; padding: 0 .3rem; background: var(--surface-2); border-radius: 4px; font-size: .72rem; color: var(--text-muted); }
.corte-zona th { padding: .35rem 1rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; text-align: left; border-bottom: 1px solid var(--border); }
.corte-zona--norte th { background: #EFF6FF; color: #1D4ED8; }
.corte-zona--centro th { background: #F0FDF4; color: #15803D; }
.corte-zona--sur th { background: #FFF7ED; color: #C2410C; }
.corte-nota-row td { font-size: .72rem; color: #92400E; background: #FFFBEB; padding: .35rem 1rem; border-bottom: 1px solid var(--border); }
.corte-pct { font-size: .8rem; color: var(--text-secondary); margin-top: .75rem; }
.info-box a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Pie de página y barra lateral */
.app-footer-btn { font-size: .7rem; color: var(--text-muted); padding: 0; transition: color .2s; }
.legal-section .app-footer-btn { font-size: inherit; color: var(--brand); font-weight: 600; text-decoration: underline; }
.app-footer-btn:hover { color: var(--brand); }
.sidebar-nav-group-label--static { display: block; padding: 0 .5rem; margin-bottom: .4rem; }
.uf-shimmer { display: inline-block; width: 4rem; height: .85rem; border-radius: 4px; background: rgba(255,255,255,.18); animation: uf-pulso 1.2s ease-in-out infinite; vertical-align: middle; }
@keyframes uf-pulso { 50% { opacity: .45; } }
.detalle-factor--nota { border-color: #FEF3C7; background: #FFFBEB; }
.detalle-factor--nota .factor-header { background: #FFFBEB; }
.legal-section > .official-link-card { margin-bottom: .5rem; }
.legal-section > .official-link-card:last-child { margin-bottom: 0; }
