/* =====================================================================
   Estructura de navegación: menú lateral (módulos) y barra superior
   (ruta + submódulos). Solo presentación: rutas, permisos y estados
   activos los siguen decidiendo las vistas.
   ===================================================================== */
:root {
  --sh-navy: #0f2547;
  --sh-ink: #1e293b;
  --sh-muted: #64748b;
  --sh-line: #e5e9ee;
  --sh-soft: #f1f5fb;
  --sh-tile: #eaeff7;
  --sh-blue: #2563eb;
  --sh-blue-soft: #e8f0ff;
}

/* ------------------------------ Menú lateral ------------------------------ */
.eice-sidebar,
.eice-sidebar .nav,
.eice-sidebar .user,
.eice-sidebar .logo { font-family: 'Titillium Web', 'Segoe UI', Roboto, sans-serif; }

.eice-sidebar[data-color="white"] {
  background: #fff;
  border-right: 1px solid var(--sh-line);
  box-shadow: none;
}
.eice-sidebar .logo::after { background-color: var(--sh-line) !important; opacity: 1 !important; }

/* Bloque del usuario */
.eice-sidebar .user {
  margin: 14px 12px 4px !important;
  padding: 0 !important;
  background: var(--sh-soft) !important;
  border: 1px solid #e3e9f3;
  border-radius: 12px;
  /* El tema tapa la barra con una capa blanca (z-index 2): el bloque debe quedar por encima. */
  position: relative;
  z-index: 9;
}
.eice-sidebar .user::after { display: none !important; }
.eice-sidebar .user .photo {
  width: 36px; height: 36px; margin: 9px 0 9px 10px !important;
  background: #fff; border: 1px solid var(--sh-line); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.eice-sidebar .user .photo img { width: 100%; height: 100%; padding: 4px; }
.eice-sidebar .user .info > a {
  display: block; padding: 0 34px 0 8px !important; line-height: 54px !important; height: 54px;
  overflow: hidden; text-overflow: ellipsis;
}
.eice-sidebar[data-color] .user .info > a > span {
  color: var(--sh-navy) !important; font-size: 14px; font-weight: 700; text-transform: none;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eice-sidebar .user .info .caret { top: 24px !important; right: 14px !important; color: var(--sh-muted); }
.eice-sidebar .user .info > a:focus-visible { outline: 2px solid var(--sh-blue); outline-offset: -2px; border-radius: 10px; }

.eice-sidebar .eice-user-menu {
  margin: 0 !important; padding: 6px !important;
  background: #fff !important; border-top: 1px solid var(--sh-line);
  border-radius: 0 0 11px 11px;
  font-weight: 600;
}
.eice-sidebar .eice-user-menu li > a {
  margin: 0 !important; padding: 9px 10px !important; height: auto !important;
  display: flex !important; align-items: center; gap: 10px;
  border-radius: 8px; color: #334155 !important; opacity: 1 !important;
  text-transform: none; font-size: 13.5px; line-height: 1.2 !important;
}
.eice-sidebar .eice-user-menu li > a i {
  float: none; width: 18px; margin: 0; font-size: 14px; line-height: 1; color: var(--sh-muted);
}
/* El tema pinta de blanco los enlaces del usuario: se fija el color en el enlace y en todo lo que contiene. */
.eice-sidebar[data-color] .user .eice-user-menu li > a,
.eice-sidebar[data-color] .user .eice-user-menu li > a .sidebar-normal,
.eice-sidebar[data-color] .user .eice-user-menu li > a span { color: #334155 !important; opacity: 1 !important; line-height: 1.2 !important; font-size: 13.5px; }
.eice-sidebar[data-color] .user .eice-user-menu li > a i { color: var(--sh-muted) !important; }
.eice-sidebar[data-color] .user .eice-user-menu li > a:hover,
.eice-sidebar[data-color] .user .eice-user-menu li > a:hover .sidebar-normal,
.eice-sidebar[data-color] .user .eice-user-menu li > a:hover span { color: var(--sh-navy) !important; }
.eice-sidebar[data-color] .user .eice-user-menu li > a:hover i { color: var(--sh-blue) !important; }
.eice-sidebar .eice-user-menu li > a:hover { background: var(--sh-soft); color: var(--sh-navy) !important; }

/* Lista de módulos */
.eice-sidebar .sidebar-wrapper > .nav { margin-top: 12px; padding: 0 12px; }
.eice-sidebar .sidebar-wrapper > .nav > li > a {
  margin: 2px 0 0 !important; padding: 0 10px !important; height: 46px;
  display: flex; align-items: center; gap: 12px;
  border-radius: 11px; color: #334155 !important; opacity: 1 !important;
  text-transform: none; font-size: 14px; line-height: 1.2;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.eice-sidebar .sidebar-wrapper > .nav > li > a i {
  float: none; margin: 0; flex: 0 0 auto;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--sh-tile); color: #3b5378 !important;
  font-size: 15px; line-height: 1; transition: background .15s ease, color .15s ease;
}
.eice-sidebar .sidebar-wrapper > .nav > li > a p {
  margin: 0; line-height: 1.2; font-size: 14px; font-weight: 600; white-space: normal;
}
.eice-sidebar .sidebar-wrapper > .nav > li > a:hover { background: var(--sh-soft); color: var(--sh-navy) !important; }
.eice-sidebar .sidebar-wrapper > .nav > li > a:hover i { background: #fff; color: var(--sh-blue) !important; }
.eice-sidebar .sidebar-wrapper > .nav > li > a:focus-visible { outline: 2px solid var(--sh-blue); outline-offset: 1px; }

/* Módulo activo: bloque azul marino, sin la flecha del tema */
.eice-sidebar[data-color][data-active-color] .sidebar-wrapper > .nav > li.active > a {
  background: var(--sh-navy); color: #fff !important;
  box-shadow: 0 8px 16px -10px rgba(15, 37, 71, .65);
}
.eice-sidebar[data-color][data-active-color] .sidebar-wrapper > .nav > li.active > a i {
  background: rgba(255, 255, 255, .14); color: #fff !important;
}
.eice-sidebar .sidebar-wrapper > .nav > li.active > a::before,
.eice-sidebar .sidebar-wrapper > .nav > li.active > a::after { display: none !important; content: none !important; }

/* Menú móvil (modal izquierdo): mismo lenguaje */
#modal-left .modal-body ul li > a { display: block; padding: 10px 12px; border-radius: 10px; }
#modal-left .modal-body ul li > a p { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; }
#modal-left .modal-body ul li > a i { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--sh-tile); color: #3b5378; }
#modal-left .modal-body ul li.active > a { background: var(--sh-navy); }
#modal-left .modal-body ul li.active > a p, #modal-left .modal-body ul li.active > a i { color: #fff; }
#modal-left .modal-body ul li.active > a i { background: rgba(255, 255, 255, .14); }

/* ---------------------- Barra superior: ruta y submódulos ---------------------- */
.main-panel > .eice-subnav {
  background: #fff !important; box-shadow: none !important;
  border-bottom: 1px solid var(--sh-line);
  font-family: 'Titillium Web', 'Segoe UI', Roboto, sans-serif;
}

.eice-crumbs { background: transparent !important; padding: 0; font-size: 14px; }
.eice-crumbs .breadcrumb-item { display: flex; align-items: center; color: var(--sh-muted); }
.eice-crumbs .breadcrumb-item + .breadcrumb-item { padding-left: 0; }
.eice-crumbs .breadcrumb-item + .breadcrumb-item::before {
  content: "\f105"; font-family: FontAwesome; color: #b6c0cf; padding: 0 10px; font-size: 13px;
}
.main-panel > .eice-subnav .eice-crumbs .breadcrumb-item > a { color: var(--sh-muted) !important; font-weight: 600; text-decoration: none; opacity: 1; }
.main-panel > .eice-subnav .eice-crumbs .breadcrumb-item > a:hover { color: var(--sh-blue) !important; }
.eice-crumbs .breadcrumb-item a i { margin-right: 4px; }
.eice-crumbs .breadcrumb-item.active span { color: var(--sh-navy); font-weight: 700; }

/* Submódulos: pestañas con indicador inferior */
.eice-subnav #navigation .navbar-nav { display: flex; flex-direction: row; align-items: center; gap: 4px; flex-wrap: wrap; }
.eice-subnav #navigation .navbar-nav .nav-item,
.eice-subnav #navigation .navbar-nav .nav-item.border-left { border: 0 !important; }
.eice-subnav #navigation .navbar-nav .nav-link {
  position: relative; margin: 0; padding: 10px 16px; border-radius: 10px;
  display: flex; align-items: center; text-transform: none;
  transition: background .15s ease;
}
.eice-subnav #navigation .navbar-nav .nav-link p,
.eice-subnav #navigation .navbar-nav .nav-link p.text-dark {
  margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: #475569 !important; transition: color .15s ease;
}
.eice-subnav #navigation .navbar-nav .nav-link:hover { background: var(--sh-soft); }
.eice-subnav #navigation .navbar-nav .nav-link:hover p { color: var(--sh-navy) !important; }
.eice-subnav #navigation .navbar-nav .nav-link:focus-visible { outline: 2px solid var(--sh-blue); outline-offset: 1px; }
.eice-subnav #navigation .navbar-nav .nav-link.is-current { background: var(--sh-blue-soft); }
.eice-subnav #navigation .navbar-nav .nav-link.is-current p { color: #1d4ed8 !important; font-weight: 700; }
.eice-subnav #navigation .navbar-nav .nav-link.is-current::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--sh-blue);
}

@media (max-width: 991px) {
  .eice-subnav #navigation .navbar-nav .nav-link.is-current::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .eice-sidebar *, .eice-subnav * { transition: none !important; }
}

/* ------------------- Menús desplegables de la barra oscura ------------------- */
.eice-topbar .dropdown-menu {
  min-width: 210px; margin-top: 10px; padding: 6px;
  border: 1px solid var(--sh-line); border-radius: 12px;
  box-shadow: 0 16px 32px -12px rgba(15, 37, 71, .35);
  font-family: 'Titillium Web', 'Segoe UI', Roboto, sans-serif;
}
.eice-topbar .dropdown-menu .dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600; text-transform: none;
  color: #334155 !important;
}
.eice-topbar .dropdown-menu .dropdown-item i { width: 18px; text-align: center; font-size: 14px; color: var(--sh-muted); }
.eice-topbar .dropdown-menu .dropdown-item:hover,
.eice-topbar .dropdown-menu .dropdown-item:focus { background: var(--sh-soft); color: var(--sh-navy) !important; }
.eice-topbar .dropdown-menu .dropdown-item:hover i { color: var(--sh-blue); }
.eice-topbar .dropdown-menu .dropdown-divider { margin: 6px 4px; border-top-color: var(--sh-line); }
.eice-topbar .dropdown-menu .eice-logout { color: #b91c1c !important; }
.eice-topbar .dropdown-menu .eice-logout i { color: #b91c1c; }
.eice-topbar .dropdown-menu .eice-logout:hover { background: #fef2f2; color: #991b1b !important; }
.eice-topbar .dropdown-menu .eice-logout:hover i { color: #991b1b; }
