/* ============================================
   CONFIGURACIÓN – LAYOUT Y COMPONENTES
   Usa la paleta global de estilosIndex.css
   (azul petróleo, cian, blanco, etc.)
============================================ */

/* Extendemos variables sin pisar las del Index */
:root {
  --naranja-calido: #f08f3e;
  --gris-fondo-config: #f3f6fb;
}

/* ============================
   PAGE WRAPPER
============================ */

.config-page {
  min-height: 100vh;
  padding: 6.5rem 0 3.5rem; /* compensar header fijo */
  background: radial-gradient(
      circle at 10% 0%,
      rgba(52, 215, 196, 0.12) 0,
      transparent 55%
    ),
    radial-gradient(
      circle at 90% 100%,
      rgba(30, 58, 74, 0.14) 0,
      transparent 55%
    ),
    var(--gris-fondo-config);
}

.config-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.config-hero {
  margin-bottom: 1.5rem;
}

.config-subtitle {
  max-width: 640px;
  margin: 0.75rem auto 0;
  font-size: 0.95rem;
  color: var(--gris-claro);
}

/* ============================
   LAYOUT PRINCIPAL
============================ */

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 2rem;
  align-items: flex-start;
  margin-top: 2.5rem;
}

@media (max-width: 960px) {
  .config-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================
   SIDEBAR PERFIL + MENÚ
============================ */

.config-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6.5rem;
}

@media (max-width: 960px) {
  .config-sidebar {
    position: static;
  }
}

/* Tarjeta de perfil */
.profile-card {
  background: var(--blanco);
  border-radius: var(--radius-card);
  padding: 1.7rem 1.4rem 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.35);
  text-align: center;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  border: 3px solid var(--cian);
  padding: 4px;
  background: radial-gradient(circle at 30% 0%, #e0fffa 0, #ffffff 60%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-family: "Poppins", sans-serif;
  font-size: 1.25rem;
  margin: 0.35rem 0 0.1rem;
  color: var(--azul-petroleo);
}

.profile-email {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gris-claro);
}

.profile-role {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: var(--cian-claro);
  color: var(--azul-petroleo);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--gris-claro);
}

.profile-status .status-indicator {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.profile-meta {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.7);
  font-size: 0.86rem;
  color: var(--gris-claro);
}

.profile-meta p {
  margin: 0.1rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.profile-meta i {
  font-size: 0.85rem;
  color: var(--cian);
}

/* ============================
   MENÚ LATERAL
============================ */

.config-menu {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-card);
  padding: 1.2rem 1rem 1.3rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.config-menu h3 {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--azul-petroleo);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.config-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.config-menu-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--gris-claro);
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.config-menu-link i {
  font-size: 0.95rem;
}

.config-menu-link:hover {
  background: rgba(52, 215, 196, 0.12);
  color: var(--azul-petroleo);
  transform: translateX(2px);
}

.config-menu-link.active {
  background: var(--cian);
  color: var(--azul-petroleo);
  font-weight: 600;
}

/* ============================
   CONTENIDO PRINCIPAL
============================ */

.config-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Cada bloque de sección va en tarjeta */
.config-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-card);
  padding: 1.7rem 1.5rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.config-section + .config-section {
  margin-top: 0.25rem;
}

.config-section h2 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  color: var(--azul-petroleo);
}

.section-description {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--gris-claro);
}

/* Header de cada sección con acciones */
.config-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.config-section-header h2 {
  margin-bottom: 0.2rem;
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .config-section {
    padding: 1.4rem 1.1rem;
  }

  .config-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .config-actions {
    width: 100%;
  }
}

/* ============================
   BOTONES
============================ */

.btn-small {
  padding: 0.5rem 1.3rem;
  font-size: 0.8rem;
  border-radius: 999px;
}

/* Extra para botones secundarios grises */
.btn.secondary {
  background: #e5e7eb;
  color: #111827;
  border-color: transparent;
}

.btn.secondary:hover {
  background: #d1d5db;
}

/* ============================
   FORMULARIOS
============================ */

.config-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem 1.6rem;
  margin-top: 1rem;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.config-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gris-claro);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.config-field input,
.config-field select,
.config-field textarea {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.8);
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: rgba(255, 255, 255, 0.96);
  color: var(--texto);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    background 0.16s ease;
}

.config-field textarea {
  resize: vertical;
  min-height: 90px;
}

.config-field input:focus,
.config-field select:focus,
.config-field textarea:focus {
  border-color: var(--cian);
  box-shadow: 0 0 0 1px rgba(52, 215, 196, 0.3);
}

.config-field input[disabled],
.config-field select[disabled],
.config-field textarea[disabled] {
  background: #f1f5f9;
  color: var(--gris-claro);
  cursor: not-allowed;
}

/* Mensajitos debajo de los formularios */
.helper-text {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--gris-claro);
}

/* ============================
   TARJETAS DE RESUMEN
============================ */

.config-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.config-info-card {
  background: #f9fafb;
  border-radius: 1rem;
  padding: 1rem 1rem 0.9rem;
  border: 1px dashed rgba(148, 163, 184, 0.7);
}

.config-info-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--azul-petroleo);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.config-info-card h3 i {
  color: var(--cian);
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--gris-claro);
}

.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.15rem 0;
}

/* ============================
   LISTAS (CITAS, NOTIFICACIONES)
============================ */

.config-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.config-list-item {
  background: #f9fafb;
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.config-list-item h3 {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  color: var(--azul-petroleo);
}

.config-list-item p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--gris-claro);
}

/* Badges de estado */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-on {
  background: rgba(52, 215, 196, 0.15);
  color: var(--azul-petroleo);
}

.badge-off {
  background: rgba(148, 163, 184, 0.18);
  color: #4b5563;
}
/* ============================
   LISTA DE MASCOTAS
============================ */

.pet-list {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Tarjeta individual de mascota */
.pet-card {
  background: #f9fafb;
  border-radius: 1rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* Avatar redondo pequeño (lista compacta) */
.pet-avatar,
.pet-card-avatar {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0%, #e0fffa 0, #ffffff 60%);
  border: 2px solid rgba(52, 215, 196, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pet-avatar img,
.pet-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ⛔️ FIX PERICO GIGANTE:
   cualquier imagen dentro de la lista o del cuerpo de la card
   se recorta y limita de altura */
.pet-list > img,
.pet-card-body img {
  display: block;
  width: 100%;
  max-height: 260px;
  border-radius: 1rem;
  object-fit: cover;
}

/* Contenido de la tarjeta */
.pet-main,
.pet-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pet-name {
  font-weight: 600;
  color: var(--azul-petroleo);
  font-size: 0.95rem;
}

.pet-meta {
  font-size: 0.82rem;
  color: var(--gris-claro);
}

.pet-actions,
.pet-card-actions {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.pet-card-actions .btn {
  font-size: 0.8rem;
  padding-inline: 14px;
}

/* Responsive: en pantallas chicas la card se hace columna */
@media (max-width: 480px) {
  .pet-card {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================
   MODALES (Mascotas, Citas, Avatar, Expediente)
============================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--blanco);
  border-radius: 1.4rem;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.5);
  overflow: hidden;
}

.modal-header {
  padding: 0.95rem 1.3rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: linear-gradient(
    135deg,
    rgba(30, 58, 74, 0.96),
    rgba(52, 215, 196, 0.96)
  );
  color: var(--blanco);
}

.modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-family: "Poppins", sans-serif;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--blanco);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1rem 1.3rem;
}

.modal-footer {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.85rem 1.3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Modal avatar ajustes extra */
#modal-avatar .modal {
  max-width: 420px;
}

#avatar-preview {
  background: #f1f5f9;
}

/* ============================
   EXPEDIENTE (detalle)
============================ */

.expediente-body {
  padding: 1rem 1.3rem 1.2rem;
  max-height: 70vh;
  overflow-y: auto;
  background: #f9fafb;
}

.expediente-resumen {
  margin-bottom: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.9rem;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.88rem;
  color: var(--gris-claro);
}

.expediente-subtitle {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--azul-petroleo);
  margin-bottom: 0.3rem;
}

.expediente-timeline {
  margin-top: 0.5rem;
  border-left: 2px solid rgba(148, 163, 184, 0.8);
  padding-left: 0.9rem;
}

.expediente-item {
  position: relative;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
}

.expediente-item::before {
  content: "";
  position: absolute;
  left: -0.99rem;
  top: 0.15rem;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--cian);
  box-shadow: 0 0 0 4px rgba(52, 215, 196, 0.25);
}

.expediente-item-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--azul-petroleo);
  font-weight: 600;
}

.expediente-item-meta {
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: var(--gris-claro);
}

.expediente-item-texto {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: #111827;
}

.expediente-item-riesgo {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.expediente-item-riesgo--alto {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.expediente-item-riesgo--medio {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.expediente-item-riesgo--bajo {
  background: rgba(52, 211, 153, 0.12);
  color: #047857;
}

/* ============================
   RESPONSIVE AJUSTES EXTRA
============================ */

@media (max-width: 480px) {
  .config-page {
    padding-top: 5.8rem;
  }

  .config-page .container {
    padding: 0 0.9rem;
  }

  .config-section {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  }

  .pet-card {
    grid-template-columns: minmax(0, 1fr);
  }
}
