:root {
  color-scheme: light;
  --sidebar-width: 280px;
  --sidebar-collapsed: 78px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:window-inactive {
  background: #e5e7eb;
  border: 3px solid transparent;
  background-clip: padding-box;
}

[x-cloak] { display: none !important; }
svg { width: 1.25rem; height: 1.25rem; }
button, a {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.app-conteudo {
  min-height: 100dvh;
  margin-left: calc(var(--sidebar-width) + 12px);
  padding: 14px;
  transition: margin-left .2s ease;
}

.app-conteudo > div {
  min-height: calc(100dvh - 28px);
  border: 1px solid #e4e9f2;
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
  padding: 18px;
}

body.sidebar-recolhida .app-conteudo {
  margin-left: calc(var(--sidebar-collapsed) + 12px);
}

.menu-flutuante { display: none; }
.menu-flutuante.aberto { display: grid; }
.notificacoes-menu.aberto { display: flex !important; }
.recebeu-evento { box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.sem-conexao { color: #b45309 !important; }

.sidebar-mobile-toggle,
.sidebar-mobile-fechar,
.sidebar-overlay { display: none; }
.sidebar-mobile-toggle.oculto { display: none !important; }

.sidebar-app {
  position: fixed;
  inset: 12px auto 12px 12px;
  z-index: 70;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 24px;
  background: #09090b;
  color: #f4f4f5;
  box-shadow: 0 18px 50px rgba(2, 6, 23, .34);
  transition: width .2s ease, transform .2s ease;
}

.sidebar-marca {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-identidade {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: transparent;
}

.sidebar-logo-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-marca-texto { min-width: 0; }
.sidebar-marca strong,
.sidebar-marca small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-marca strong { color: #fff; font-weight: 800; }
.sidebar-marca small { color: #a1a1aa; font-size: .75rem; font-weight: 700; }

.sidebar-app nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .25rem;
  overflow-y: auto;
  padding: 1rem .75rem;
}

.sidebar-app nav a,
.sidebar-recolher {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: .75rem;
  border-radius: .85rem;
  color: #a1a1aa;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-app nav a { padding: .625rem .875rem; }
.sidebar-app nav a:hover:not(.ativo),
.sidebar-recolher:hover {
  color: #f4f4f5;
  background-color: rgba(255, 255, 255, .06);
}

.sidebar-app nav a.ativo {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(79, 70, 229, .18) 0%, rgba(79, 70, 229, .06) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.sidebar-app nav a.ativo i {
  color: #6366f1;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, .4));
}

.sidebar-app nav a.ativo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  width: 3px;
  height: 50%;
  border-radius: 0 4px 4px 0;
  background: #6366f1;
}

.sidebar-rodape {
  margin-top: auto;
  padding: 12px;
}

.sidebar-recolher {
  width: 100%;
  justify-content: flex-start;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  padding: 0 12px;
  cursor: pointer;
}

body.sidebar-recolhida .sidebar-app { width: var(--sidebar-collapsed); }
body.sidebar-recolhida .sidebar-marca {
  justify-content: center;
  padding-inline: 10px;
}
body.sidebar-recolhida .sidebar-identidade,
body.sidebar-recolhida .sidebar-app nav a,
body.sidebar-recolhida .sidebar-recolher { justify-content: center; }
body.sidebar-recolhida .sidebar-marca-texto,
body.sidebar-recolhida .sidebar-mobile-fechar,
body.sidebar-recolhida .sidebar-app nav span,
body.sidebar-recolhida .sidebar-recolher span { display: none; }
body.sidebar-recolhida .sidebar-app nav a,
body.sidebar-recolhida .sidebar-recolher { padding-inline: 0; }
body.sidebar-recolhida .sidebar-logo-avatar {
  width: 42px;
  height: 42px;
}

.notificacao-wrap .notificacoes-menu,
.usuario-topo .usuario-menu {
  border-radius: 22px !important;
  border: 1px solid #e4e9f2 !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: 0 22px 50px rgba(15, 23, 42, .16) !important;
}

.notificacoes-menu::before,
.usuario-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 24px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-left: 1px solid #e4e9f2;
  border-top: 1px solid #e4e9f2;
  background: #fff;
}

.notificacao b {
  box-shadow: 0 8px 18px rgba(79, 70, 229, .26);
}

.modal-senha.grid { display: grid; }

@media (max-width: 1023px) {
  .app-conteudo,
  body.sidebar-recolhida .app-conteudo,
  body.sidebar-aberta .app-conteudo {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    padding: 8px;
  }

  .app-conteudo > div {
    width: 100%;
    max-width: 100%;
    min-height: calc(100dvh - 16px);
    border-radius: 18px;
    padding: 0;
  }

  .sidebar-app,
  body.sidebar-recolhida .sidebar-app {
    width: min(300px, calc(100vw - 24px));
    transform: translateX(calc(-100% - 24px));
  }

  body.sidebar-aberta .sidebar-app {
    transform: translateX(0);
  }

  .sidebar-mobile-toggle {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    color: #27272a;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
  }

  .sidebar-mobile-fechar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    color: #a1a1aa;
    background: rgba(255, 255, 255, .04);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(3px);
  }

  body.sidebar-aberta .sidebar-overlay {
    display: block;
  }

  body.sidebar-recolhida .sidebar-marca-texto,
  body.sidebar-recolhida .sidebar-app nav span,
  body.sidebar-recolhida .sidebar-recolher span {
    display: inline;
  }

  body.sidebar-recolhida .sidebar-marca {
    justify-content: space-between;
    padding: 16px;
  }

  body.sidebar-recolhida .sidebar-identidade,
  body.sidebar-recolhida .sidebar-app nav a,
  body.sidebar-recolhida .sidebar-recolher {
    justify-content: flex-start;
  }

  body.sidebar-recolhida .sidebar-app nav a {
    padding: .625rem .875rem;
  }

  body.sidebar-recolhida .sidebar-recolher {
    padding: 0 12px;
  }
}
