/*
|--------------------------------------------------------------------------
| SIB SHELL CRITICAL
|--------------------------------------------------------------------------
| Objetivo:
| - Evitar el flash de HTML sin estilos.
| - Aplicar desde el primer render la identidad SIB.
| - Unificar topnav, navegación lateral y footer.
| - Neutralizar la dependencia visual de Metropolis.
|--------------------------------------------------------------------------
*/

@font-face {
  font-family: "Metropolis";
  src: local("Segoe UI");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: local("Segoe UI Italic");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --sib-topnav-height: 58px;
  --sib-sidebar-width: 292px;
  --sib-sidebar-mobile-width: min(320px, 88vw);
  --sib-navy: #00205b;
  --sib-blue: #005f9f;
  --sib-cyan: #18a8df;
  --sib-bg: #eaf1f8;
  --sib-white: #ffffff;
  --sib-text: #1d2e47;
  --sib-muted: #66778e;
  --sib-border: #d6e1ec;
  --sib-shadow: 0 12px 30px rgba(0, 32, 91, .13);
}

html {
  min-width: 0;
  background: var(--sib-bg);
}

body,
button,
input,
select,
textarea {
  font-family:
    "Segoe UI",
    Inter,
    Arial,
    sans-serif;
}

body.sib-main-system-body {
  min-width: 0;
  margin: 0;
  padding-top: var(--sib-topnav-height) !important;
  overflow-x: hidden;
  color: var(--sib-text);
  background: var(--sib-bg);
}

/* ==========================================================================
   TOPNAV BOOTSTRAP 5
   ========================================================================== */

.sib-db-topnav {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  z-index: 1060 !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: var(--sib-topnav-height) !important;
  min-height: var(--sib-topnav-height) !important;
  padding: 0 14px !important;
  color: var(--sib-text) !important;
  background: #ffffff !important;
  border: 0 !important;
  border-bottom: 1px solid #d7e2ed !important;
  box-shadow: 0 7px 24px rgba(0, 32, 91, .10) !important;
}

.sib-db-topnav::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--sib-navy),
    var(--sib-blue),
    var(--sib-cyan)
  );
}

.sib-db-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  color: var(--sib-navy) !important;
  background: #eef4fa !important;
  border: 1px solid #d6e1ec !important;
  border-radius: 13px !important;
  box-shadow: none !important;
}

.sib-db-toggle:hover,
.sib-db-toggle:focus {
  color: #ffffff !important;
  background: linear-gradient(
    135deg,
    var(--sib-navy),
    var(--sib-blue)
  ) !important;
}

.sib-db-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 12px 0 8px !important;
  padding: 0 !important;
  color: var(--sib-navy) !important;
  text-decoration: none !important;
}

.sib-db-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid #d3dfeb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 32, 91, .10);
}

.sib-db-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sib-db-brand-copy {
  display: block;
  min-width: 0;
}

.sib-db-brand-copy strong,
.sib-db-brand-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sib-db-brand-copy strong {
  color: var(--sib-navy);
  font-size: .90rem;
  font-weight: 900;
  line-height: 1.1;
}

.sib-db-brand-copy small {
  margin-top: 3px;
  color: var(--sib-muted);
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.sib-db-topnav .navbar-nav {
  gap: 3px;
}

.sib-db-topnav .nav-link,
.sib-db-topnav .sib-db-icon-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px !important;
  color: #34465f !important;
  background: transparent !important;
  border: 0;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}

.sib-db-topnav .nav-link:hover,
.sib-db-topnav .nav-link:focus,
.sib-db-topnav .sib-db-icon-button:hover,
.sib-db-topnav .sib-db-icon-button:focus,
.sib-db-topnav .nav-item.show > .nav-link {
  color: var(--sib-navy) !important;
  background: #edf5fb !important;
}

.sib-db-icon-button {
  width: 40px;
  padding: 0 !important;
  border: 1px solid transparent !important;
}

.sib-db-user-button {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 3px 7px 3px 4px !important;
  color: var(--sib-text) !important;
  background: #f7fafd !important;
  border: 1px solid #d7e2ed !important;
  border-radius: 14px !important;
  text-decoration: none !important;
}

.sib-db-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 11px;
  background: #ffffff;
}

.sib-db-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sib-db-user-copy {
  display: block;
  max-width: 130px;
  text-align: left;
}

.sib-db-user-copy strong,
.sib-db-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sib-db-user-copy strong {
  color: var(--sib-navy);
  font-size: .72rem;
  font-weight: 900;
}

.sib-db-user-copy small {
  color: var(--sib-muted);
  font-size: .58rem;
  font-weight: 700;
}

.sib-db-topnav .dropdown-menu {
  overflow: hidden;
  min-width: 280px;
  padding: 7px !important;
  border: 1px solid #d9e4ef !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 22px 48px rgba(0, 32, 91, .18) !important;
}

.sib-db-topnav .dropdown-header {
  border-radius: 12px;
  color: var(--sib-navy);
  background: #f0f6fb;
}

.sib-db-topnav .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 8px 10px !important;
  color: #33465f !important;
  border-radius: 11px;
  font-size: .75rem;
  font-weight: 750;
}

.sib-db-topnav .dropdown-item:hover,
.sib-db-topnav .dropdown-item:focus {
  color: var(--sib-navy) !important;
  background: #eef6fc !important;
}

.sib-db-dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: #ffffff;
  border-radius: 11px;
  background: linear-gradient(
    135deg,
    var(--sib-navy),
    var(--sib-blue)
  );
}

/* ==========================================================================
   LAYOUT Y MENÚ LATERAL
   ========================================================================== */

body.sib-main-system-body #layoutSidenav {
  display: block !important;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - var(--sib-topnav-height));
  background: var(--sib-bg) !important;
}

body.sib-main-system-body
#layoutSidenav > #layoutSidenav_nav {
  position: fixed !important;
  top: var(--sib-topnav-height) !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1050 !important;
  width: var(--sib-sidebar-width) !important;
  min-width: var(--sib-sidebar-width) !important;
  max-width: var(--sib-sidebar-width) !important;
  height: auto !important;
  overflow: hidden !important;
  transform: translateX(0);
  transition: transform .22s ease;
}

body.sib-main-system-body
#layoutSidenav > #layoutSidenav_content {
  width: calc(100% - var(--sib-sidebar-width)) !important;
  min-width: 0 !important;
  max-width: calc(100% - var(--sib-sidebar-width)) !important;
  min-height: calc(100vh - var(--sib-topnav-height));
  margin-left: var(--sib-sidebar-width) !important;
  overflow-x: hidden;
  background: var(--sib-bg);
  transition:
    width .22s ease,
    max-width .22s ease,
    margin-left .22s ease;
}

body.sib-main-system-body.sb-sidenav-toggled
#layoutSidenav > #layoutSidenav_nav {
  transform: translateX(-100%) !important;
}

body.sib-main-system-body.sb-sidenav-toggled
#layoutSidenav > #layoutSidenav_content {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
}

.sib-side-pro {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(
      circle at 96% 12%,
      rgba(24, 168, 223, .31),
      transparent 29%
    ),
    linear-gradient(
      180deg,
      #00205b 0%,
      #064986 58%,
      #0582bf 100%
    );
  border-right: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 14px 0 34px rgba(0, 32, 91, .20);
}

.sib-side-pro-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .42) transparent;
  -webkit-overflow-scrolling: touch;
}

.sib-side-pro-inner::-webkit-scrollbar {
  width: 8px;
}

.sib-side-pro-inner::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, .42);
  background-clip: padding-box;
}

.sib-side-pro-head {
  flex: 0 0 auto;
  padding: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
  background: rgba(255, 255, 255, .07);
}

.sib-side-pro-search {
  position: relative;
  flex: 0 0 auto;
  margin: 10px 12px 7px;
}

.sib-side-pro-search input {
  width: 100%;
  height: 40px;
  padding: 0 37px;
  color: #ffffff;
  background: rgba(0, 32, 91, .26);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 13px;
  outline: 0;
  font-size: .72rem;
  font-weight: 700;
}

.sib-side-pro-search input::placeholder {
  color: rgba(255, 255, 255, .64);
}

.sib-side-pro-menu {
  flex: 0 0 auto;
  padding: 4px 12px 18px;
  overflow: visible;
}

.sib-side-pro-home-link,
.sib-side-group-toggle,
.sib-side-pro-link {
  text-decoration: none !important;
}

.sib-side-pro-home-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  color: var(--sib-navy) !important;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 15px;
}

.sib-side-group {
  margin-top: 7px;
}

.sib-side-group-toggle {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 49px;
  padding: 7px 9px;
  color: rgba(255, 255, 255, .87);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
}

.sib-side-group-toggle:hover,
.sib-side-group.is-open .sib-side-group-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .14);
}

.sib-side-group-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
}

.sib-side-group.is-open .sib-side-group-panel {
  grid-template-rows: 1fr;
  opacity: 1;
}

.sib-side-group-items {
  min-height: 0;
  overflow: hidden;
}

.sib-side-pro-link {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 43px;
  margin: 4px 0 0 8px;
  padding: 6px 8px;
  color: rgba(255, 255, 255, .82) !important;
  border: 1px solid transparent;
  border-radius: 13px;
}

.sib-side-pro-link:hover,
.sib-side-pro-link.is-active {
  color: var(--sib-navy) !important;
  background: #ffffff;
  border-color: rgba(255, 255, 255, .75);
  transform: translateX(2px);
}

.sib-side-pro-link-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.sib-side-pro-session-wrap {
  position: static !important;
  margin-top: 16px;
  padding: 14px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

/* ==========================================================================
   TOPNAV ALTERNATIVO BOOTSTRAP 4
   ========================================================================== */

.sib-topnav-pro {
  min-height: 58px !important;
  padding: 0 14px !important;
  background: #ffffff !important;
  border-bottom: 3px solid var(--sib-blue);
  box-shadow: 0 7px 24px rgba(0, 32, 91, .10);
}

.sib-topnav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--sib-navy);
  background: #eef4fa;
  border: 1px solid #d6e1ec;
  border-radius: 13px;
}

.sib-topnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: 10px;
  color: var(--sib-navy) !important;
  text-decoration: none !important;
}

.sib-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--sib-navy),
    var(--sib-blue)
  );
  border-radius: 12px;
}

.sib-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.sib-brand-text strong,
.sib-brand-text small {
  display: block;
}

.sib-brand-text strong {
  color: var(--sib-navy);
  font-size: .88rem;
  font-weight: 900;
}

.sib-brand-text small {
  margin-top: 2px;
  color: var(--sib-muted);
  font-size: .59rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sib-topnav-spacer {
  flex: 1 1 auto;
}

.sib-topnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sib-topnav-chip,
.sib-user-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 850;
  text-decoration: none !important;
}

.sib-topnav-chip {
  color: #ffffff !important;
  background: linear-gradient(
    135deg,
    var(--sib-navy),
    var(--sib-blue)
  );
}

.sib-user-button {
  color: var(--sib-navy) !important;
  background: #f4f8fc;
  border: 1px solid #d6e1ec;
}

.sib-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #ffffff;
  background: var(--sib-blue);
  border-radius: 9px;
}

.sib-dropdown-menu {
  overflow: hidden;
  padding: 7px !important;
  border: 1px solid #d8e3ee !important;
  border-radius: 15px !important;
  box-shadow: var(--sib-shadow) !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.sib-shell-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: auto;
  padding: 13px clamp(12px, 1.4vw, 22px);
  color: #dcecff;
  background: linear-gradient(
    135deg,
    #00205b 0%,
    #005f9f 100%
  );
  border-top: 1px solid rgba(255, 255, 255, .13);
}

.sib-shell-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: none;
  margin: 0 auto;
}

.sib-shell-footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sib-shell-footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 11px;
}

.sib-shell-footer-copy strong,
.sib-shell-footer-copy small {
  display: block;
}

.sib-shell-footer-copy strong {
  color: #ffffff;
  font-size: .72rem;
  font-weight: 900;
}

.sib-shell-footer-copy small {
  margin-top: 2px;
  color: #c7def3;
  font-size: .61rem;
}

.sib-shell-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.sib-shell-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  color: #ffffff !important;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  text-decoration: none !important;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 991.98px) {
  .sib-db-topnav {
    padding: 0 8px !important;
  }

  .sib-db-brand-copy small,
  .sib-db-user-copy,
  .sib-db-nav-label {
    display: none !important;
  }

  .sib-db-brand {
    max-width: 180px;
  }

  body.sib-main-system-body
  #layoutSidenav > #layoutSidenav_nav {
    width: var(--sib-sidebar-mobile-width) !important;
    min-width: 0 !important;
    max-width: var(--sib-sidebar-mobile-width) !important;
    transform: translateX(-108%);
  }

  body.sib-main-system-body
  #layoutSidenav > #layoutSidenav_content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  body.sib-main-system-body.sb-sidenav-toggled
  #layoutSidenav > #layoutSidenav_nav {
    transform: translateX(0) !important;
  }

  .sib-topnav-chip span,
  .sib-brand-text small {
    display: none;
  }

  .sib-shell-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .sib-shell-footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 575.98px) {
  .sib-db-brand-copy strong {
    max-width: 140px;
  }

  .sib-db-topnav .sib-hide-xs {
    display: none !important;
  }

  .sib-topnav-chip {
    width: 38px;
    justify-content: center;
    padding: 0;
  }

  .sib-user-button > span:last-child {
    display: none;
  }
}
