/* ==========================================================
   PORTAL CLÍNICO COCO - HOJA DE ESTILOS CENTRALIZADA RESPONSIVA
   Fondo Blanco Puro Unificado (#ffffff)
   ========================================================== */

/* 1. VARIABLES GLOBALES DE DISEÑO */
:root {
  --coco-rosa: #e31d93;
  --coco-naranja: #ff6b00;
  --coco-amarillo: #ffcd00;
  --coco-verde: #93d500;
  --coco-azul: #667ddf;
  --coco-morado: #8843c8;
  --coco-negro: #111111;
  
  /* Ajustado a blanco puro */
  --bg-suave: #ffffff;
  --bg-blanco-puro: #ffffff;
  --texto-cuerpo: #222222;
  --border-suave: #e2e8f0;
  
  --font-titulos: 'Fredoka', 'Segoe UI', sans-serif;
  --font-cuerpo: 'Nunito', system-ui, sans-serif;
}

/* 2. RESET GENERAL Y FLUIDEZ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Garantizar Fondo Blanco Puro Global */
html, body {
  background-color: #ffffff !important;
  color: var(--texto-cuerpo);
  font-family: var(--font-cuerpo);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 15px;
}

/* 3. CABECERA Y LOGOTIPO GLOBAL RESPONSIVO */
header.header-global {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  background-color: #ffffff;
}

.logo-header {
  width: 100%;
  max-width: 950px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
}

/* 4. ESTRUCTURA Y NAVEGACIÓN (SIDEBAR) */
.app-container {
  display: flex;
  width: 100%;
  max-width: 1100px;
  gap: 20px;
  background-color: #ffffff;
}

sidebar {
  width: 250px;
  background: #ffffff;
  border: 1px solid var(--border-suave);
  border-radius: 20px;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: fit-content;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
}

sidebar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(
    to right, 
    var(--coco-rosa) 0%, 
    var(--coco-naranja) 20%, 
    var(--coco-amarillo) 40%, 
    var(--coco-verde) 60%, 
    var(--coco-azul) 80%, 
    var(--coco-morado) 100%
  );
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-menu a {
  color: #555555;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  font-family: var(--font-titulos);
  transition: all 0.2s ease;
}

.nav-menu a.active, .nav-menu a:hover {
  background: #f0f3ff;
  color: var(--coco-azul);
}

.btn-salir {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  text-decoration: none;
  font-family: var(--font-titulos);
  font-weight: 500;
  font-size: 0.9rem;
  text-align: center;
}

main {
  flex: 1;
  width: 100%;
  background-color: #ffffff;
}

/* 5. CONTENEDORES Y CAMPOS FORMULARIO */
.card-seccion, .seccion-card, .expediente-paper, .card-servicio-publico {
  background: #ffffff !important;
  border: 2px solid var(--border-suave);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--coco-azul);
  margin-bottom: 6px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--border-suave);
  border-radius: 12px;
  font-family: var(--font-cuerpo);
  font-size: 0.95rem;
  background: #ffffff;
}

/* 6. PIE DE PÁGINA GLOBAL */
footer {
  margin-top: 25px;
  width: 100%;
  display: flex;
  justify-content: center;
  background-color: #ffffff;
}

.img-footer {
  max-width: 950px;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

/* ==========================================================
   7. REGLAS RESPONSIVAS PARA MÓVILES Y TABLETAS
   ========================================================== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .app-container {
    flex-direction: column;
    gap: 15px;
  }

  sidebar {
    width: 100%;
  }

  /* La barra lateral en móviles se convierte en menú horizontal o compacto */
  .nav-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
  }

  .nav-menu a {
    text-align: center;
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Ajuste para botones en celular */
  button, .btn-top-accion, .btn-subir, .btn-lanzar {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
  }
}