/* ==========================================================
   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;
  
  --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;
}

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: 0;
  margin: 0;
  width: 100%;
}

/* 3. CABECERA Y LOGOTIPO GLOBAL RESPONSIVO */
header.header-global {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 15px 0 20px 0;
  padding: 0 15px;
  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;
  padding: 0 15px;
  background-color: #ffffff;
  flex: 1 0 auto;
}

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. ESTILOS DEL FOOTER */
.footer-global {
  width: 100%;
  margin-top: 40px;
  background-color: #ffffff;
  border-top: 1px solid var(--border-suave);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-color-bar {
  width: 100%;
  height: 8px;
  background: linear-gradient(
    to right, 
    var(--coco-rosa) 0%, 
    var(--coco-rosa) 16.666%, 
    var(--coco-naranja) 16.666%, 
    var(--coco-naranja) 33.333%, 
    var(--coco-amarillo) 33.333%, 
    var(--coco-amarillo) 50%, 
    var(--coco-verde) 50%, 
    var(--coco-verde) 66.666%, 
    var(--coco-azul) 66.666%, 
    var(--coco-azul) 83.333%, 
    var(--coco-morado) 83.333%, 
    var(--coco-morado) 100%
  );
}

.footer-content {
  width: 100%;
  max-width: 900px;
  padding: 25px 20px 30px 20px;
  text-align: center;
}

.footer-title {
  font-family: var(--font-titulos);
  font-size: 1.45rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 22px;
}

.footer-title span {
  font-style: italic;
}

.footer-grid {
  display: flex;
  justify-content: center;
  gap: 50px;
  text-align: left;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #111827;
  font-size: 0.98rem;
  font-weight: 600;
}

.footer-link svg {
  flex-shrink: 0;
}

/* 7. REGLAS RESPONSIVAS */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    gap: 15px;
  }

  sidebar {
    width: 100%;
  }

  .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;
  }

  .footer-grid {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
  }

  .footer-link {
    justify-content: center;
  }

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

  button, .btn-top-accion, .btn-subir, .btn-lanzar {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
  }
}
