.side-toggle {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.side-menu-button {
  position: fixed;
  z-index: 1040;
  top: 20px;
  left: 20px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
  cursor: pointer;
}

.side-menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 4px;
  background: #212529;
}

.side-menu-overlay {
  position: fixed;
  z-index: 1089;
  inset: 0;
  background: rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.side-menu {
  position: fixed;
  z-index: 1092;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(300px, 86vw);
  padding: 18px;
  background: #fff;
  box-shadow: 8px 0 24px rgba(0, 0, 0, .16);
  transform: translateX(-105%);
  transition: transform .18s ease;
  overscroll-behavior: contain;
}

.side-toggle:checked ~ .side-menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

.side-toggle:checked ~ .side-menu {
  transform: translateX(0);
}

.side-menu-force-closed .side-menu {
  transform: translateX(-105%) !important;
}

.side-menu-force-closed .side-menu-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
}

.side-toggle:checked ~ .side-menu-button {
  opacity: 0;
  pointer-events: none;
}

.modal-open .side-menu-button,
.logistica-modal-open .side-menu-button,
.logistica-modal-open .side-menu-overlay,
.logistica-modal-open .side-menu {
  opacity: 0;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .side-menu-button::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 86vw);
    height: 100vh;
    pointer-events: auto;
    transform: translateX(-100%);
  }

  body:not(.side-menu-hover-disabled) .side-menu-button:hover ~ .side-menu,
  body:not(.side-menu-hover-disabled) .side-menu:hover {
    transform: translateX(0);
  }

  body:not(.side-menu-hover-disabled) .side-menu-button:hover ~ .side-menu-overlay,
  body:not(.side-menu-hover-disabled) .side-menu:hover ~ .side-menu-overlay {
    opacity: 0;
    pointer-events: none;
  }

  body:not(.side-menu-hover-disabled) .side-menu-button:hover {
    opacity: 0;
  }
}

.side-menu-header,
.side-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-menu-header {
  padding-bottom: 14px;
  border-bottom: 1px solid #eef1f3;
}

.side-menu-brand {
  font-size: 1.1rem;
  font-weight: 700;
}

.side-menu-close {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #6b7280;
  background: transparent;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, transform .22s ease;
}

.side-menu-close:hover,
.side-menu-close:focus-visible {
  color: #20242a;
  background: #f1f3f5;
  transform: rotate(90deg);
}

.side-menu-close::before,
.side-menu-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.side-menu-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.side-menu-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 16px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.side-menu-nav::-webkit-scrollbar {
  display: none;
}

.side-menu-item {
  position: relative;
}

.side-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #212529;
  font-weight: 600;
  text-decoration: none;
}

.side-menu-link:hover,
.side-menu-link.active {
  color: #000;
  background: #eef1f4;
}

.side-submenu {
  position: absolute;
  z-index: 1053;
  top: 0;
  left: calc(100% + 8px);
  display: none;
  min-width: 178px;
  padding: 6px;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.side-submenu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 100%;
  width: 20px;
  height: calc(100% + 12px);
}

@media (min-width: 993px) {
  .side-submenu.side-submenu-portal {
    position: fixed;
    z-index: 1093;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
  }

  body.side-submenu-portal-open .side-menu {
    transform: translateX(0);
  }
}

.has-side-submenu:hover > .side-submenu,
.has-side-submenu:focus-within > .side-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-submenu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: #212529;
  background: transparent;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.side-submenu-link > .compass-lucide {
  flex: 0 0 auto;
}

.side-submenu-link > span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-submenu-link:hover,
.side-submenu-link:focus {
  color: #000;
  background: #eef1f4;
}

.side-submenu-form {
  margin: 0;
}

.side-menu-link-home {
  position: relative;
  margin-bottom: 18px;
}

.side-menu-link-admin {
  position: relative;
  margin-top: 18px;
}

.side-menu-link-home::after,
.side-menu-link-admin::before {
  position: absolute;
  left: 50%;
  color: rgba(108, 117, 125, .38);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  content: "...";
  transform: translateX(-50%);
}

.side-menu-link-home::after {
  bottom: -13px;
}

.side-menu-link-admin::before {
  top: -13px;
}

.side-menu-footer {
  padding-top: 14px;
  border-top: 1px solid #eef1f3;
}

.side-menu-footer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.side-user {
  min-width: 0;
  color: #495057;
  font-size: .9rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-logout {
  color: #c62828;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.side-logout:hover {
  text-decoration: underline;
}

@media (min-width: 1800px) {
  .side-menu {
    width: 320px;
  }
}

@media (max-width: 992px) {
  .side-menu-button {
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
  }

  .side-menu {
    width: min(300px, 88vw);
    overflow: hidden;
  }

  .side-menu-nav {
    min-height: 0;
    margin-right: -10px;
    padding-right: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .side-menu-link {
    padding-right: 42px;
  }

  .side-submenu {
    position: static;
    min-width: 0;
    margin-top: 3px;
    margin-left: 22px;
    padding: 5px;
    border-radius: 9px;
    box-shadow: none;
  }

  .side-submenu::before {
    display: none;
  }

  .has-side-submenu:hover > .side-submenu,
  .has-side-submenu:focus-within > .side-submenu {
    display: none !important;
  }

  .has-side-submenu > .submenu-toggle:checked ~ .side-submenu {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
  }

  .has-side-submenu > .submenu-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: inline-flex;
    width: 42px;
    height: 44px;
    line-height: 1;
  }

  .has-side-submenu > .submenu-toggle:checked + .submenu-toggle-btn {
    color: #495057;
    background: transparent;
    transform: none;
  }
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  body:not(.financeiro-report-page) h1 {
    font-size: 1.42rem;
  }

  body:not(.financeiro-report-page) > .container-lg > h1:first-of-type,
  body:not(.financeiro-report-page) > .container-lg > .faturamento-header:first-child > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .financeiro-header:first-child > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .vendas-header:first-child > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .configuracoes-header > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .reposicao-header:first-child > h1:first-child,
  body:not(.financeiro-report-page) > .container-lg > .tabela-view-header:first-child {
    min-height: 40px;
    padding-left: 54px;
  }

  .side-menu {
    width: min(290px, 92vw);
    padding: 16px;
  }

  .side-menu-link {
    padding: 11px 42px 11px 10px;
  }

  .side-submenu {
    position: static;
    min-width: 0;
    margin-top: 3px;
    margin-left: 22px;
    padding: 5px;
    border-radius: 9px;
    box-shadow: none;
  }

  .side-submenu::before {
    display: none;
  }

  .has-side-submenu:hover > .side-submenu,
  .has-side-submenu:focus-within > .side-submenu {
    display: none !important;
  }

  .has-side-submenu > .submenu-toggle:checked ~ .side-submenu {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
  }

  .has-side-submenu > .submenu-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: inline-flex;
    width: 42px;
    height: 46px;
    line-height: 1;
  }

  .has-side-submenu > .submenu-toggle:checked + .submenu-toggle-btn {
    color: #495057;
    background: transparent;
    transform: none;
  }
}

@media (max-width: 576px) {
  body:not(.financeiro-report-page) > .container-lg > h1:first-of-type,
  body:not(.financeiro-report-page) > .container-lg > .faturamento-header:first-child > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .financeiro-header:first-child > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .vendas-header:first-child > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .configuracoes-header > div:first-child,
  body:not(.financeiro-report-page) > .container-lg > .reposicao-header:first-child > h1:first-child,
  body:not(.financeiro-report-page) > .container-lg > .tabela-view-header:first-child {
    padding-left: 54px;
  }
}
