
/* k */


/* ############################################ */



/* SIDEBAR INTERATIVA STYLES */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
  }
  
  :root {
    /* ===== Colors ===== */
    --body-color: #e4e9f7;
    --sidebar-color: #fff;
    --primary-color: #1449dc;
    --primary-color-light: #f6f5ff;
    --toggle-color: #ddd;
    --text-color: #707070;
  
    /* ====== Transition ====== */
    --tran-03: all 0.3s ease;
    --tran-04: all 0.3s ease;
    --tran-05: all 0.3s ease;
  }
  
  body {
    min-height: 100vh;
    background-color: var(--body-color);
    transition: var(--tran-05);
  }
  
  ::selection {
    background-color: var(--primary-color);
    color: #fff;
  }
  
  body.dark {
    --body-color: #18191a;
    --sidebar-color: #242526;
    --primary-color: #3a3b3c;
    --primary-color-light: #3a3b3c;
    --toggle-color: #fff;
    --text-color: #ccc;
  }
  
  /* ===== Sidebar ===== */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 250px;
    padding: 10px 14px;
    background: var(--sidebar-color);
    transition: var(--tran-05);
    z-index: 100;
  }
  .sidebar.close {
    width: 88px;
  }
  
  /* ===== Reusable code - Here ===== */
  .sidebar li {
    height: 46px;
    list-style: none;
    display: flex;
    align-items: center;
    margin-top: 4px;
  }
  .sidebar .menu-links li:first-child {
    margin-top: 0;
  }
  
  .sidebar header .image,
  .sidebar .icon {
    min-width: 60px;
    border-radius: 6px;
  }
  
  .sidebar .icon {
    min-width: 60px;
    border-radius: 6px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }
  
  .sidebar .text,
  .sidebar .icon {
    color: var(--text-color);
    transition: var(--tran-03);
  }
  
  .sidebar .text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 1;
  }
  .sidebar.close .text {
    opacity: 0;
  }
  /* =========================== */
  
  .sidebar header {
    position: relative;
  }
  
  .sidebar header .image-text {
    display: flex;
    align-items: center;
  }
  .sidebar header .logo-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  header .image-text .name {
    margin-top: 2px;
    font-size: 16px;
    font-weight: 600;
  }
  
  header .image-text .profession {
    font-size: 14px;
    margin-top: -2px;
    display: block;
    color: #707070;
  }
  
  .sidebar header .image {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .sidebar header .image img {
    width: 40px;
    border-radius: 6px;
  }
  
  .sidebar header .toggle {
    position: absolute;
    top: 50%;
    right: -25px;
    transform: translateY(-50%) rotate(180deg);
    height: 25px;
    width: 25px;
    background-color: var(--primary-color);
    color: var(--sidebar-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: var(--tran-05);
  }
  
  body.dark .sidebar header .toggle {
    color: var(--text-color);
  }
  
  .sidebar.close .toggle {
    transform: translateY(-50%) rotate(0deg);
  }
  
  .sidebar .menu {
    margin-top: 8px;
  }
  
  .sidebar li.search-box {
    border-radius: 6px;
    background-color: var(--primary-color-light);
    cursor: pointer;
    transition: var(--tran-05);
  }
  
  .sidebar li.search-box input {
    height: 100%;
    width: 100%;
    outline: none;
    border: none;
    background-color: var(--primary-color-light);
    color: var(--text-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--tran-05);
  }
  .sidebar li a {
    list-style: none;
    height: 100%;
    background-color: transparent;
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
    border-radius: 6px;
    text-decoration: none;
    transition: var(--tran-03);
  }
  
  .sidebar li a:hover {
    background-color: var(--primary-color);
  }
  .sidebar li a:hover .icon,
  .sidebar li a:hover .text {
    color: var(--sidebar-color);
  }
  body.dark .sidebar li a:hover .icon,
  body.dark .sidebar li a:hover .text {
    color: var(--text-color);
  }
 
  .sidebar .menu-bar {
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
  }
  /* Expandida: rola verticalmente se precisar.
     Encolhida: overflow visível para os tooltips "escaparem" da sidebar. */
  .sidebar:not(.close) .menu-bar {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .sidebar.close .menu-bar {
    overflow: visible;
  }
  .menu-bar::-webkit-scrollbar {
    display: none;
  }
  /* Rodapé sempre fixado na base, sem esticar o miolo */
  .sidebar .menu-bar .bottom-content {
    margin-top: auto;
  }
  .sidebar .menu-bar .mode {
    border-radius: 6px;
    background-color: var(--primary-color-light);
    position: relative;
    transition: var(--tran-05);
  }
  .sidebar li a.active {
  background-color: var(--primary-color);
}

.sidebar li a.active .icon,
.sidebar li a.active .text {
  color: var(--sidebar-color);
}

body.dark .sidebar li a.active .icon,
body.dark .sidebar li a.active .text {
  color: var(--text-color);
}
  .menu-bar .mode .sun-moon {
    height: 50px;
    width: 60px;
  }
  
  .mode .sun-moon i {
    position: absolute;
  }
  .mode .sun-moon i.sun {
    opacity: 0;
  }
  body.dark .mode .sun-moon i.sun {
    opacity: 1;
  }
  body.dark .mode .sun-moon i.moon {
    opacity: 0;
  }
  
  .menu-bar .bottom-content .toggle-switch {
    position: absolute;
    right: 0;
    height: 100%;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
  }
  .toggle-switch .switch {
    position: relative;
    height: 22px;
    width: 40px;
    border-radius: 25px;
    background-color: var(--toggle-color);
    transition: var(--tran-05);
  }
  
  .switch::before {
    content: "";
    position: absolute;
    height: 15px;
    width: 15px;
    border-radius: 50%;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    background-color: var(--sidebar-color);
    transition: var(--tran-04);
  }
  
  body.dark .switch::before {
    left: 20px;
  }
  
  .home {
    position: absolute;
    top: 0;
    top: 0;
    left: 250px;
    height: 100vh;
    width: calc(100% - 250px);
    background-color: var(--body-color);
    transition: var(--tran-05);
  }
  .home .text {
    font-size: 30px;
    font-weight: 500;
    color: var(--text-color);
    padding: 12px 60px;
  }
  
  .sidebar.close ~ .home {
    left: 89px;
    height: 100vh;
    width: calc(100% - 89px);
  }
  body.dark .home .text {
    color: var(--text-color);
  }
  
  
  ul.menu-links {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
  }
  
  
  
  @media (max-width: 768px) {
    /* Mantém a sidebar visível e funcional em telas menores,
       reduzindo larguras e os offsets da área principal. */
    .sidebar {
      width: 210px;
    }
    .sidebar.close {
      width: 72px;
    }
    .home {
      left: 210px;
      width: calc(100% - 210px);
    }
    .sidebar.close ~ .home {
      left: 72px;
      width: calc(100% - 72px);
    }
  }
  
/* adicionando css para as imagens na sidebar, e adicionando comportamento  */

/* Brand images */
.sidebar-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  opacity: 1;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.sidebar.close .sidebar-images {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar-images img {
  max-width: 70%;
  height: auto;
  object-fit: contain;
  opacity: 0.75;
  transition: opacity var(--duration-normal);
}
.sidebar-images img:hover { opacity: 1; }
  /* Esconde as imagens quando a sidebar está fechada */
.sidebar.close .sidebar-images {
  /* display: none !important; */
  object-position: -90px 0; /* Recorta 20px da esquerda */
  margin-left: -60px; /* Compensa o recorte */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Garante que as imagens sejam mostradas quando a sidebar está aberta */
.sidebar:not(.close) .sidebar-images {
  display: flex;
}



/* botao de switch dark mode  */
/* Estilos para o novo layout */
.sidebar-header {
  position: relative;
}

.toggle-container {
  position: absolute;
  right: 10px;
  margin-top: -2px;
  top: 20%; /* melhor 20 */
  transform: translateY(-50%);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.header-dark-mode-toggle {
  margin-left: auto;
}

.sidebar.close .toggle-container {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}


body.dark .light-img,
body:not(.dark) .dark-img {
    display: none !important;
}

body.dark .dark-img,
body:not(.dark) .light-img {
    display: block !important;
}


/* Limita a largura do bloco de texto (avatar + nome + switch ocupa ~60px + X) */
.sidebar header .logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Ajuste este valor para caber seu layout:
     250px (sidebar total) − 60px (avatar) − 25px (toggle) − padding */
  max-width: 150px;
}

/* Trunca o nome com reticências */
.sidebar header .logo-text .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ===== Separadores entre as seções (topo / navegação / rodapé) ===== */
.sidebar .sidebar-divider {
  height: 1px;
  border: none;
  background-color: rgba(0, 0, 0, 0.08);
  margin: 8px 4px;
  flex-shrink: 0;
}

body.dark .sidebar .sidebar-divider {
  background-color: rgba(255, 255, 255, 0.10);
}

/* ===== Rodapé (botões de conta + logos) ===== */
.sidebar .bottom-content {
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

.sidebar .bottom-content .sidebar-images {
  margin-top: 8px;
}

/* ===== Botão "Sair" com destaque (vermelho no hover) ===== */
.sidebar li a.logout-link:hover {
  background-color: #e03131;
}

.sidebar li a.logout-link:hover .icon,
.sidebar li a.logout-link:hover .text {
  color: #fff;
}

body.dark .sidebar li a.logout-link:hover .icon,
body.dark .sidebar li a.logout-link:hover .text {
  color: #fff;
}


/* ===== Tooltips (apenas quando a sidebar está encolhida) ===== */
.sidebar li a[data-tooltip] {
  position: relative;
}

.sidebar.close li a[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 6px 11px;
  border-radius: 8px;
  background-color: #1f2430;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 1000;
}

/* Seta do tooltip */
.sidebar.close li a[data-tooltip]::before {
  content: "";
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1f2430;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 1000;
}

.sidebar.close li a[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.sidebar.close li a[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

body.dark .sidebar.close li a[data-tooltip]::after {
  background-color: #3a3f4b;
}
body.dark .sidebar.close li a[data-tooltip]::before {
  border-right-color: #3a3f4b;
}
