:root {
  --azul-oscuro: #182b49;
  --azul-medio: #2b6cb0;
  --amarillo-alerta: #f3d03e;
  --fondo-gris: #f4f6f9;
  --texto-oscuro: #1e293b;
  --texto-suave: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
  width: 100%;
  overflow-x: hidden;
  background-color: var(--fondo-gris);
  color: var(--texto-oscuro);
}

/* =========================================================
   BARRA DE NAVEGACIÓN FLUIDA
   ========================================================= */
.navbar {
  background-color: var(--azul-oscuro);
  color: white;
  padding: 12px clamp(16px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
}

.brand {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
}

.brand span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.85;
  display: block;
}

.nav-links {
  display: flex;
  gap: clamp(12px, 2.2vw, 26px);
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: clamp(0.86rem, 1vw, 0.95rem);
  padding-bottom: 4px;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a.active,
.nav-links a:hover {
  color: white;
  border-bottom: 2px solid var(--amarillo-alerta);
  font-weight: 600;
}

/* =========================================================
   CINTA ÚLTIMO MOMENTO FLUIDA
   ========================================================= */
.ticker-bar {
  position: relative;
  background-color: var(--amarillo-alerta);
  color: #1e293b;
  padding: 9px clamp(16px, 4vw, 56px);
  font-size: clamp(0.82rem, 1vw, 0.88rem);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.ticker-bar a {
  color: #0f172a;
  font-weight: 700;
  text-decoration: underline;
}

/* =========================================================
   CONTENEDOR PRINCIPAL FLUIDO
   ========================================================= */
.main-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 28px) clamp(16px, 4vw, 56px);
}

/* =========================================================
   BANNERS ADAPTATIVOS (SIN RECORTES)
   ========================================================= */
.banner-adaptativo-box {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #13223b 0%, #1e3a5f 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  margin-bottom: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.banner-adaptativo-box img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.banner-texto-pie {
  width: 100%;
  padding: 18px 28px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.banner-texto-pie h1 {
  font-size: clamp(1.2rem, 2.2vw, 1.75rem);
  line-height: 1.25;
}

.banner-texto-pie p {
  font-size: clamp(0.86rem, 1.1vw, 0.96rem);
  color: #cbd5e1;
}

.btn-primary {
  display: inline-block;
  background-color: var(--azul-medio);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #1e4e8c;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.08rem, 1.5vw, 1.22rem);
  font-weight: 700;
  color: var(--azul-oscuro);
}

/* =========================================================
   ACCESO RÁPIDO FLUIDO
   ========================================================= */
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

/* =========================================================
   TARJETAS DE NOVEDADES CELTAS (ADAPTATIVAS)
   ========================================================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.news-card {
  position: relative;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}

.card-img-wrapper img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--amarillo-alerta);
  color: #1e293b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 5;
}

.card-body {
  padding: 18px;
}

.card-body h3 {
  font-size: 1.05rem;
  color: var(--azul-oscuro);
  margin-bottom: 8px;
}

.card-body p {
  font-size: 0.88rem;
  color: var(--texto-suave);
  line-height: 1.45;
}

.card-footer {
  padding: 12px 18px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--texto-suave);
}

.card-tag {
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* =========================================================
   INICIO: MISIÓN Y VISIÓN
   ========================================================= */
.mv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
}

.mv-card {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: clamp(22px, 3vw, 34px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-top: 5px solid var(--azul-oscuro);
}

.mv-card.vision {
  border-top-color: var(--amarillo-alerta);
}

.mv-card h2 {
  color: var(--azul-oscuro);
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  margin-bottom: 14px;
}

.mv-card p {
  color: #475569;
  line-height: 1.68;
  font-size: clamp(0.92rem, 1.1vw, 1rem);
  white-space: pre-line;
}

/* =========================================================
   RECURSOS: LINKS DE APPS + IMÁGENES CLICABLES
   ========================================================= */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.app-link-card {
  position: relative;
  background: white;
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--azul-oscuro);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--azul-medio);
  transition: transform 0.15s, box-shadow 0.15s;
}

.app-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.app-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.clickable-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.clickable-img-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--azul-oscuro);
  transition: transform 0.15s;
}

.clickable-img-card:hover {
  transform: translateY(-3px);
}

.clickable-img-card img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  background-color: #f8fafc;
  padding: 8px;
  display: block;
}

.clickable-img-caption {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
}

/* =========================================================
   VISIBILIDAD ESTRICTA DE BOTONES ADMIN Y MODO EDICIÓN
   ========================================================= */
.admin-only {
  display: none !important;
}

body.es-admin .admin-only {
  display: inline-flex !important;
}

.edit-only {
  display: none !important;
}

body.es-admin.modo-edicion .edit-only {
  display: inline-flex !important;
}

body.es-admin.modo-edicion .editable-zone {
  outline: 2px dashed #3b82f6;
  outline-offset: 4px;
}

.btn-float {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  background: rgba(15, 23, 42, 0.9);
  color: #f3d03e;
  border: 1px solid #f3d03e;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-float-del {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  background: #dc2626;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
}