
/*
  AVANZA CONTROL V5.4.8
  Navegación lateral para escritorio.
  El menú inferior se conserva en dispositivos móviles.
*/

:root {
  --avanza-sidebar-width: 252px;
  --avanza-sidebar-collapsed: 78px;
  --avanza-sidebar-gap: 14px;
}

/* ==================================================
   ESCRITORIO
   ================================================== */

@media (min-width: 1100px) {
  body.avanza-sidebar-enabled {
    min-height: 100vh;
    overflow-x: hidden;
    background:
      linear-gradient(
        145deg,
        #edf4fa 0%,
        #f7fafc 48%,
        #edf4fa 100%
      );
  }

  body.avanza-sidebar-enabled .app {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-bottom: 0 !important;
  }

  body.avanza-sidebar-enabled #appView {
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    padding-left:
      calc(
        var(--avanza-sidebar-width)
        + (var(--avanza-sidebar-gap) * 2)
      ) !important;
    transition:
      padding-left .22s ease;
  }

  body.avanza-sidebar-enabled
  #appView.hidden {
    display: none !important;
  }

  body.avanza-sidebar-enabled
  .topbar {
    position: sticky !important;
    top: 12px !important;
    z-index: 10;

    width:
      calc(100% - 18px) !important;
    max-width: none !important;

    min-height: 66px !important;
    margin:
      12px 9px 0 !important;
    padding:
      9px 16px !important;

    border:
      1px solid rgba(199, 212, 226, .9);
    border-radius: 17px;

    background:
      rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px);

    box-shadow:
      0 8px 26px
      rgba(7, 31, 61, .075);
  }

  body.avanza-sidebar-enabled
  main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;

    margin: 0 !important;
    padding:
      18px 18px 40px !important;
  }

  /* ==================================================
     CONTENEDOR DEL MENÚ
     ================================================== */

  .desktop-sidebar-v548 {
    position: fixed;
    top: var(--avanza-sidebar-gap);
    bottom: var(--avanza-sidebar-gap);
    left: var(--avanza-sidebar-gap);
    z-index: 30;

    width: var(--avanza-sidebar-width);
    min-width: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border:
      1px solid rgba(187, 204, 220, .92);
    border-radius: 20px;

    background:
      rgba(255, 255, 255, .97);
    backdrop-filter: blur(20px);

    box-shadow:
      0 22px 52px
      rgba(7, 31, 61, .13);

    transition:
      width .22s ease;
  }

  .desktop-sidebar-header-v548 {
    min-height: 78px;
    padding: 14px;

    display: flex;
    align-items: center;
    gap: 11px;

    border-bottom:
      1px solid #e1eaf2;
  }

  .desktop-sidebar-logo-v548 {
    width: 43px;
    height: 43px;
    flex: 0 0 auto;

    padding: 5px;

    border-radius: 13px;
    background: #ffffff;

    box-shadow:
      0 8px 20px
      rgba(7, 31, 61, .11);
  }

  .desktop-sidebar-brand-v548 {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
  }

  .desktop-sidebar-brand-v548 strong {
    display: block;

    color: #071f3d;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .02em;
  }

  .desktop-sidebar-brand-v548 span {
    display: block;
    margin-top: 3px;

    color: #728297;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .05em;
  }

  .desktop-sidebar-toggle-v548 {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;

    display: grid;
    place-items: center;

    padding: 0;
    border: 1px solid #d7e2ec;
    border-radius: 10px;

    background: #f7fafc;
    color: #0b5eb8;

    font-size: 17px;
    font-weight: 900;
    cursor: pointer;

    transition: .18s ease;
  }

  .desktop-sidebar-toggle-v548:hover {
    border-color: #9fc6e9;
    background: #edf6fd;
    transform: translateY(-1px);
  }

  .desktop-sidebar-label-v548 {
    padding: 15px 16px 8px;

    color: #8090a2;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .16em;
    white-space: nowrap;
  }

  .desktop-sidebar-navigation-v548 {
    min-height: 0;
    flex: 1;

    padding: 0 9px 10px;
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color:
      #cbd8e5 transparent;
  }

  /* ==================================================
     NAVEGACIÓN EXISTENTE DENTRO DEL MENÚ LATERAL
     ================================================== */

  .desktop-sidebar-v548 .nav {
    position: static !important;
    inset: auto !important;

    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;

    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-auto-flow: initial !important;
    grid-auto-columns: initial !important;

    gap: 5px;

    transform: none !important;

    padding: 0 !important;
    border: 0 !important;

    background: transparent !important;
    backdrop-filter: none !important;

    box-shadow: none !important;
  }

  .desktop-sidebar-v548
  .nav button {
    position: relative;

    width: 100%;
    min-width: 0;
    min-height: 47px !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;

    gap: 11px !important;

    padding:
      9px 11px !important;

    border:
      1px solid transparent !important;
    border-radius: 12px !important;

    background:
      transparent !important;
    color: #526477 !important;

    font-size: 12px !important;
    font-weight: 750 !important;
    text-align: left;

    cursor: pointer;
    overflow: hidden;

    transition:
      background .16s ease,
      color .16s ease,
      border-color .16s ease,
      transform .16s ease;
  }

  .desktop-sidebar-v548
  .nav button:hover {
    border-color:
      #d8e6f2 !important;

    background:
      #f2f7fb !important;

    color:
      #0b4f91 !important;

    transform:
      translateX(2px);
  }

  .desktop-sidebar-v548
  .nav button.active {
    border-color:
      #bedaf2 !important;

    background:
      linear-gradient(
        135deg,
        #e7f3fd,
        #f1f8fe
      ) !important;

    color:
      #0755a1 !important;

    box-shadow:
      inset 3px 0 0 #0b69c7;
  }

  .desktop-sidebar-v548
  .nav-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;

    display: grid !important;
    place-items: center;

    border-radius: 9px;

    background:
      #edf3f8;

    color:
      #506c87;

    font-size: 16px !important;
    line-height: 1 !important;

    transition: .16s ease;
  }

  .desktop-sidebar-v548
  .nav button.active
  .nav-icon {
    background:
      #0b69c7;

    color: #ffffff;
  }

  .desktop-sidebar-footer-v548 {
    padding: 11px 14px 13px;

    border-top:
      1px solid #e1eaf2;

    background:
      #f8fbfd;
  }

  .desktop-sidebar-footer-v548 strong {
    display: block;

    color: #42566b;
    font-size: 10px;
    white-space: nowrap;
  }

  .desktop-sidebar-footer-v548 span {
    display: block;
    margin-top: 3px;

    color: #8998a8;
    font-size: 9px;
    white-space: nowrap;
  }

  /* ==================================================
     MENÚ CONTRAÍDO
     ================================================== */

  body.avanza-sidebar-collapsed
  #appView {
    padding-left:
      calc(
        var(--avanza-sidebar-collapsed)
        + (var(--avanza-sidebar-gap) * 2)
      ) !important;
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-v548 {
    width:
      var(--avanza-sidebar-collapsed);
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-header-v548 {
    padding: 12px;
    justify-content: center;
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-logo-v548 {
    width: 40px;
    height: 40px;
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-brand-v548,
  body.avanza-sidebar-collapsed
  .desktop-sidebar-label-v548,
  body.avanza-sidebar-collapsed
  .desktop-sidebar-footer-v548 {
    display: none;
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-toggle-v548 {
    position: absolute;
    top: 61px;
    right: 20px;

    width: 34px;
    height: 26px;

    background: #ffffff;
    box-shadow:
      0 5px 14px
      rgba(7, 31, 61, .11);
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-navigation-v548 {
    padding:
      24px 8px 10px;
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-v548
  .nav button {
    justify-content:
      center !important;

    gap: 0 !important;

    padding:
      8px !important;

    font-size: 0 !important;
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-v548
  .nav button:hover {
    transform:
      translateY(-1px);
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-v548
  .nav-icon {
    width: 31px;
    height: 31px;

    font-size: 17px !important;
  }
}

/* ==================================================
   MÓVIL Y TABLETAS PEQUEÑAS
   ================================================== */

@media (max-width: 1099px) {
  .desktop-sidebar-v548 {
    display: none !important;
  }

  body.avanza-sidebar-enabled
  #appView,
  body.avanza-sidebar-collapsed
  #appView {
    padding-left: 0 !important;
  }
}


/* === SIDEBAR REFINADO V548 INICIO === */

:root {
  --avanza-sidebar-width: 274px;
  --avanza-sidebar-collapsed: 76px;
}

@media (min-width: 1100px) {

  /*
    Más espacio para que el nombre institucional
    aparezca completo.
  */
  .desktop-sidebar-v548 {
    width: var(--avanza-sidebar-width);
    border-radius: 21px;
  }

  .desktop-sidebar-header-v548 {
    min-height: 78px;
    padding: 13px 12px;
    gap: 10px;
  }

  .desktop-sidebar-logo-v548 {
    width: 43px;
    height: 43px;
  }

  .desktop-sidebar-brand-v548 {
    padding-right: 2px;
  }

  .desktop-sidebar-brand-v548 strong {
    overflow: visible;
    color: #071f3d;
    font-size: 13px;
    line-height: 1.15;
    letter-spacing: .012em;
    white-space: nowrap;
  }

  .desktop-sidebar-brand-v548 span {
    margin-top: 4px;
    color: #7b8c9e;
    font-size: 8px;
    letter-spacing: .11em;
  }

  /*
    Botón para contraer más discreto.
  */
  .desktop-sidebar-toggle-v548 {
    width: 29px;
    height: 29px;
    border-color: #dce6ef;
    border-radius: 9px;
    background: #f8fafc;
    color: #55718d;
    font-size: 15px;
    box-shadow: none;
  }

  .desktop-sidebar-toggle-v548:hover {
    border-color: #b9d5ec;
    background: #edf6fd;
    color: #0755a1;
    transform: none;
  }

  .desktop-sidebar-label-v548 {
    padding: 16px 16px 9px;
    color: #8493a3;
    font-size: 8px;
    letter-spacing: .17em;
  }

  .desktop-sidebar-navigation-v548 {
    padding: 0 9px 11px;
  }

  /*
    Eliminar líneas y decoraciones heredadas
    de la navegación inferior anterior.
  */
  .desktop-sidebar-v548 .nav button::before,
  .desktop-sidebar-v548 .nav button::after,
  .desktop-sidebar-v548
  .nav button.active::before,
  .desktop-sidebar-v548
  .nav button.active::after {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
    background: none !important;
  }

  .desktop-sidebar-v548 .nav {
    gap: 5px;
  }

  .desktop-sidebar-v548 .nav button {
    min-height: 48px !important;
    gap: 11px !important;
    padding: 8px 11px !important;
    border-radius: 12px !important;
    color: #526579 !important;
    font-size: 12px !important;
    font-weight: 760 !important;
  }

  .desktop-sidebar-v548 .nav button:hover {
    border-color: #d9e6f1 !important;
    background: #f4f8fb !important;
    color: #0a518f !important;
    transform: none;
  }

  .desktop-sidebar-v548 .nav button.active {
    border-color: #b7d7f1 !important;
    background:
      linear-gradient(
        135deg,
        #e9f4fd 0%,
        #f4f9fe 100%
      ) !important;
    color: #0756a3 !important;
    box-shadow:
      inset 3px 0 0 #0b69c7,
      0 4px 12px rgba(11, 105, 199, .07)
      !important;
  }

  .desktop-sidebar-v548 .nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #eef3f7;
    color: #597087;
    font-size: 15px !important;
  }

  .desktop-sidebar-v548
  .nav button.active
  .nav-icon {
    background: #0b69c7;
    color: #ffffff;
    box-shadow:
      0 5px 12px rgba(11, 105, 199, .19);
  }

  /*
    Información del usuario conectado.
  */
  .desktop-sidebar-footer-v548 {
    padding: 11px;
    border-top: 1px solid #e3ebf2;
    background: #f8fbfd;
  }

  .desktop-sidebar-user-v548 {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px;
    border: 1px solid #e0e9f1;
    border-radius: 12px;
    background: #ffffff;
  }

  .desktop-sidebar-user-status-v548 {
    position: relative;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #edf5fc;
    color: #0b5eb8;
    font-size: 12px;
    font-weight: 900;
  }

  .desktop-sidebar-user-status-v548::after {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 9px;
    height: 9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #16a35d;
    content: "";
  }

  .desktop-sidebar-user-info-v548 {
    min-width: 0;
    flex: 1;
  }

  .desktop-sidebar-user-info-v548 strong {
    display: block;
    overflow: hidden;
    color: #253b52;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-sidebar-user-info-v548 span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #78899a;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-sidebar-version-v548 {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #8b99a8;
    font-size: 8px;
  }

  /*
    Menú contraído.
  */
  body.avanza-sidebar-collapsed
  .desktop-sidebar-v548 {
    width: var(--avanza-sidebar-collapsed);
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-toggle-v548 {
    top: 60px;
    right: 20px;
    width: 32px;
    height: 25px;
  }

  body.avanza-sidebar-collapsed
  .desktop-sidebar-v548
  .nav button {
    padding: 8px !important;
  }
}

/* === SIDEBAR REFINADO V548 FIN === */

