/* Importar fuente moderna */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Variables CSS Globales */
:root {
  /* Azul institucional (footer y marca) */
  --brand-blue: #354393;
  --brand-blue-dark: #354393;
  --brand-blue-mid: #4AACC4;
  --brand-blue-light: #4AACC4;

  --primary-color: var(--brand-blue);
  --primary-hover: var(--brand-blue-dark);
  --secondary-color: var(--brand-blue-mid);
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --background: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --home-primary: var(--brand-blue);
  --home-primary-dark: var(--brand-blue-dark);
  --home-secondary: var(--brand-blue-mid);
  --home-accent: var(--brand-blue-light);
  --home-surface: #f8fafc;
  --home-surface-light: #ffffff;
  --home-text: #0f172a;
  --home-text-muted: #64748b;
  --home-border: #e2e8f0;
  --home-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --home-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --home-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --home-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --app-user-sidebar-width: 300px;
  /* Carril lateral (fondo degradado): ancho total de la columna (≈ tarjeta + márgenes mínimos) */
  --app-user-sidebar-track: 316px;
  /* Separación mínima azul visible alrededor de la tarjeta blanca */
  --app-sidebar-edge: 6px;
}

/* Configuración base */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  /* Patrón global: los modales conservan su propio fondo en .modal-content. */
  background-color: #e9f1f5;
  background-image: url('/images/fondo.png');
  /* El modo multiply conserva el blanco del PNG como base y hace legible la trama gris. */
  background-blend-mode: multiply;
  background-position: center top;
  background-repeat: repeat-y;
  background-size: min(1780px, 100%) auto;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Estilos de botones */
.btn {
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

/* "Cancelar": fondo rojo claro, borde rojo más oscuro (sitio) */
.btn.btn-cancelar,
a.btn.btn-cancelar {
  color: #7f1d1d;
  background-color: #fecaca;
  border-color: #b91c1c;
}
.btn.btn-cancelar:hover,
a.btn.btn-cancelar:hover {
  color: #450a0a;
  background-color: #fca5a5;
  border-color: #991b1b;
}
.btn.btn-cancelar:focus-visible,
a.btn.btn-cancelar:focus-visible {
  color: #450a0a;
  background-color: #fca5a5;
  border-color: #991b1b;
  box-shadow: 0 0 0 0.2rem rgba(185, 28, 28, 0.35);
}
.btn.btn-cancelar:active,
a.btn.btn-cancelar:active {
  color: #450a0a;
  background-color: #f87171;
  border-color: #7f1d1d;
}

header {
  position: relative;
  z-index: 3000;
  isolation: isolate;
  padding: 1rem 1.125rem;
}

.navbar {
  position: relative;
  z-index: 3010;
  box-shadow: var(--home-shadow-sm);
  border-bottom: 2px solid var(--home-accent) !important;
  background: var(--home-surface-light) !important;
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  overflow: visible;
}

.navbar .container-fluid,
.navbar .navbar-collapse,
.navbar .navbar-nav,
.nav-item.dropdown {
  position: relative;
  overflow: visible;
}

.navbar .nav-link {
  color: var(--home-text);
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  margin: 0 0.25rem;
  font-size: 0.95rem;
  position: relative;
}

.navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.5rem;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--home-primary);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar .nav-link:hover {
  color: var(--home-primary);
  background: rgba(53, 67, 147, 0.06);
}

.navbar .nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Barra principal: conserva el lenguaje institucional de la cabecera de referencia. */
.app-navbar {
  min-height: 76px;
  padding: 0.75rem 1.5rem;
  background: #0c315a !important;
  border-bottom: 0 !important;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(20, 42, 91, 0.25);
}

.app-navbar .container-fluid {
  min-height: 48px;
}

.app-navbar-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  position: absolute;
  top: 50%;
  left: 1.5rem;
  z-index: 1;
  padding: 0;
  transform: translateY(-50%);
}

.app-navbar:has(.app-navbar-back) .app-navbar-brand {
  left: 5.75rem;
}

.app-navbar-back {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1.25rem;
  text-decoration: none;
  transform: translateY(-50%);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.app-navbar-back:hover,
.app-navbar-back:focus-visible {
  background: #ffffff;
  color: #0c315a;
  transform: translateY(-50%) scale(1.07);
}

.app-navbar-back:focus-visible {
  outline: 3px solid #75d7e9;
  outline-offset: 3px;
}

.app-navbar-logo {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.88);
}

.app-navbar .navbar-collapse {
  justify-content: flex-end;
}

.app-navbar-greeting {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  z-index: 1;
  padding-left: 0.9rem;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  transform: translateY(-50%);
}

.app-navbar-greeting::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 2rem;
  content: "";
  background: #72c6df;
  border-radius: 999px;
  transform: translateY(-50%);
}

.app-navbar .nav-link::after {
  background: #ffffff;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.app-navbar .nav-link.disabled {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.app-navbar .dropdown-menu {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

.app-navbar-welcome {
  margin-left: 1rem;
  padding: 0.55rem 0.9rem;
  color: #1f386f;
  font-weight: 600;
  font-size: 0.9rem;
  background: #ffffff;
  border-radius: 10px;
  white-space: nowrap;
}

.app-navbar-login {
  margin-left: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #ffffff;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 50%;
}

.app-navbar-login:hover,
.app-navbar-login:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.app-navbar .btn-outline-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 1199.98px) {
  .app-navbar {
    padding: 0.75rem 1rem;
  }

  .app-navbar .navbar-toggler {
    z-index: 3;
    margin-left: auto;
    border-color: rgba(255, 255, 255, 0.6);
  }
}

@media (max-width: 575.98px) {
  .app-navbar-back {
    left: 1rem;
    width: 38px;
    height: 38px;
  }

  .app-navbar-logo {
    width: 150px;
  }

  .app-navbar-brand {
    left: 1rem;
  }

  .app-navbar:has(.app-navbar-back) .app-navbar-brand {
    left: 4rem;
  }
}

/* Dropdown con hover - Estilo similar al navbar */
.nav-item.dropdown {
  position: relative;
}

.nav-item.dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-item.dropdown .dropdown-toggle::after {
  margin-left: 0.5em;
  vertical-align: 0.255em;
  transition: transform 0.3s ease;
}



.nav-item.dropdown .dropdown-menu {
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.5rem;
  border: none;
  border-radius: 12px;
  box-shadow: var(--home-shadow-lg);
  padding: 0.5rem;
  background: var(--home-surface-light);
  min-width: 200px;
  position: absolute;
  z-index: 4000 !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--home-primary);
}

.btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline-secondary:hover {
  background: var(--surface);
  border-color: var(--text-secondary);
}

.btn-outline-info {
  color: var(--home-secondary);
  border-color: var(--home-secondary);
}

.btn-outline-warning {
  color: var(--warning-color);
  border-color: var(--warning-color);
}

.btn-outline-danger {
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-group .btn {
  margin-right: 0;
}

.btn-group .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.btn-group .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Estilos de tarjetas */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--background);
}

/* Estilos de tablas */
.table {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table th {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-primary);
  padding: 16px;
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f8fafc;
}

/* Estilos de badges */
.badge {
  border-radius: 20px;
  padding: 4px 12px;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-primary);
}

.badge.bg-success {
  background: var(--success-color) !important;
}

.badge.bg-danger {
  background: var(--danger-color) !important;
}

/* Estilos de formularios */
.form-control {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(53, 67, 147, 0.12);
}

/* Estilos de alertas */
.alert {
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
}

/* Dropdown con hover - Estilo similar al navbar */
.nav-item.dropdown {
  position: relative;
}






.nav-item.dropdown .dropdown-menu.show {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-item.dropdown .dropdown-item {
  color: var(--home-text);
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  margin: 0.25rem 0;
}

.nav-item.dropdown .dropdown-item:hover {
  background: rgba(53, 67, 147, 0.1);
  color: var(--home-primary);
  transform: translateX(4px);
}

.nav-item.dropdown .dropdown-item:active {
  background: rgba(53, 67, 147, 0.15);
  color: var(--home-primary);
}

/* Utilidades de texto */
.text-muted {
  color: var(--text-secondary) !important;
}

.text-white {
  color: white !important;
}

/* Estilos de títulos */
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-weight: 600;
  color: var(--text-primary);
}



.navbar-brand {
  font-weight: 700;
  color: var(--text-primary) !important;
}

/* Utilidades de espaciado y tamaño */
.w-8 {
  width: 2rem;
}

.h-8 {
  height: 2rem;
}

.w-10 {
  width: 2.5rem;
}

.h-10 {
  height: 2.5rem;
}

.mb-6 {
  margin-bottom: 2rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 1rem;
}

.fw-semibold {
  font-weight: 600;
}

.fw-medium {
  font-weight: 500;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

a.text-primary,
.link-primary {
  color: var(--primary-color) !important;
}

a.text-primary:hover,
.link-primary:hover {
  color: var(--primary-hover) !important;
}

.alert-info {
  background: rgba(74, 172, 196, 0.12);
  border-color: rgba(53, 67, 147, 0.18);
  color: var(--home-text);
}

.rounded-circle {
  border-radius: 50% !important;
}

.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-center {
  justify-content: center !important;
}

.small {
  font-size: 0.875rem;
}

.flex-grow-1 {
  flex-grow: 1;
}

.border-0 {
  border: 0 !important;
}

/* Botón flotante moderno (scroll hacia arriba) */
.floating-action-btn {
  position: fixed;
  right: 2rem;
  bottom: 4rem;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--home-primary-dark), var(--home-secondary));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--home-shadow-lg);
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 600;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-action-btn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.floating-action-btn:hover {
  box-shadow: var(--home-shadow-xl);
  transform: translateY(-2px) scale(1.02);
}

.floating-action-btn:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: var(--home-shadow-md);
}

/* ============================================
   Footer moderno
   ============================================ */

.app-footer {
  /* Mismo azul profundo que la portada y el bloque editorial del inicio. */
  background: #0c315a;
  color: #ffffff;
  font-size: 0.9rem;
  border-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.footer-section--organizations {
  text-align: center;
}

.app-footer .footer-heading {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0.75rem;
}

.footer-text {
  color: rgba(255, 255, 255, 0.82);
}

.footer-social {
  max-width: none;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-social-link.social-link-facebook:hover {
  background: linear-gradient(45deg, #1877f2, #1877f2, #1877f2, #1877f2, #1877f2);
  color: #ffffff;
}

.footer-social-link.social-link-instagram:hover {
  background: linear-gradient(45deg, #c13584, #833ab4, #515bd4, #803ab4, #c13584);
  color: #ffffff;
}

.footer-social-link.social-link-twitter:hover {
  background: #202629;
  color: #ffffff;
}


.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.75);
}

.footer-logos .footer-logo {
  height: 48px;
  max-width: 140px;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.95);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.footer-logos .footer-logo:hover {
  transform: translateY(-2px);
  filter: brightness(0) invert(1) opacity(1);
}

.footer-bottom-text {
  color: rgba(255, 255, 255, 0.72);
}

/* En tabletas y pantallas menores, las tres columnas ya no tienen espacio
   suficiente para el contenido de contacto; se muestran una debajo de otra. */
@media (max-width: 991.98px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .app-footer, .footer-section, .footer-section--organizations { text-align: center; }
  .footer-social, .footer-logos { justify-content: center !important; flex-wrap: wrap; }
  .footer-logos {
    flex-direction: column;
    align-items: center;
  }
}

.app-primary-nav-offcanvas {
  width: min(22rem, 88vw);
  border: 0;
  background: #0c315a;
  color: #fff;
}

.app-primary-nav-offcanvas .offcanvas-header {
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.app-primary-nav-offcanvas .offcanvas-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
}

.app-primary-nav-offcanvas .offcanvas-body { padding: 1rem; }

.app-primary-nav-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 3.1rem;
  padding: .7rem .85rem;
  border-radius: .65rem;
  color: rgba(255, 255, 255, .92);
  font-weight: 600;
  text-decoration: none;
}

.app-primary-nav-link:hover,
.app-primary-nav-link:focus { background: rgba(255, 255, 255, .12); color: #fff; }
.app-primary-nav-link i { width: 1.3rem; color: #8ee5ef; font-size: 1.05rem; text-align: center; }
.app-primary-nav-link.is-disabled { cursor: not-allowed; opacity: .5; }

.app-primary-nav-login,
.app-primary-nav-account { border-color: #fff; background: #fff; color: #0c315a; font-weight: 700; }
.app-primary-nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  text-decoration: none;
}
.app-primary-nav-login:hover,
.app-primary-nav-login:focus { background: rgba(255,255,255,.85); color: #0c315a; }
.app-primary-nav-account { border-color: rgba(255,255,255,.68); background: transparent; color: #fff; }

/* ============================================
   Layout genérico: banner de página + contenido
   ============================================ */

.page-banner {
  background: linear-gradient(135deg, var(--home-primary-dark), var(--home-secondary));
  color: #ffffff;
  padding: 2.5rem 0;
  margin-bottom: 2rem;
  box-shadow: var(--home-shadow-md);
}

.page-banner--compact {
  padding: 1.25rem 0;
  border-radius: 0 0 18px 18px;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 55%),
              linear-gradient(135deg, var(--home-primary-dark), var(--home-secondary));
}

.page-banner-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

.page-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.page-pill {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.page-pill-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.35);
}

.page-pill-text {
  white-space: nowrap;
}

.page-content {
  max-width: 1100px;
  margin: 0 auto 3rem auto;
  padding: 0 1rem 2rem 1rem;
}

.form-select.form-select-sm {
  height: calc(1.5em + 0.5rem + 2px);
}

/* Select de categorías en filtros de Novedades: mismo aspecto que form-control-sm */
.form-filtros-novedades .form-select.form-select-sm {
  height: 38px;
  min-height: 38px;
  padding: 8px 2rem 8px 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  background-color: var(--background);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.6rem;
  }

  .page-banner {
    padding: 1.5rem 0;
  }
}

/* Barra lateral de cuenta — panel flotante sobre riel degradado institucional */
.app-shell-main {
  background: linear-gradient(165deg, #eef2fb 0%, var(--surface) 52%, #e4edf8 100%);
}

/* Home con sidebar: el cuerpo usa ancho fluido (sin .container) como antes */
.app-shell-content.app-shell-main--home {
  padding-left: 0;
  padding-right: 0;
  overflow-x: hidden;
}

.app-user-sidebar {
  width: var(--app-user-sidebar-track);
  flex-shrink: 0;
}

/* Carril lateral */
.app-sidebar-rail {
  border-radius: 0;
  overflow: hidden;
  background: #ffffff;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0;
  max-width: 100%;
}

.app-sidebar-brand-logo {
  flex-shrink: 0;
}

.app-sidebar-brand-logo img {
  display: block;
  height: 44px;
  width: auto;
  max-height: 44px;
  /* Logo listo sobre fondo oscuro — suaviza tinte si hace falta */
  filter: brightness(1.06) saturate(0.94) contrast(1.05);
}

.app-sidebar-brand-text {
  min-width: 0;
  color: rgba(255, 255, 255, 0.98);
}

.app-sidebar-brand-line1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.45rem;
  line-height: 1.2;
}

.app-sidebar-brand-sl {
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-sidebar-brand-lp {
  font-weight: 500;
  font-size: 0.78rem;
  opacity: 0.92;
}

.app-sidebar-brand-rule {
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  margin: 0.45rem 0 0.4rem;
  max-width: 11rem;
}

.app-sidebar-brand-min {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.94;
}

.app-sidebar-floating-wrap {
  min-height: 0;
  padding: var(--app-sidebar-edge) var(--app-sidebar-edge) var(--app-sidebar-edge);
  background: #ffffff;
}

.app-sidebar-shell-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--home-surface-light);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

.app-sidebar-scroll {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0.35rem 0.65rem 1rem;
}

.app-sidebar-scroll .card {
  box-shadow: none !important;
}

/* Utilidad para flex dentro del sidebar/offcanvas */
.min-h-0 {
  min-height: 0;
}

/* Cabecera con gradiente (alineada a Mi perfil) */
.app-sidebar-shell-inner .app-sidebar-profile-card {
  margin: 0.35rem 0.8rem 0.55rem;
}

.app-sidebar-profile-card {
  background: linear-gradient(145deg, var(--home-primary-dark), var(--home-secondary));
  color: #ffffff;
  border-radius: 16px;
  padding: 1.1rem 1rem;
  margin: 0.85rem 0.75rem 0.65rem;
  box-shadow: var(--home-shadow-sm);
  text-align: center;
}

.app-sidebar-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  margin: 0 auto 0.75rem;
}

.app-sidebar-display-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.app-sidebar-email {
  opacity: 0.92;
  margin-bottom: 0.55rem;
}

.app-sidebar-role-pill {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Navegación lateral */
.app-sidebar-section-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0.75rem 0.75rem 0.35rem;
  margin: 0;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.app-sidebar-link i:not(.app-sidebar-caret) {
  width: 1.2rem;
  text-align: center;
  color: var(--brand-blue);
  opacity: 0.92;
  font-size: 0.95rem;
}

.app-sidebar-link:hover {
  background: rgba(53, 67, 147, 0.07);
  color: var(--brand-blue);
}

.app-sidebar-link.active {
  background: rgba(74, 172, 196, 0.22);
  color: var(--brand-blue);
  border-color: rgba(53, 67, 147, 0.12);
}

.app-sidebar-divider {
  border: none;
  border-top: 1px solid rgba(53, 67, 147, 0.1);
  margin: 0.65rem 0.75rem;
  opacity: 1;
}

.app-sidebar-nav-group {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.app-sidebar-link-grow {
  flex: 1;
  min-width: 0;
}

.app-sidebar-collapse-btn {
  width: 2.15rem;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.app-sidebar-collapse-btn:hover {
  background: rgba(53, 67, 147, 0.07);
  color: var(--brand-blue);
}

.app-sidebar-caret {
  font-size: 0.72rem;
  transition: transform 0.2s ease;
}

/* Chevron indica estado: abierto = apunta arriba (collapse visible) */
.app-sidebar-collapse-btn:not(.collapsed) .app-sidebar-caret {
  transform: rotate(180deg);
}

.app-sidebar-submenu {
  margin: 0.25rem 0 0.4rem 2.15rem;
  padding-left: 0.35rem;
  border-left: 1px solid rgba(53, 67, 147, 0.18);
}

.app-sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.35rem 0.25rem 0.35rem 0.15rem;
  border-radius: 8px;
  margin-bottom: 0.05rem;
}

.app-sidebar-sublink i {
  color: var(--brand-blue);
  font-size: 0.82rem;
  opacity: 0.92;
}

.app-sidebar-sublink:hover {
  color: var(--brand-blue);
}

.app-sidebar-sublink.active {
  color: var(--brand-blue);
}

.app-sidebar-logout-wrap {
  margin: 0.25rem 0.65rem 0.5rem;
}

.app-sidebar-logout {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--danger-color);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  transition: background 0.2s ease;
}

.app-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.09);
}

.app-sidebar-logout:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.45);
  outline-offset: 2px;
}

#accountSidebarOffcanvas.app-sidebar-offcanvas.offcanvas-start {
  max-width: min(360px, 94vw);
  background: transparent;
}

#accountSidebarOffcanvas .offcanvas-body.app-sidebar-rail {
  overflow: hidden;
}

.app-sidebar-close-floating {
  filter: invert(1);
  opacity: 0.9;
}

.app-sidebar-close-floating:hover {
  opacity: 1;
}

/* Sidebar de gestión — lenguaje visual alineado con TransporteSITRA. */
:root {
  --app-user-sidebar-width: 268px;
  --app-user-sidebar-track: 268px;
  /* Mismo azul marino que el footer y los bloques institucionales del proyecto. */
  --app-sidebar-sitra-blue: #0c315a;
  --app-sidebar-sitra-cyan: #4daec6;
}

.app-shell-main {
  background: #f0f2f7;
}

.app-user-sidebar,
.app-sidebar-rail {
  background: var(--app-sidebar-sitra-blue);
}

.app-sidebar-floating-wrap {
  height: 100%;
  padding: 0;
  background: var(--app-sidebar-sitra-blue);
}

.app-sidebar-shell-inner {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: var(--app-sidebar-sitra-blue);
  box-shadow: none;
}

.app-sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem 0.85rem;
  scrollbar-width: none;
}

.app-sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.app-sidebar-nav {
  gap: 0;
}

.app-sidebar-section-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1.15rem 0.35rem 0.75rem;
  padding: 0;
  color: rgba(173, 198, 232, 0.7);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.app-sidebar-section-label:first-child {
  margin-top: 0;
}

.app-sidebar-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.app-sidebar-link {
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  font-weight: 500;
}

.app-sidebar-link i:not(.app-sidebar-caret) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
}

.app-sidebar-link:hover,
.app-sidebar-link:focus {
  background-color: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.app-sidebar-link.active {
  border: 0;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.app-sidebar-link.active i:not(.app-sidebar-caret) {
  background: rgba(77, 174, 198, 0.22);
  color: #fff;
}

.app-sidebar-divider {
  display: none;
}

.app-sidebar-nav-group {
  gap: 0;
}

.app-sidebar-collapse-btn {
  width: 2.5rem;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
}

.app-sidebar-collapse-btn:hover,
.app-sidebar-collapse-btn:focus {
  background-color: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.app-sidebar-submenu {
  margin: 0.15rem 0 0.2rem 1.05rem;
  padding: 0.1rem 0 0.1rem 0.55rem;
  border-left-color: rgba(255, 255, 255, 0.14);
}

.app-sidebar-sublink {
  gap: 0.6rem;
  padding: 0.4rem 0.45rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 500;
}

.app-sidebar-sublink i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.8rem;
}

.app-sidebar-sublink:hover,
.app-sidebar-sublink.active {
  background-color: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.app-sidebar-sublink.active i {
  background: rgba(77, 174, 198, 0.22);
}

.app-sidebar-logout-wrap {
  margin: 1.15rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-sidebar-logout {
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  font-weight: 500;
}

.app-sidebar-logout:hover {
  background-color: rgba(255, 255, 255, 0.07);
  color: #fff;
}

#accountSidebarOffcanvas.app-sidebar-offcanvas.offcanvas-start {
  background: var(--app-sidebar-sitra-blue);
}

.app-sidebar-close-floating {
  filter: invert(1);
}

/* En escritorio el sidebar es un panel compacto y permanece visible al recorrer el contenido. */
@media (min-width: 992px) {
  .app-header-authenticated {
    width: calc(100% - var(--app-user-sidebar-track));
    margin-left: var(--app-user-sidebar-track);
    padding-left: 1rem;
  }

  .app-header-authenticated .app-navbar-brand {
    left: 1.5rem;
    transform: translateY(-50%);
  }

  .app-header-authenticated .app-navbar-greeting {
    display: none !important;
  }

  .app-shell-main--authenticated {
    width: calc(100% - var(--app-user-sidebar-track)) !important;
    margin-left: var(--app-user-sidebar-track);
  }

  .app-user-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3020;
    align-self: flex-start !important;
    height: fit-content;
    max-height: 100dvh;
    overflow: hidden !important;
  }

  .app-user-sidebar .app-sidebar-rail,
  .app-user-sidebar .app-sidebar-floating-wrap,
  .app-user-sidebar .app-sidebar-shell-inner {
    height: auto !important;
    max-height: 100dvh;
  }

  .app-user-sidebar .app-sidebar-scroll {
    flex: 0 1 auto;
    max-height: 100dvh;
    overflow-y: auto;
  }
}
