/* OPTIMIZADOR FISCAL 2026 - ESTILOS PREMIUM */
:root {
  --primary: #1E40AF;
  --primary-light: #3B82F6;
  --primary-subtle: #EFF6FF;
  --success: #059669;
  --success-light: #10B981;
  --success-subtle: #ECFDF5;
  --warning: #D97706;
  --warning-subtle: #FFFBEB;
  --danger: #DC2626;
  --danger-subtle: #FEF2F2;
  --bg-main: #0F172A;
  --bg-card: #1E293B;
  --bg-card-hover: #334155;
  --bg-page: #F8FAFC;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --border: #E2E8F0;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}

/* HEADER */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.uit-badge {
  display: flex;
  flex-direction: column;
  background: #F1F5F9;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.uit-badge strong {
  font-size: 0.95rem;
  color: #0F172A;
}

.btn-primary-action {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: #F8FAFC;
  color: var(--text-main);
}

/* LIVE PRESCRIPTION BANNER */
.live-prescription-card {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.presc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.presc-badge {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.presc-rate {
  font-size: 0.9rem;
  color: #94A3B8;
}

.presc-rate strong {
  color: #38BDF8;
  font-size: 1.1rem;
}

.presc-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 900px) {
  .presc-body {
    grid-template-columns: 1fr;
  }
}

.presc-action-title {
  font-size: 0.82rem;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.presc-action-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #34D399;
  margin: 4px 0 6px;
}

.presc-action-desc {
  font-size: 0.88rem;
  color: #CBD5E1;
  line-height: 1.45;
}

.presc-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.presc-kpi-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #94A3B8;
}

.presc-kpi-item strong {
  font-size: 0.95rem;
  color: white;
}

/* NAVIGATION TABS */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: white;
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.tab-btn.active {
  background: #0F172A;
  color: white;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* CARDS GENERAL */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #0F172A;
}

/* PROJECTION SLIDER CARD */
.projection-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F0FDF4 100%);
  border: 2px solid #86EFAC;
  margin-bottom: 24px;
}

.proj-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 900px) {
  .proj-grid {
    grid-template-columns: 1fr;
  }
}

.custom-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #E2E8F0;
  outline: none;
  accent-color: #2563EB;
  margin: 12px 0;
}

.custom-slider.green-slider {
  accent-color: #059669;
}

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

.currency-prefix {
  position: absolute;
  left: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.custom-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 600;
  color: #0F172A;
}

.proj-summary-box {
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid #BBF7D0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.proj-kpi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.proj-kpi-row strong {
  color: #0F172A;
}

.proj-kpi-row.highlight {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #E2E8F0;
  font-size: 1rem;
}

.proj-kpi-row.highlight strong {
  font-size: 1.25rem;
  color: var(--success);
}

/* 3 COLUMNS COMPARATIVE GRID */
.three-columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1100px) {
  .three-columns-grid {
    grid-template-columns: 1fr;
  }
}

.decision-card {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.decision-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.decision-card.optimal-card {
  background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 100%);
  border: 2px solid #10B981;
  box-shadow: 0 16px 32px rgba(16, 185, 129, 0.15);
}

.optimal-badge-top {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #059669;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.col-header {
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.case-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.tag-case1 {
  background: #EFF6FF;
  color: #1D4ED8;
}

.tag-case2 {
  background: #FFF1F2;
  color: #BE123C;
}

.tag-optimal {
  background: #D1FAE5;
  color: #065F46;
}

.col-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.25;
}

.col-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* HERO CASH BOX */
.hero-cash-box {
  background: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1px solid #E2E8F0;
  margin-bottom: 18px;
}

.hero-cash-box.optimal-cash {
  background: #ECFDF5;
  border-color: #A7F3D0;
}

.cash-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.cash-amount {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #0F172A;
  margin: 4px 0;
}

.cash-amount.text-optimal {
  color: #059669;
  font-size: 2.1rem;
}

.cash-tax-rate {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cash-tax-rate strong {
  color: #0F172A;
}

/* TAX FORMULA BUBBLE */
.tax-formula-bubble {
  background: white;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 0.76rem;
  color: #334155;
  text-align: left;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.optimal-card .tax-formula-bubble {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: #065F46;
}

.formula-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.70rem;
  color: var(--primary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.optimal-card .formula-title {
  color: #059669;
}

.formula-math {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.74rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 2px 6px;
  border-radius: 3px;
  display: block;
  margin: 3px 0;
  overflow-x: auto;
  white-space: nowrap;
}

.formula-numbers {
  font-weight: 600;
  color: #0F172A;
}

.optimal-card .formula-numbers {
  color: #065F46;
}

/* METRICS LIST */
.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.84rem;
  margin-bottom: 18px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.metric-item strong {
  color: #0F172A;
}

.metric-item.tax-item strong {
  color: var(--danger);
}

.metric-item.benefit-item strong {
  color: var(--success);
}

.metric-item.highlight-row {
  background: #F1F5F9;
  font-weight: 700;
  border: 1px solid #E2E8F0;
  padding: 6px 8px;
}

.section-divider-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
  background: #F8FAFC;
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 3px solid var(--primary);
  margin-top: 6px;
  margin-bottom: 2px;
}

.metric-divider {
  border-top: 1px dashed #E2E8F0;
  margin: 4px 0;
}

.card-verdict {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: auto;
}

.verdict-bad {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.verdict-optimal {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  font-weight: 600;
}

.verdict-neutral {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* INTERACTIVE SLIDER IN OPTIMAL CARD */
.optimal-rxh-selector {
  background: white;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #A7F3D0;
  margin-bottom: 14px;
}

.optimal-rxh-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: #065F46;
}

/* TABLE STYLES */
.breakdown-table-wrapper {
  overflow-x: auto;
}

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

.breakdown-table th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.breakdown-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: #0F172A;
}

.breakdown-table tr:hover {
  background: #F8FAFC;
}

.table-total-row td {
  background: #F1F5F9;
  font-weight: 700;
  border-top: 2px solid #CBD5E1;
}

/* BADGES */
.badge-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: #E2E8F0;
  color: #334155;
}

.badge-green {
  background: #D1FAE5;
  color: #065F46;
}

.badge-accent {
  background: #EFF6FF;
  color: #1D4ED8;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
}

.badge-status {
  background: #EFF6FF;
  color: #1E40AF;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
}

.btn-chip {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chip:hover, .btn-chip.active {
  background: #0F172A;
  color: white;
  border-color: #0F172A;
}

.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }

.app-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
