:root {
  --verde: #198754;
  --verde-claro: #27c38b;
  --azul: #004080;
  --fondo: #f3f5f7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  background: var(--fondo);
  color: #333;
}

/* Layout general */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* ==== SIDEBAR IZQUIERDA ==== */
.portal-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #dde3ea;
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
}

.portal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 14px 6px;
  border-bottom: 1px solid #e4e8ef;
  margin-bottom: 8px;
}

.portal-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white; /* fondo blanco */
  border: 2px solid var(--verde); /* 🔥 borde verde success */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--verde); /* opcional: letra/icono en verde */
  font-size: 22px;
  font-weight: bold;
  flex-shrink: 0;
}

.portal-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.portal-logo-text span:first-child {
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  text-transform: uppercase;
}

.portal-logo-text span:last-child {
  font-size: 12px;
  color: #777;
}

.portal-user {
  margin: 10px 4px 6px 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f5faf7;
  border: 1px solid #d6efe1;
  font-size: 13px;
}

.portal-user strong {
  color: var(--verde);
}

.portal-menu-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #99a3b5;
  margin: 10px 6px 4px 6px;
}

.portal-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  flex-grow: 1;
}

.portal-menu-item {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #495057;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.portal-menu-item i {
  font-size: 18px;
  color: var(--verde);
  flex-shrink: 0;
}

.portal-menu-item span {
  flex-grow: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.portal-menu-item:hover {
  background: #ecf9f2;
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.portal-menu-item.active {
  background: linear-gradient(135deg, var(--verde), var(--verde-claro));
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

.portal-menu-item.active i {
  color: #ffffff;
}

.portal-sidebar-footer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e4e8ef;
  font-size: 11px;
  color: #99a3b5;
  text-align: center;

  /* 🔹 Para ordenar bien el botón + texto */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portal-home-btn {
  background: linear-gradient(135deg, var(--verde), var(--verde-claro));
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.portal-home-btn i {
  font-size: 16px;
}
.portal-home-btn:hover {
  background: var(--verde);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.portal-sidebar-footer-text {
  opacity: 0.85;
}

/* ==== CONTENIDO DERECHA ==== */
.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  gap: 14px;
}

.portal-main-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-main-header h1 {
  font-size: 22px;
  color: var(--azul);
}

.portal-main-header p {
  font-size: 13px;
  color: #6c757d;
}

.portal-main-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 18px 20px 18px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.04);
  min-height: 240px;
}

.portal-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--verde);
  margin-bottom: 6px;
}

.portal-section-subtitle {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 16px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card-mini {
  border-radius: 12px;
  padding: 12px 12px 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.card-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.card-mini-title {
  font-weight: 600;
  color: var(--azul);
  font-size: 13px;
}

.card-mini-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(25, 135, 84, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--verde);
  font-size: 16px;
  flex-shrink: 0;
}

.card-mini-body {
  color: #495057;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #e8f5e9;
  color: #256d3a;
  font-weight: 500;
}

.pill i {
  font-size: 13px;
}

.list-simple {
  margin-top: 6px;
  padding-left: 18px;
  font-size: 12px;
  color: #555;
}

.list-simple li + li {
  margin-top: 2px;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 900px) {
  .portal-layout {
    flex-direction: column;
  }

  .portal-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid #dde3ea;
    overflow-x: auto;
  }

  .portal-logo {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-right: 10px;
    border-right: 1px solid #e4e8ef;
  }

  .portal-user,
  .portal-menu-title,
  .portal-sidebar-footer {
    display: none;
  }

  .portal-menu {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    flex-grow: 1;
  }

  .portal-menu-item {
    justify-content: center;
    padding: 6px 10px;
  }

  .portal-menu-item span {
    display: none;
    /* solo ícono en móvil */
  }

  .portal-main {
    padding: 12px 12px 18px 12px;
  }

  .portal-main-header h1 {
    font-size: 18px;
  }
}
/* Por defecto, ocultamos este botón en escritorio */
.portal-menu-item-home-mobile {
  display: none;
}

/* En móvil lo mostramos como un ítem más al final de la tira de iconos */
@media (max-width: 900px) {
  .portal-menu-item-home-mobile {
    display: flex;
  }
}
/* ====== CUMPLEAÑOS (CALENDARIO) ====== */

.cumple-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cumple-toolbar-left,
.cumple-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cumple-toolbar-title {
  flex: 1;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--verde);
}

.cumple-mes-anio {
  font-weight: 600;
  color: #6c757d;
  font-size: 0.9rem;
}

.cumple-btn-nav {
  border: 1px solid #ccc;
  background: #fff;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.cumple-btn-nav:hover {
  background: #f5f5f5;
}

.cumple-select {
  font-size: 0.8rem;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid #ced4da;
  background: #fff;
}

.cumple-btn-hoy {
  border-radius: 999px;
  border: 1px solid var(--verde);
  background: #fff;
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--verde);
  font-weight: 500;
}

.cumple-btn-hoy:hover {
  background: #e8f5e9;
}

/* Calendario */
.cumple-cal-wrap {
  border: 1px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
}

/* En escritorio: 7 columnas fijas */
.cumple-cal-head,
.cumple-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cumple-cal-head {
  background: var(--azul);
  color: #fff;
  padding: 6px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.cumple-cal-grid {
  gap: 1px;
  background: #dde3ea;
}

.cumple-cal-cell {
  min-height: 96px;
  background: #fff;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
}

.cumple-cal-cell .day {
  font-weight: 600;
  color: #555;
  font-size: 0.8rem;
}

/* Día de hoy bien resaltado */
.cumple-cal-cell.today {
  outline: 2px solid var(--verde);
  background: #fff8c6; /* amarillo suave */
}

/* Chips */
.cumple-cal-cell .chip {
  background: #f1f8f4;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip-nombre {
  font-weight: 600;
  color: var(--azul);
}

.chip-empresa {
  font-size: 0.7rem;
  color: #555;
}

.cumple-cal-cell .more {
  font-size: 0.75rem;
  color: var(--azul);
  cursor: pointer;
  text-decoration: underline;
}

/* Modal cumpleaños */
.cumple-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.cumple-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 700px;
  width: 95%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.cumple-modal-header {
  background: var(--verde);
  color: #fff;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
}

.cumple-modal-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.cumple-modal-body {
  padding: 8px 10px 10px 10px;
  font-size: 0.8rem;
  color: #333;
  overflow: auto;
}

.cumple-modal-footer {
  padding: 8px 10px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
}

/* Tabla del modal */
.cumple-tabla-wrapper {
  max-height: 55vh;
  overflow: auto;
}

.cumple-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.cumple-tabla thead th {
  position: sticky;
  top: 0;
  background: var(--azul);
  color: #fff;
  padding: 6px 4px;
  text-align: left;
}

.cumple-tabla tbody td {
  border-bottom: 1px solid #e9ecef;
  padding: 4px 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .cumple-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .cumple-toolbar-left,
  .cumple-toolbar-right {
    justify-content: space-between;
  }

  .cumple-toolbar-title {
    text-align: left;
    margin-bottom: 4px;
  }

  /* 🎯 En móvil permitimos scroll horizontal para que las 7 columnas no se achiquen demasiado */
  .cumple-cal-wrap {
    overflow-x: auto;
  }

  .cumple-cal-head,
  .cumple-cal-grid {
    min-width: 520px; /* ancho mínimo para que quepa el calendario con 7 columnas */
  }

  .cumple-cal-cell {
    min-height: 80px;
  }

  .cumple-modal {
    width: 98%;
    max-height: 90vh;
  }
}

.logo-mini {
  width: 80%; /* tamaño dentro del círculo */
  height: 80%;
  object-fit: contain; /* muestra TODA la imagen sin recortar */
  border-radius: 50%; /* hace que se vea redondo */
}

/* ====== SECCIÓN BENEFICIOS (BBVA) ====== */

.beneficios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card-beneficio {
  background: #ffffff;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 64, 128, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-beneficio-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-beneficio-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #004080, #198754);
  color: #fff;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.card-beneficio-title {
  font-weight: 600;
  color: #004080;
  font-size: 0.98rem;
}

.card-beneficio-tag {
  font-size: 0.78rem;
  color: #666;
}

.card-beneficio-body h4 {
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0.5rem 0 0.25rem 0;
  color: #198754;
}

.beneficios-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.25rem 0;
}

.beneficios-list li {
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.beneficios-list li strong {
  color: #333;
}

/* Ajustes responsive suaves */
@media (max-width: 768px) {
  .card-beneficio {
    padding: 0.85rem 0.9rem;
  }

  .card-beneficio-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .card-beneficio-title {
    font-size: 0.92rem;
  }
}

/* ====== SECCIÓN SEGUROS (ESSALUD / EPS) ====== */

.seguros-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.9rem 0;
}

.seguros-tab-btn {
  border-radius: 999px;
  border: 1px solid #d0d7e2;
  background: #f5f7fb;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.08s ease;
}

.seguros-tab-btn i {
  font-size: 0.9rem;
}

.seguros-tab-btn:hover {
  transform: translateY(-1px);
}

.seguros-tab-btn.active {
  background: #004080;
  color: #fff;
  border-color: #004080;
}

.seguros-panels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.seguros-panel {
  display: none;
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(0, 64, 128, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.seguros-panel.active {
  display: block;
}

.seguros-panel h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #004080;
}

.seguros-panel h4 {
  font-size: 0.9rem;
  margin: 0.6rem 0 0.25rem 0;
  color: #198754;
}

.seguros-panel p {
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.seguros-list {
  list-style: disc;
  padding-left: 1.1rem;
  margin: 0 0 0.4rem 0;
}

.seguros-list li {
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.seguros-note {
  font-size: 0.78rem;
  color: #666;
  font-style: italic;
}

/* Responsive suave */
@media (max-width: 768px) {
  .seguros-panel {
    padding: 0.9rem;
  }

  .seguros-tab-btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.8rem;
  }
}

/* ===== AUMENTAR TAMAÑO DEL CONTENIDO EPS RIMAC ===== */

#panel-eps {
  font-size: 1.3rem; /* antes era ~0.82rem → sube casi dos niveles */
}

#panel-eps h3 {
  font-size: 1.15rem !important;
}

#panel-eps h4 {
  font-size: 1.05rem !important;
}

#panel-eps p,
#panel-eps li,
#panel-eps .seguros-note {
  font-size: 0.95rem !important;
  line-height: 1.45;
}

/* ===== Prestaciones ESSALUD ===== */

.prestaciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
  margin: 0.7rem 0 1rem 0;
}

.prest-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.9rem;
  border: 1px solid rgba(0, 64, 128, 0.06);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

.prest-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #004080, #198754);
  color: #fff;
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.prest-card h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: #004080;
}

.prest-card p {
  font-size: 0.82rem;
  margin: 0;
}

/* ===== FAQ ESSALUD ===== */

.faq-essalud {
  margin-top: 1rem;
}

.faq-essalud h4 {
  font-size: 0.9rem;
  color: #004080;
  margin-bottom: 0.4rem;
}

.faq-list {
  border-radius: 10px;
  border: 1px solid rgba(0, 64, 128, 0.08);
  background: #f9fbff;
}

.faq-item + .faq-item {
  border-top: 1px solid rgba(0, 64, 128, 0.08);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  cursor: pointer;
}

.faq-question i {
  font-size: 0.9rem;
  transition: transform 0.15s ease;
}

.faq-answer {
  padding: 0 0.9rem 0.6rem 0.9rem;
  font-size: 0.8rem;
  display: none;
}

.faq-answer p,
.faq-answer ul,
.faq-answer ol {
  margin-bottom: 0.3rem;
}

.faq-answer ul,
.faq-answer ol {
  padding-left: 1.1rem;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
}

/* ===== Citas ESSALUD ===== */

.essalud-citas {
  margin-top: 1.1rem;
}

.essalud-citas h4 {
  font-size: 0.9rem;
  color: #004080;
  margin-bottom: 0.4rem;
}

.essalud-steps {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.essalud-step {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #004080;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}

.step-body h5 {
  font-size: 0.86rem;
  margin: 0 0 0.25rem 0;
  color: #198754;
}

.step-body p {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.essalud-directorio ul {
  margin: 0.25rem 0 0 0;
  padding-left: 1.1rem;
}

.essalud-directorio li {
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

/* ===== Tabla de latencia ===== */

.latencia-block {
  margin-top: 1.1rem;
}

.latencia-block h4 {
  font-size: 0.9rem;
  color: #004080;
  margin-bottom: 0.35rem;
}

.latencia-block p {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.latencia-table-wrapper {
  margin-top: 0.4rem;
  overflow-x: auto;
}

.latencia-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 520px;
}

.latencia-table th,
.latencia-table td {
  border: 1px solid #c8d2e3;
  padding: 0.3rem 0.35rem;
  text-align: center;
}

.latencia-table thead th {
  background: #e3edf9;
  color: #004080;
  font-weight: 600;
}

.latencia-table tbody tr:nth-child(even) {
  background: #f7f9fc;
}

/* Responsive suave */
@media (max-width: 768px) {
  .prest-card {
    padding: 0.8rem;
  }

  .essalud-step {
    align-items: flex-start;
  }

  .latencia-table {
    font-size: 0.76rem;
  }
}
