/* =========================================================================
   START — Sistema de Diseño
   Secretaría de Educación Departamental de Bolívar
   ========================================================================= */

:root {
  --azul-departamental: #0A2540;
  --azul-medio: #00529B;
  --verde-innovacion: #00D4B2;
  --dorado-bolivar: #FFB800;
  --rojo-alerta: #EF4444;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Escala de espaciado: base 4px, para que paddings/gaps de paneles, tarjetas y campos no queden "casi pero no del todo" alineados entre sí. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --duration-fast: 0.18s;
  --duration-base: 0.3s;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);

  --font-titulos: 'Outfit', sans-serif;
  --font-cuerpo: 'Inter', sans-serif;

  --shadow-soft: 0 10px 30px rgba(10, 37, 64, 0.10);
  --shadow-hover: 0 20px 40px rgba(0, 212, 178, 0.18);

  /* Colores de contraste reutilizados (antes hardcodeados en varias reglas) */
  --dorado-texto: #a06600;
  --verde-texto: #00997f;
  --verde-texto-alt: #067a63;

  /* Tema claro (por defecto) */
  --bg-app: #F8FAFC;
  --bg-elevada: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(10, 37, 64, 0.08);
  --texto-principal: #0A2540;
  --texto-muted: #4B5A6B;
  --hero-overlay: linear-gradient(135deg, rgba(10,37,64,0.92) 0%, rgba(0,82,155,0.90) 55%, rgba(0,212,178,0.85) 100%);
}

:root[data-theme='dark'] {
  --bg-app: #0F172A;
  --bg-elevada: #16213A;
  --glass-bg: rgba(30, 41, 59, 0.65);
  --glass-border: rgba(255, 255, 255, 0.10);
  --texto-principal: #F8FAFC;
  --texto-muted: #94A3B8;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --dorado-texto: var(--dorado-bolivar);
  --verde-texto: var(--verde-innovacion);
  --verde-texto-alt: var(--verde-innovacion);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}

body {
  font-family: var(--font-cuerpo);
  background: var(--bg-app);
  color: var(--texto-principal);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-titulo {
  font-family: var(--font-titulos);
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--verde-innovacion);
  color: #0A2540;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid var(--verde-innovacion);
  outline-offset: 2px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
.start-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}

.start-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand__logo { 
  width: 48px; 
  height: 48px; 
  flex-shrink: 0; 
  display: block; 
  object-fit: contain; 
  border-radius: 12px; 
  filter: drop-shadow(0 2px 8px rgba(0, 212, 178, 0.25)); 
  transition: transform 0.25s ease;
}
.brand:hover .brand__logo {
  transform: scale(1.05);
}

.brand__text h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--texto-principal);
}

.brand__text p {
  font-size: 12.5px;
  color: var(--texto-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Navegación principal / Mega-menú de Direcciones
   --------------------------------------------------------------------- */
.main-nav { position: relative; }

.main-nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--texto-principal);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}
.main-nav__trigger:hover { border-color: var(--glass-border); }
.main-nav__trigger[aria-expanded='true'] { background: var(--glass-bg); border-color: var(--glass-border); color: var(--verde-innovacion); }
.main-nav__trigger .icon { transition: transform 0.2s ease; }
.main-nav__trigger[aria-expanded='true'] .icon { transform: rotate(180deg); }

.mega-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(360px, 92vw);
  max-height: min(72vh, 560px);
  overflow-y: auto;
  background: var(--bg-elevada);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}
.mega-menu[hidden] { display: none; }

.mega-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}
.mega-menu__item:hover,
.mega-menu__item:focus-visible { background: var(--bg-app); }

.mega-menu__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mega-menu__icon .icon { width: 17px; height: 17px; }

.mega-menu__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mega-menu__text strong { font-size: 13.5px; color: var(--texto-principal); line-height: 1.3; }
.mega-menu__text span { font-size: 11.5px; color: var(--texto-muted); }

/* Direcciones con roles: acordeón — colapsado por defecto, se expande al hacer clic en el padre. */
.mega-menu__group {
  background: var(--bg-app);
  border-radius: var(--radius-md);
  padding: 2px;
}
.mega-menu__group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.mega-menu__group-title:hover,
.mega-menu__group-title:focus-visible { background: var(--bg-elevada); }
.mega-menu__chevron { margin-left: auto; flex-shrink: 0; color: var(--texto-muted); }
.mega-menu__chevron .icon { width: 16px; height: 16px; transition: transform 0.2s ease; }
.mega-menu__group-title[aria-expanded='true'] .mega-menu__chevron .icon { transform: rotate(180deg); }
.mega-menu__subitems[hidden] { display: none; }
.mega-menu__subitems { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 2px 6px 6px 44px; }
.mega-menu__subitems::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 0;
  bottom: 12px;
  width: 2px;
  background: var(--glass-border);
}
.mega-menu__subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--texto-principal);
}
.mega-menu__subitem:hover,
.mega-menu__subitem:focus-visible { background: var(--bg-elevada); color: var(--verde-innovacion); }

@media (max-width: 640px) {
  .mega-menu { width: 92vw; }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-principal);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--verde-innovacion); }
.icon-btn svg { width: 20px; height: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--azul-medio), var(--verde-innovacion));
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 212, 178, 0.25);
}
.btn-outline {
  background: transparent;
  color: var(--texto-principal);
  border-color: var(--glass-border);
}
.btn-outline:hover { border-color: var(--verde-innovacion); }
.btn-danger { background: var(--rojo-alerta); color: #fff; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-overlay);
  color: #F8FAFC;
  padding: 38px 0 44px;
}

.hero__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.hero h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero h2 span { color: var(--dorado-bolivar); }

.hero__parrafo {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.92);
  max-width: 640px;
}

.hero__stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero__stat strong {
  display: block;
  font-family: var(--font-titulos);
  font-size: 24px;
  font-weight: 800;
}

.hero__stat span {
  font-size: 12.5px;
  color: rgba(248, 250, 252, 0.75);
}

/* Selector de Secretaría: nivel por encima de las Direcciones — muestra la Secretaría activa
   (colapsada) y se despliega para elegir otra; la fila de Direcciones de abajo se refiltra según
   la elegida, sin recargar la página. */
.secretaria-selector {
  background: var(--bg-app);
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}
.secretaria-selector__inner {
  display: flex;
  justify-content: center;
  padding: 10px 24px 0;
}
.secretaria-selector__actual {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--glass-border);
  border-bottom: none;
  background: var(--bg-elevada);
  color: var(--texto-principal);
  font-family: var(--font-titulos);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.secretaria-selector__actual:hover { background: color-mix(in srgb, var(--secretaria-color, var(--azul-departamental)) 10%, var(--bg-elevada)); }
.secretaria-selector__icon {
  display: inline-flex;
  color: var(--secretaria-color, var(--azul-departamental));
}
.secretaria-selector__icon .icon { width: 20px; height: 20px; }
.secretaria-selector__chevron { display: inline-flex; color: var(--texto-muted); transition: transform 0.2s ease; }
.secretaria-selector__chevron .icon { width: 16px; height: 16px; }
.secretaria-selector__actual[aria-expanded="true"] .secretaria-selector__chevron { transform: rotate(180deg); }

.secretaria-selector__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 320px;
  max-width: 92vw;
  background: var(--bg-elevada);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* El atributo `hidden` por sí solo pierde contra el `display:flex` de arriba (misma especificidad,
   pero una hoja de autor siempre gana sobre la hoja de user-agent que trae `[hidden]{display:none}`) —
   sin esta regla el desplegable queda visible desde la carga inicial de la página. */
.secretaria-selector__dropdown[hidden] { display: none; }
.secretaria-selector__opcion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm, 8px);
  border: none;
  background: transparent;
  color: var(--texto-principal);
  font-family: var(--font-cuerpo);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.secretaria-selector__opcion:hover { background: var(--bg-app); }
.secretaria-selector__opcion.is-active { background: color-mix(in srgb, var(--secretaria-color, var(--azul-departamental)) 14%, var(--bg-elevada)); }
.secretaria-selector__opcion .secretaria-selector__icon .icon { width: 18px; height: 18px; }

/* Barra de Direcciones: navegación de la Secretaría elegida arriba, justo debajo del encabezado (siempre visible sin necesidad de scroll). Tarjetas con ícono arriba y nombre centrado debajo (hasta 2 líneas), en vez de píldoras de una sola línea. */
.direccion-nav {
  background: var(--bg-elevada);
  border-bottom: 1px solid var(--glass-border);
}
.direccion-nav__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 24px;
}
.direccion-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 132px;
  padding: 8px 8px 7px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-app);
  color: var(--texto-principal);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.direccion-nav__item:hover {
  border-color: var(--direccion-color, var(--verde-innovacion));
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.direccion-nav__icon {
  display: inline-flex;
  color: var(--direccion-color, var(--verde-innovacion));
}
.direccion-nav__icon .icon { width: 18px; height: 18px; }
.direccion-nav__item.is-active {
  border-color: var(--direccion-color, var(--verde-innovacion));
  background: color-mix(in srgb, var(--direccion-color, var(--verde-innovacion)) 12%, var(--bg-app));
}

/* =========================================================================
   Sub-portal de una Dirección (direccion.html): menú lateral de toda la
   aplicación + hero con foto/color propios + módulos de la Dirección.
   ========================================================================= */
.direccion-layout { display: flex; align-items: flex-start; }

.direccion-sidebar {
  width: 270px;
  flex-shrink: 0;
  position: sticky;
  top: 77px;
  align-self: flex-start;
  max-height: calc(100vh - 77px);
  overflow-y: auto;
  padding: 20px 14px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
}
.app-sidebar__nav { display: flex; flex-direction: column; }

/* Enlace de regreso, siempre anclado a la parte inferior del menú lateral. */
.direccion-sidebar__volver {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--texto-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease-standard);
}
.direccion-sidebar__volver:hover { color: var(--verde-innovacion); }
.direccion-sidebar__volver .icon { width: 16px; height: 16px; transform: rotate(90deg); }

/* Encabezado-acordeón: nombre de la Dirección actual; al hacer clic despliega/colapsa sus módulos hacia abajo. */
.app-sidebar__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: color-mix(in srgb, var(--direccion-color, var(--verde-innovacion)) 14%, transparent);
  color: var(--direccion-color, var(--verde-innovacion));
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 6px;
}
.app-sidebar__toggle-label { flex: 1; min-width: 0; }
.app-sidebar__icon { display: inline-flex; color: var(--direccion-color, var(--verde-innovacion)); flex-shrink: 0; }
.app-sidebar__icon .icon { width: 17px; height: 17px; }
.app-sidebar__chevron {
  display: inline-flex;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.app-sidebar__chevron .icon { width: 16px; height: 16px; }
.app-sidebar__toggle:not(.is-open) .app-sidebar__chevron { transform: rotate(-90deg); }

.app-sidebar__modulos { display: flex; flex-direction: column; padding: 2px 4px 8px; }
.app-sidebar__modulos[hidden] { display: none; }
.app-sidebar__modulo {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--texto-principal);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.app-sidebar__modulo:hover { background: var(--bg-app); color: var(--direccion-color, var(--verde-innovacion)); }
.app-sidebar__empty { padding: 4px 12px 8px; font-size: 12.5px; color: var(--texto-muted); font-style: italic; }

.direccion-content { flex: 1; min-width: 0; }

.direccion-hero {
  position: relative;
  background: linear-gradient(135deg, var(--azul-departamental) 0%, var(--azul-medio) 60%, var(--direccion-color, var(--verde-innovacion)) 140%);
  color: #F8FAFC;
  padding: 22px 0;
  overflow: hidden;
}
.direccion-hero.has-imagen {
  background-image: var(--direccion-imagen), linear-gradient(135deg, var(--azul-departamental) 0%, var(--azul-medio) 60%, var(--direccion-color, var(--verde-innovacion)) 140%);
  background-size: cover;
  background-position: center;
}
.direccion-hero__overlay { display: none; }
.direccion-hero.has-imagen .direccion-hero__overlay {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,37,64,0.92) 0%, rgba(10,37,64,0.72) 55%, rgba(10,37,64,0.35) 100%);
}
.direccion-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
}
.direccion-hero__icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}
.direccion-hero__icon .icon { width: 22px; height: 22px; }
.direccion-hero__tipo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(248, 250, 252, 0.75);
}
.direccion-hero h2 { font-size: 21px; margin: 2px 0 5px; }
.direccion-hero p { color: rgba(248, 250, 252, 0.9); max-width: 720px; font-size: 13px; line-height: 1.45; }

@media (max-width: 900px) {
  .direccion-layout { flex-direction: column; }
  .direccion-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }
  .direccion-hero__inner { flex-direction: column; align-items: flex-start; text-align: left; }
}

.direccion-modulos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.direccion-modulo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  text-decoration: none;
  color: var(--texto-principal);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.direccion-modulo:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--direccion-color, var(--verde-innovacion));
}
.direccion-modulo__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--direccion-color, var(--verde-innovacion)) 14%, transparent);
  color: var(--direccion-color, var(--verde-innovacion));
}
.direccion-modulo__texto { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.direccion-modulo__texto span { font-size: 12.5px; color: var(--texto-muted); }
.direccion-modulo__arrow { color: var(--texto-muted); transform: rotate(-90deg); flex-shrink: 0; }
button.direccion-modulo { width: 100%; text-align: left; cursor: pointer; font: inherit; }

.hero__art-container {
  position: relative;
  width: 100%;
  max-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__art-img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 178, 0.25);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  object-fit: cover;
}

.hero__art-container:hover .hero__art-img {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 45px rgba(0, 212, 178, 0.4);
}

.hero__art-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(0, 212, 178, 0.3) 0%, rgba(255, 184, 0, 0.15) 50%, transparent 70%);
  filter: blur(20px);
  z-index: -1;
  border-radius: 30px;
  pointer-events: none;
}

/* ---------------------------------------------------------------------
   Estado vacío / error de carga
   --------------------------------------------------------------------- */
.load-error {
  margin-top: 20px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--rojo-alerta);
  color: #F8FAFC;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  max-width: 640px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--texto-muted);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------------------
   Enlaces de interés (portal): otras aplicaciones y portales
   institucionales del sector educativo y de la Gobernación de Bolívar.
   --------------------------------------------------------------------- */
.enlaces-interes {
  background: var(--bg-app);
  padding: 28px 0 32px;
}
.enlaces-interes h3 { font-size: 16px; margin-bottom: 2px; }
.enlaces-interes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.enlace-interes {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-principal);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
.enlace-interes:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--verde-innovacion);
}
.enlace-interes__icon { display: inline-flex; color: var(--verde-innovacion); flex-shrink: 0; }
.enlace-interes__arrow { display: inline-flex; color: var(--texto-muted); margin-left: auto; flex-shrink: 0; }
.enlace-interes__arrow .icon { width: 15px; height: 15px; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.start-footer {
  border-top: 1px solid var(--glass-border);
  padding: 32px 0;
  color: var(--texto-muted);
  font-size: 13px;
}
.start-footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.start-footer a { font-weight: 600; color: var(--azul-medio); }
:root[data-theme='dark'] .start-footer a { color: var(--verde-innovacion); }
.start-footer--minimal { padding: 14px 0; }
.start-footer--minimal .start-footer__inner { justify-content: center; }

/* ---------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--azul-departamental);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 100;
  max-width: 340px;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast.is-success { background: var(--verde-texto-alt); }
.toast.is-error { background: var(--rojo-alerta); }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .hero__art-container { max-width: 220px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .start-header__inner { padding: 12px 16px; }
  .brand__text p { display: none; }
  .container { padding: 0 16px; }
  .hero { padding: 26px 0 30px; }
}

/* =========================================================================
   Panel de Administración
   ========================================================================= */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }

.admin-login {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--hero-overlay);
}

.admin-login__card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-soft);
  color: var(--texto-principal);
}
:root:not([data-theme='dark']) .admin-login__card { --texto-principal: #0A2540; --texto-muted: #4B5A6B; background: rgba(255,255,255,0.95); }

.admin-login__card h2 { font-size: 22px; margin-bottom: 6px; }
.admin-login__card p.hint { color: var(--texto-muted); font-size: 13.5px; margin-bottom: 24px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--texto-principal);
}
.field .field-hint { font-size: 12px; color: var(--texto-muted); margin-top: 4px; }

.field input[type='text'],
.field input[type='password'],
.field input[type='number'],
.field input[type='url'],
.field textarea,
.field select {
  width: 100%;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-principal);
  font-size: 14px;
  font-family: var(--font-cuerpo);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input[type='color'] { width: 56px; height: 44px; padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--bg-elevada); cursor: pointer; }

.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 160px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { width: 40px; height: 22px; appearance: none; background: var(--glass-border); border-radius: var(--radius-pill); position: relative; cursor: pointer; transition: background 0.2s ease; }
.switch input:checked { background: var(--verde-innovacion); }
.switch input::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.switch input:checked::after { left: 20px; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 24px;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.admin-body { padding: 28px 24px 60px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* Panel de Administrador organizado por proceso: menú lateral + una "página" visible a la vez. */
.admin-layout { display: flex; align-items: flex-start; }

.admin-sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 65px;
  align-self: flex-start;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  padding: 24px 14px;
  border-right: 1px solid var(--glass-border);
}
.admin-sidebar__nav { display: flex; flex-direction: column; }
.admin-sidebar__group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.admin-sidebar__accordion { margin-bottom: 18px; }
.admin-sidebar__accordion .app-sidebar__modulos { gap: 2px; }
.admin-sidebar__accordion .app-sidebar__modulo,
.admin-sidebar__accordion .admin-sidebar__link { width: 100%; }
.admin-sidebar__group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--texto-muted);
  font-weight: 700;
  padding: 0 12px;
  margin-bottom: 6px;
}
.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--texto-principal);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.admin-sidebar__link:hover { background: var(--bg-app); }
.admin-sidebar__link.is-active {
  background: color-mix(in srgb, var(--verde-innovacion) 16%, transparent);
  color: var(--verde-texto);
}

.admin-content { flex: 1; min-width: 0; max-height: calc(100vh - 65px); overflow-y: auto; }
.admin-page[hidden] { display: none; }

@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    padding: 12px 14px;
  }
  .admin-sidebar__nav { flex-direction: row; }
  .admin-sidebar__group { flex-direction: row; align-items: center; gap: 6px; margin-bottom: 0; margin-right: 14px; flex-shrink: 0; }
  .admin-sidebar__group-title { display: none; }
  .admin-sidebar__link { white-space: nowrap; }
  .admin-content { max-height: none; overflow-y: visible; }
}

.admin-panel {
  background: var(--bg-elevada);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.admin-panel__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.admin-panel__header h3 { font-size: 18px; font-weight: 700; }
.admin-panel__header p { color: var(--texto-muted); font-size: 13px; margin-top: 4px; }

.direccion-editor {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}
.direccion-editor__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.direccion-editor__emoji { font-size: 26px; }
.direccion-editor__order-controls { display: flex; flex-direction: column; gap: 2px; }
.mini-btn {
  width: 28px; height: 22px;
  border: 1px solid var(--glass-border);
  background: var(--bg-app);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--texto-principal);
}
.mini-btn:hover { border-color: var(--verde-innovacion); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-app);
  color: var(--texto-muted);
}
.chip.is-active { background: var(--azul-medio); color: #fff; border-color: transparent; }

.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.badge-admin {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,184,0,0.15);
  color: var(--dorado-texto);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}
:root[data-theme='dark'] .badge-admin { color: var(--dorado-bolivar); }

.import-export-row { display: flex; gap: 10px; flex-wrap: wrap; }
input[type='file'].visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

.logo-preview {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--bg-app);
}
.logo-preview img, .logo-preview svg { width: 100%; height: 100%; object-fit: contain; }

.direccion-editor__imgpreview {
  width: 84px; height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--bg-app);
  color: var(--texto-muted);
}
.direccion-editor__imgpreview img { width: 100%; height: 100%; object-fit: cover; }
.direccion-editor__imgpreview .icon { width: 22px; height: 22px; }

.roles-editor { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--glass-border); }
.roles-editor__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.role-editor { border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: var(--bg-app); }
.role-editor__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.role-editor__creds { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--glass-border); }

.catalogo-group {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevada);
}
.catalogo-group__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.catalogo-group__header h4 { font-size: 14px; font-weight: 700; margin: 0; }
.catalogo-entry { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.catalogo-entry input[type='text'] {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-principal);
  font-size: 13.5px;
  font-family: var(--font-cuerpo);
}
.catalogo-entry input[type='color'] {
  width: 42px;
  height: 40px;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  cursor: pointer;
}

/* Buscador + import/export CSV, reutilizado por todos los editores de catálogo (valor/color, MGA, DUE). */
.catalogo-buscador { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.catalogo-buscador input[type='search'] {
  flex: 1;
  min-width: 240px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-principal);
  font-size: 13.5px;
  font-family: var(--font-cuerpo);
}
.catalogo-buscador__contador { font-size: 12.5px; color: var(--texto-muted); white-space: nowrap; }
.catalogo-filtros { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.catalogo-filtros .field { margin-bottom: 14px; flex: 1; min-width: 160px; }
.catalogo-import-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.catalogo-import-row .field-hint { margin: 0; }
/* Gestión de Inventario público: grid de tarjetas por sede con check grande, en vez de una tabla plana. */
.sede-inventario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.sede-inventario-card {
  padding: 22px 18px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--glass-border);
  background: var(--bg-elevada);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sede-inventario-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.sede-inventario-card__icono { color: var(--azul-medio); opacity: 0.7; margin-bottom: 6px; }
.sede-inventario-card__icono svg { width: 26px; height: 26px; }
:root[data-theme='dark'] .sede-inventario-card__icono { color: var(--verde-innovacion); }
.sede-inventario-card__check { font-size: 36px; line-height: 1; margin-bottom: 10px; }
.sede-inventario-card__nombre { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.sede-inventario-card__estado { font-size: 12px; color: var(--texto-muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.sede-inventario-card.is-completo { border-color: #00D4B2; background: rgba(0, 212, 178, 0.08); }
.sede-inventario-card.is-completo .sede-inventario-card__estado { color: #00D4B2; }
.sede-inventario-card.is-progreso { border-color: #FFB800; background: rgba(255, 184, 0, 0.08); }
.sede-inventario-card.is-progreso .sede-inventario-card__estado { color: #a06600; }
:root[data-theme='dark'] .sede-inventario-card.is-progreso .sede-inventario-card__estado { color: #FFB800; }
.sede-inventario-card.is-pendiente .sede-inventario-card__estado { color: var(--texto-muted); }
.sede-inventario-card__acciones { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }

.catalogo-vacio {
  padding: 26px 18px;
  text-align: center;
  color: var(--texto-muted);
  font-size: 13.5px;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevada);
}

/* Inputs/selects dentro de celdas de .data-table (editores de catálogo convertidos a tabla). */
.data-table input[type='text'],
.data-table select {
  width: 100%;
  min-width: 110px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-principal);
  font-size: 13px;
  font-family: var(--font-cuerpo);
}
.data-table input[type='color'] {
  width: 38px;
  height: 38px;
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  cursor: pointer;
}

/* =========================================================================
   Dashboards de roles (Atención al Ciudadano, FSE, ...)
   ========================================================================= */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.dashboard-kpi {
  background: var(--bg-elevada);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}
.dashboard-kpi__label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texto-muted); font-weight: 700; }
.dashboard-kpi__value { font-family: var(--font-titulos); font-size: 32px; font-weight: 800; margin-top: 8px; }
.dashboard-kpi.is-alert .dashboard-kpi__value { color: var(--rojo-alerta); }
.dashboard-kpi.is-success .dashboard-kpi__value { color: var(--verde-innovacion); }
.dashboard-kpi__hint { font-size: 12px; color: var(--texto-muted); margin-top: 4px; }

.cuestionario-seccion { border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 10px; background: var(--bg-elevada); }
.cuestionario-seccion summary { cursor: pointer; font-weight: 700; list-style: none; }
.cuestionario-seccion summary::-webkit-details-marker { display: none; }
.cuestionario-seccion summary::before { content: "▸ "; color: var(--texto-muted); }
.cuestionario-seccion[open] summary::before { content: "▾ "; }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-app);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--texto-muted);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--glass-border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.is-vencida td { background: rgba(239, 68, 68, 0.08); }
.data-table tr.is-vencida td:first-child { border-left: 3px solid var(--rojo-alerta); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.status-pill.is-vencida { background: rgba(239, 68, 68, 0.14); color: var(--rojo-alerta); }
.status-pill.is-pendiente { background: rgba(255, 184, 0, 0.14); color: var(--dorado-texto); }
:root[data-theme='dark'] .status-pill.is-pendiente { color: var(--dorado-bolivar); }
.status-pill.is-respondida { background: rgba(0, 212, 178, 0.14); color: var(--verde-texto); }
:root[data-theme='dark'] .status-pill.is-respondida { color: var(--verde-innovacion); }

/* Galería de fotos del acta de instalación: 3 columnas fijas, miniaturas grandes y nítidas. */
.inst-fotos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
@media (max-width: 640px) { .inst-fotos-grid { grid-template-columns: repeat(2, 1fr); } }

/* Categorías de fotos de cada sección del wizard (Sede/Servicio/Pruebas): en 2 columnas para aprovechar el ancho del panel. */
.inst-categorias-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; margin-top: 10px; }
@media (max-width: 720px) { .inst-categorias-grid { grid-template-columns: 1fr; } }

/* Resalta siempre la sección de fotos de cada paso del wizard — son obligatorias, no deben pasar desapercibidas. */
.inst-fotos-destacado { margin-top: 20px; padding: 16px; border: 1.5px solid rgba(255, 184, 0, 0.5); border-radius: var(--radius-lg); background: rgba(255, 184, 0, 0.06); }
.inst-fotos-destacado .admin-panel__header h4 { display: flex; align-items: center; gap: 8px; color: var(--dorado-texto); }
:root[data-theme='dark'] .inst-fotos-destacado .admin-panel__header h4 { color: var(--dorado-bolivar); }

/* Caja del link/QR de firma del rector en el detalle del acta — siempre visible mientras haya un número de acta, para poder compartirlo de nuevo. */
.inst-link-destacado { margin-bottom: 20px; padding: 16px; border: 1.5px solid rgba(0, 212, 178, 0.4); border-radius: var(--radius-lg); background: rgba(0, 212, 178, 0.06); }
.inst-foto-thumb { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.03); aspect-ratio: 4 / 3; }
.inst-foto-thumb a { display: block; width: 100%; height: 100%; }
.inst-foto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.inst-foto-thumb:hover img { transform: scale(1.04); }
.inst-foto-thumb__del { position: absolute; top: 6px; right: 6px; background: rgba(10,37,64,0.78); color: #fff; }

.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; font-size: 12.5px; color: var(--texto-muted); }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend__swatch.is-vencida { background: var(--rojo-alerta); }
.chart-legend__swatch.is-pendiente { background: var(--dorado-bolivar); }
.chart-legend__swatch.is-respondida { background: var(--verde-innovacion); }

.chart-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.chart-panel h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.chart-rows { display: flex; flex-direction: column; gap: 10px; }
.chart-row { display: grid; grid-template-columns: 120px 1fr 34px; align-items: center; gap: 10px; }
.chart-row__label {
  font-size: 12.5px;
  color: var(--texto-principal);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-row__value { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.chart-bar-track {
  height: 16px;
  background: var(--bg-app);
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  gap: 2px;
}
.chart-segment { height: 100%; }
.chart-segment:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.chart-segment.is-vencida { background: var(--rojo-alerta); }
.chart-segment.is-pendiente { background: var(--dorado-bolivar); }
.chart-segment.is-respondida { background: var(--verde-innovacion); }

/* Gráfica de torta (CSS conic-gradient, sin librerías) */
.pie-chart-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pie-chart { width: 150px; height: 150px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px var(--glass-border) inset; }
.pie-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.pie-legend__item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--texto-principal); }
.pie-legend__swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.pie-legend__label { flex: 1; }
.pie-legend__value { color: var(--texto-muted); font-weight: 600; white-space: nowrap; }

/* Gráfica de dona (SVG, sin librerías) — versión más vistosa de la torta CSS de arriba */
.donut-chart-svg-wrap { position: relative; width: 190px; height: 190px; flex-shrink: 0; filter: drop-shadow(0 8px 18px rgba(10, 37, 64, 0.18)); }
.donut-chart-svg { width: 100%; height: 100%; }
.donut-segment { transition: opacity 0.15s ease, filter 0.15s ease; cursor: pointer; }
.donut-segment:hover { filter: brightness(1.12); }
.donut-chart-svg-wrap:hover .donut-segment:not(:hover) { opacity: 0.55; }
.donut-chart-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.donut-chart-centro__valor { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 28px; color: var(--texto-principal); line-height: 1; }
.donut-chart-centro__label { font-size: 10.5px; color: var(--texto-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }

/* Mapa de dispersión por coordenadas (Conectividad Escolar) */
.mapa-conectividad__leaflet {
  width: 100%;
  height: 460px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  z-index: 0;
}
.mapa-conectividad__leaflet .leaflet-popup-content-wrapper,
.mapa-conectividad__leaflet .leaflet-popup-tip { background: var(--bg-elevada); color: var(--texto-principal); }
/* Los tiles de OpenStreetMap son claros por defecto; se invierten en modo oscuro para que el mapa no desentone con el resto de la app. */
:root[data-theme='dark'] .mapa-conectividad__leaflet .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88); }
:root[data-theme='dark'] .mapa-conectividad__leaflet .leaflet-popup-content-wrapper,
:root[data-theme='dark'] .mapa-conectividad__leaflet .leaflet-popup-tip { background: var(--bg-elevada); color: var(--texto-principal); }

.filter-row th { padding: 8px 10px; background: var(--bg-app); border-bottom: 1px solid var(--glass-border); }
.filter-row input[type='text'],
.filter-row select {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-principal);
  font-family: var(--font-cuerpo);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 200;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--bg-elevada);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}
.modal__header h3 { font-size: 17px; font-weight: 700; }

.modal__body { padding: 24px; max-height: 65vh; overflow-y: auto; }
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--glass-border);
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--azul-medio);
}
:root[data-theme='dark'] .attachment-link { color: var(--verde-innovacion); }

.row-actions { display: flex; gap: 6px; }

.timeline {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  padding: 14px 14px 14px 8px;
}
.timeline__item {
  position: relative;
  padding: 0 0 18px 26px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: -2px;
  width: 2px;
  background: var(--glass-border);
}
.timeline__item:last-child::before { display: none; }
.timeline__dot {
  position: absolute;
  left: 0;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-app);
  box-shadow: 0 0 0 1px var(--glass-border);
}
.timeline__label { font-size: 12.5px; font-weight: 700; color: var(--texto-principal); }
.timeline__meta { font-size: 11.5px; color: var(--texto-muted); margin-top: 2px; }

.import-panel {
  background: var(--bg-elevada);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}

/* -------------------------------------------------------------------
   Pestañas (tabs) — usadas por dashboards con varias secciones internas,
   ej. Análisis Sectorial: Planes Maestros / Estructura / Metas.
   ------------------------------------------------------------------- */
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0;
}

/* Modo consulta del wizard de edición (Avance del inventario): navegación libre entre pasos, pero
   ningún campo/botón dentro de un paso permite modificar datos. */
#wizView.is-solo-lectura .tab-panel input,
#wizView.is-solo-lectura .tab-panel select,
#wizView.is-solo-lectura .tab-panel textarea,
#wizView.is-solo-lectura .tab-panel button,
#wizardView.is-solo-lectura .tab-panel input,
#wizardView.is-solo-lectura .tab-panel select,
#wizardView.is-solo-lectura .tab-panel textarea,
#wizardView.is-solo-lectura .tab-panel button {
  pointer-events: none;
  opacity: 0.6;
}
.tab-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--texto-muted);
  font-family: var(--font-titulos);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transform: translateY(1px);
}
.tab-btn:hover { color: var(--texto-principal); }
.tab-btn:disabled { color: var(--texto-muted); opacity: 0.45; cursor: not-allowed; }
.tab-btn:disabled:hover { color: var(--texto-muted); }
.tab-btn.is-active {
  color: var(--azul-medio);
  border-bottom-color: var(--verde-innovacion);
  background: var(--bg-elevada);
}
:root[data-theme='dark'] .tab-btn.is-active { color: var(--verde-innovacion); }
.tab-panel[hidden] { display: none; }

/* -------------------------------------------------------------------
   Árbol jerárquico (Estructura del Plan de Desarrollo)
   ------------------------------------------------------------------- */
.tree-list { display: flex; flex-direction: column; gap: 6px; }
.tree-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-elevada);
}
.tree-node__nivel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tree-node__codigo { font-weight: 700; color: var(--texto-muted); font-size: 12.5px; white-space: nowrap; }
.tree-node__nombre { font-weight: 600; flex: 1; min-width: 120px; }
.tree-node__desc { color: var(--texto-muted); font-size: 12.5px; }

/* -------------------------------------------------------------------
   Foto de representante (Plan de Desarrollo Maestro)
   ------------------------------------------------------------------- */
.photo-upload { display: flex; align-items: center; gap: 14px; }
.photo-upload__preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  background: var(--bg-app);
  flex-shrink: 0;
}
.import-panel p { color: var(--texto-muted); font-size: 13.5px; margin: 8px 0 16px; }

/* -------------------------------------------------------------------
   Subsecciones de formulario (ej. wizard de contratación): agrupan
   campos relacionados en una tarjeta con acento de color y subtítulo
   dinámico que refleja lo ya diligenciado.
   ------------------------------------------------------------------- */
.form-section {
  background: var(--bg-app);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--verde-innovacion);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 18px 0;
}
.form-section__header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.form-section__header h4 { font-size: 14.5px; font-weight: 700; margin: 0; }
.form-section__header p { color: var(--texto-muted); font-size: 12.5px; margin-top: 3px; }
.form-section__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 212, 178, 0.14);
  color: var(--verde-innovacion);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.form-section__icon .icon { width: 16px; height: 16px; }

/* =========================================================================
   Stepper visual de Estado (ciclo BPIN/MGA — Gestión de Proyectos)
   ========================================================================= */
.estado-stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 20px 6px 8px;
  margin: 6px 0 4px;
}
.estado-stepper::before {
  content: '';
  position: absolute;
  top: 37px;
  left: 26px;
  right: 26px;
  height: 3px;
  background: var(--glass-border);
  border-radius: 3px;
  z-index: 0;
}
.estado-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  padding: 0;
}
.estado-step__dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--glass-border);
  background: var(--bg-elevada);
  color: var(--texto-muted);
  font-weight: 800;
  font-size: 13px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.estado-step__dot .icon { width: 17px; height: 17px; }
.estado-step__num { line-height: 1; }
.estado-step__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--texto-muted);
  text-align: center;
  max-width: 100px;
  line-height: 1.25;
}
.estado-step--done .estado-step__dot { background: var(--step-color); border-color: var(--step-color); color: #fff; }
.estado-step--done .estado-step__label { color: var(--step-color); }
.estado-step--active .estado-step__dot {
  background: var(--step-color);
  border-color: var(--step-color);
  color: #fff;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--step-color) 22%, transparent);
  transform: scale(1.14);
}
.estado-step--active .estado-step__label { color: var(--step-color); font-weight: 800; }
.estado-step:hover .estado-step__dot { border-color: var(--step-color); }

/* =========================================================================
   Responsive: panel de Administrador y dashboards de rol (antes solo el
   portal tenía puntos de quiebre; esta capa cubre admin-topbar, modales y
   tablas de datos en pantallas angostas).
   ========================================================================= */
@media (max-width: 640px) {
  .admin-topbar { padding: 12px 16px; }
  .admin-body { padding: 20px 14px 48px; }
  .admin-panel { padding: 18px; }
  .header-actions .btn-outline span:not(.icon) { display: none; }
  .modal-backdrop { padding: 16px 8px; align-items: stretch; }
  .modal { max-width: 100%; }
  .modal__body { padding: 16px; max-height: 72vh; }
  .modal__header { padding: 16px; }
  .field-row { flex-direction: column; gap: 0; }
  .data-table { min-width: 560px; }
}

/* =========================================================================
   Micro-animaciones: contador ascendente para KPIs y tarjetas de estadística
   (dashboard-kpi__value, hero__stat strong) — ver startAnimateCounters() en
   dashboard-kit.js.
   ========================================================================= */
.dashboard-kpi { transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard); }
.dashboard-kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
[data-count-target] { font-variant-numeric: tabular-nums; }

/* Fila de adjunto (Adjuntar / nombre del archivo actual / Quitar) — reemplaza el bloque inline repetido en los formularios de Contratación. */
.file-attach-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
