/**
 * CIEM IA+ — Shell visual alineado a ecosistemainvestigacion.php
 * (nav fijo 280px, main, header, tarjetas, barra perfil 2.0).
 * @deploy-marker CIEM_FASE1_LAYOUT_HOMOGENEO_2026-05-28
 */
:root {
  --primary: #2c3e50;
  --accent: #3498db;
  --bg: #f4f7f6;
  --success: #27ae60;
  --dark-card: #1e272e;
  --sem-color: #f39c12;
  --text-main: #000000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body,
html {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  font-size: 1.05rem;
  color: var(--text-main) !important;
  overflow-x: hidden;
  overflow-y: auto !important;
}

body > nav#nav-ecosistema.sidebar-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  visibility: visible !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  clip: auto !important;
  clip-path: none !important;
}

nav#nav-ecosistema .sidebar-container__scroll {
  flex: 1 1 0%;
  flex-shrink: 1 !important;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 15px 15px 50px 15px !important;
  box-sizing: border-box !important;
}

main,
#ciem-area-principal {
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  flex: none !important;
  overflow-y: visible !important;
}

nav#nav-ecosistema .sidebar-container__scroll > * {
  flex-shrink: 0;
}

.logo-container {
  text-align: center;
  margin-bottom: 15px;
  background: white;
  padding: 10px;
  border-radius: 8px;
}

.logo-img {
  max-width: 90%;
  height: auto;
}

.ecosistema-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent);
  text-align: center;
  margin: 5px 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

nav#nav-ecosistema h2 {
  font-size: 0.75rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 15px;
  border-bottom: 1px solid #3e4f5f;
  padding-bottom: 3px;
}

nav#nav-ecosistema a {
  color: #bdc3c7;
  text-decoration: none;
  display: block;
  padding: 8px 0;
  transition: 0.3s;
  cursor: pointer;
  font-size: 0.9rem;
}

nav#nav-ecosistema a:hover {
  color: white;
  transform: translateX(5px);
}

.btn-central {
  background: var(--accent);
  color: white !important;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  margin-top: 10px;
  display: block;
  font-weight: bold;
  text-decoration: none;
  border-bottom: 3px solid #2980b9;
}

a.ciem-btn-orquestador-general {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
  font-weight: 900 !important;
  font-size: 0.88rem !important;
  text-align: center;
  text-decoration: none !important;
  color: #1c1917 !important;
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 50%, #fcd34d 100%) !important;
  border: 3px solid #d97706 !important;
  border-radius: 12px !important;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45), 0 8px 22px rgba(180, 83, 9, 0.28) !important;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

a.ciem-btn-orquestador-general:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  color: #0f172a !important;
}

.btn-recurso {
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid var(--accent);
  border-radius: 5px;
  margin-top: 5px;
  padding: 6px !important;
  text-align: center;
  font-size: 0.85rem !important;
}

main {
  margin-left: 280px !important;
  padding: 30px 15px;
  width: calc(100% - 280px) !important;
  min-height: 100vh;
  display: block;
}

.card {
  background: white;
  padding: 35px 20px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-top: 6px solid var(--accent);
  margin-bottom: 25px;
  color: #000 !important;
  display: none;
}

.card.active {
  display: block !important;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.active {
  display: block !important;
  animation: slideIn 0.3s ease-out;
}

.intro-box {
  background: #f1f5f9;
  color: #000;
  border-left: 5px solid var(--accent);
  padding: 25px;
  margin: 15px 0;
  border-radius: 0 12px 12px 0;
  line-height: 1.6;
}

.btn-agente {
  display: block;
  background: #ecf0f1;
  color: #000 !important;
  padding: 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #dcdde1;
  text-align: center;
  margin: 10px 0;
}

/* Barra perfil 2.0 */
.ciem-f20-perfil-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #bae6fd;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  z-index: 10;
  position: relative;
  color: #0c4a6e;
  box-sizing: border-box;
}

.ciem-f20-perfil-bar--top {
  margin: 0 0 12px 0;
  padding: 12px 18px;
  border-radius: 0 0 14px 14px;
  border: 1px solid #7dd3fc;
  border-top: none;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  z-index: 10;
  position: relative;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.12);
  box-sizing: border-box;
  width: 100%;
}

.ciem-f20-perfil-bar--top .ciem-f20-perfil-titulo {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.ciem-f20-perfil-bar .ciem-f20-perfil-titulo {
  font-weight: 900;
  font-size: 0.82rem;
  color: #075985;
  margin-right: 4px;
}

.ciem-f20-perfil-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  color: #0f172a;
}

.ciem-f20-perfil-bar input[type="radio"] {
  accent-color: #0369a1;
  cursor: pointer;
}

.ciem-f20-perfil-bar .ciem-f20-perfil-hint {
  flex-basis: 100%;
  width: 100%;
  margin: 4px 0 0 0;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.5;
}

@keyframes ciemPerfilSaludResalto {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.4), 0 8px 26px rgba(14, 165, 233, 0.22);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.5), 0 12px 34px rgba(14, 165, 233, 0.42);
  }
}

.ciem-f20-perfil-bar--top.ciem-f20-perfil-bar--modo-salud {
  border: 3px solid #0284c7 !important;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #ecfeff 100%) !important;
  background-color: #e0f2fe !important;
  animation: ciemPerfilSaludResalto 2.6s ease-in-out infinite;
}

.ciem-f20-perfil-bar--modo-salud .ciem-f20-perfil-titulo {
  color: #0369a1;
}

/* Modal constructor 2.0: centrar cuando JS pone display:flex */
#ciem_modal_constructor20_integridad[style*="flex"] {
  display: flex !important;
}

/* Bloque inicio / fase 1 — mismos componentes que ecosistemainvestigacion.php */
#ciem-area-principal {
  display: block;
}

.btn-video-ia {
  background: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
}

a.ciem-btn-guia-veredictos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 22px;
  border-radius: 12px;
  border: 2px solid #f59e0b;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #0f172a !important;
  font-weight: 900;
  font-size: 1.02rem;
  text-decoration: none !important;
  text-align: center;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.35);
  letter-spacing: 0.02em;
  box-sizing: border-box;
}

a.ciem-btn-guia-veredictos:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.45);
}

a.ciem-btn-lab-precision-entrada {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  padding: 16px 14px !important;
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 55%, #0c4a6e 100%) !important;
  color: #ffffff !important;
  border: 2px solid rgba(253, 224, 71, 0.65) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.45);
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
}

a.ciem-btn-lab-precision-entrada:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 32px rgba(253, 224, 71, 0.25);
}

a.ciem-btn-lab-precision-entrada .ciem-btn-lab-precision-entrada__titulo {
  font-weight: 900;
  font-size: 1.02rem;
  color: #ffffff !important;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

a.ciem-btn-lab-precision-entrada .ciem-btn-lab-precision-entrada__sub {
  display: block;
  font-weight: 700;
  font-size: 0.76rem;
  color: #fef08a !important;
  line-height: 1.4;
  max-width: 20rem;
  opacity: 0.98;
}

@media (max-width: 1024px) {
  html,
  body {
    min-width: 960px !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    height: auto !important;
  }

  body > nav#nav-ecosistema.sidebar-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    max-width: 280px !important;
    min-width: 280px !important;
    transform: none !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    visibility: visible !important;
    box-sizing: border-box !important;
  }

  body > nav#nav-ecosistema.sidebar-container .sidebar-container__scroll {
    overflow-y: auto !important;
    padding: 15px 15px 56px 15px !important;
  }

  main {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
    padding: 20px 15px;
    min-height: 100vh;
    overflow-y: visible !important;
  }
}
