/* Super Link Brand — Calculadora Corporativos */
:root {
  --brand:    #E2231A;
  --brand-dk: #B81B14;
  --navy:     #1B2A47;
  --navy-dk:  #0F1A2E;
  --green:    #18a558;
  --red:      #d32f2f;
  --orange:   #e65100;
  --bg:       #F5F5F5;
  --card:     #FFFFFF;
  --border:   #E1E1E1;
  --text:     #1E1E1E;
  --muted:    #6b7280;
}

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

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ----- Header ----- */
header {
  background: var(--navy);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 12px #00000040;
}
header .brand-logo  { height: 42px; flex-shrink: 0; border-radius: 4px; }
header .brand-text  { display: flex; flex-direction: column; flex: 1; }
header .logo        { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
header .logo span   { color: var(--brand); }
header .subtitle    {
  font-size: 0.74rem; opacity: 0.85; margin-top: 4px;
  letter-spacing: 0.4px; text-transform: uppercase; font-weight: 500;
}
header .nav-links   { display: flex; gap: 16px; }
header .nav-links a {
  color: #fff; text-decoration: none; font-size: 0.85rem; font-weight: 500;
  padding: 8px 14px; border-radius: 6px; transition: background 0.2s;
}
header .nav-links a:hover  { background: rgba(255,255,255,0.1); }
header .nav-links a.active { background: var(--brand); }

/* ----- Layout ----- */
.app {
  display: grid;
  grid-template-columns: 400px 1fr;
  height: calc(100vh - 66px);
}
.panel {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
}
.panel h2 {
  font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ----- Form ----- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}
.form-group select,
.form-group input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 0.95rem;
  background: #fff; outline: none; transition: border-color 0.15s;
}
.form-group select:focus,
.form-group input:focus { border-color: var(--brand); }

.modo-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modo-toggle-3 { grid-template-columns: 1fr 1fr 1fr; }
.modo-toggle-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.modo-toggle-3 .modo-card,
.modo-toggle-4 .modo-card { padding: 8px 6px; text-align: center; }
.modo-toggle-3 .modo-card .modo-title,
.modo-toggle-4 .modo-card .modo-title { font-size: 0.78rem; }
.modo-opt { position: relative; cursor: pointer; }
.modo-opt input { position: absolute; opacity: 0; pointer-events: none; }
.modo-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  transition: all 0.15s;
}
.modo-opt input:checked + .modo-card {
  border-color: var(--brand);
  background: #FEF2F2;
  box-shadow: 0 2px 8px rgba(226,35,26,0.18);
}
.modo-card .modo-title { font-weight: 700; font-size: 0.95rem; color: var(--navy); margin-bottom: 3px; }
.modo-card .modo-sub   { font-size: 0.7rem; color: var(--muted); line-height: 1.3; }

.geo-row { display: flex; gap: 6px; }
.geo-row input { flex: 1; }
.btn-primary {
  background: var(--brand); color: #fff; border: none;
  padding: 0 14px; border-radius: 8px; font-family: inherit; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: var(--brand-dk); }
.btn-primary i { pointer-events: none; }

.btn-secondary {
  background: #25D366; color: #fff; border: none;
  padding: 11px 16px; border-radius: 8px; font-family: inherit; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-secondary:hover { background: #1ea952; }
.btn-contrato {
  background: var(--navy); color: #fff; border: none;
  padding: 11px 16px; border-radius: 8px; font-family: inherit; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-contrato:hover { background: var(--navy-dk); }
.btn-block { width: 100%; padding: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.action-row { display: grid; gap: 8px; margin-top: 14px; }

.extra-section {
  margin-top: 12px;
  padding: 10px 12px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.extra-section summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 4px 0;
}
.extra-section[open] summary { color: var(--navy); margin-bottom: 8px; }
.extra-section .form-group { margin-bottom: 10px; }

.nrc-row {
  display: grid;
  grid-template-columns: 22px 1fr 70px 80px;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.85rem;
}
.nrc-row:last-child { border-bottom: none; }
.nrc-row input[type="checkbox"] { margin: 0; }
.nrc-row .nrc-label { font-weight: 600; color: var(--navy); }
.nrc-row .nrc-qty { padding: 4px 6px; font-size: 0.8rem; }
.nrc-row .nrc-precio { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.78rem; }

/* ----- Pills ----- */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
}
.pill-internexa { background: #DBEAFE; color: #1E40AF; }
.pill-ufinet    { background: #FEF3C7; color: #92400E; }
.pill-iponly    { background: #DCFCE7; color: #166534; }
.pill-guajiranet{ background: #F3E8FF; color: #6B21A8; }
.pill-cirion    { background: #E2E8F0; color: #334155; }
.pill-no        { background: #FEE2E2; color: #991B1B; }

/* ----- Resultado ----- */
.result {
  margin-top: 8px;
  padding: 18px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dk) 100%);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(27,42,71,0.18);
}
.result.no-venta {
  background: linear-gradient(135deg, #991B1B 0%, #7F1D1D 100%);
}
.result.modo-compartido {
  background: linear-gradient(135deg, #1E40AF 0%, #1E3A8A 100%);
}
.result.modo-transporte {
  background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
}
.result .modo-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.result .modo-compare {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 0.78rem;
  opacity: 0.92;
  text-align: center;
}
.result .label  { font-size: 0.72rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.result .value  { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.result .sub    { font-size: 0.78rem; opacity: 0.78; margin-top: 6px; }
.result-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.result-row .mini       { background: rgba(255,255,255,0.08); padding: 10px 12px; border-radius: 8px; }
.result-row .mini .label{ font-size: 0.65rem; opacity: 0.75; }
.result-row .mini .value{ font-size: 0.95rem; font-weight: 700; }

/* ----- Detalle ----- */
.detail-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 0.85rem; }
.detail-table th,
.detail-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.detail-table th {
  background: #F9FAFB; font-weight: 600; color: var(--muted);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px;
}
.detail-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.info-card {
  background: #F9FAFB; padding: 12px 14px; border-radius: 8px;
  border-left: 3px solid var(--brand); margin-bottom: 14px;
  font-size: 0.85rem; line-height: 1.5;
}
.info-card strong { color: var(--navy); }

/* ----- Semáforo de margen ----- */
.semaforo {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.semaforo-tag { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.4px; margin-bottom: 4px; opacity: 0.95; }
.semaforo-msg { font-size: 0.85rem; font-weight: 500; line-height: 1.35; }

/* ----- KPIs ----- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi {
  background: #F9FAFB; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; text-align: center;
}
.kpi-num { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.kpi-lbl { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* ----- Mapa ----- */
#map { height: 100%; width: 100%; }
.legend {
  background: #fff; padding: 10px 14px; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 0.8rem; line-height: 1.7;
}
.legend .dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .app    { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
  .panel  { border-right: none; border-bottom: 1px solid var(--border); }
  #map    { height: 60vh; }
}
