:root{
  --brand-teal: #0B4678;
  --brand-lime: #2190CC;
  --brand-slate:#3B4047;
}
.text-teal{ color: var(--brand-teal) !important; }

/* Sidebar */
.sidebar-wrap{
  width: 280px;
  transform: translateX(0);
  transition: transform .25s ease;
  z-index: 1040;
  background: #fff; /* background padrão */
  height: 100vh;
  overflow: hidden; /* scroll fica só no menu */
}

.sidebar-scroll{
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  flex-wrap: nowrap; /* evita quebrar itens em colunas ao lado */
}
@media (max-width: 1199.98px){
  .sidebar-wrap{ transform: translateX(-100%); }
  .sidebar-wrap.show{ transform: translateX(0); }
}

/* Área do logo + botão "Alterar Logo" (responsivo) */
.sidebar-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-logo-wrap > a:first-child {
  flex: 1;
  min-width: 0;
}
.sidebar-logo-edit {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #555;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.sidebar-logo-edit:hover {
  color: #0066cc;
  background-color: #e8f0fe;
}
.sidebar-logo-edit svg {
  display: block;
}
@media (max-width: 1199.98px) {
  .sidebar-logo-edit {
    width: 32px;
    height: 32px;
    right: 2px;
  }
  .sidebar-logo-edit svg {
    width: 18px;
    height: 18px;
  }
}
.nav-link{
  color: #3b4047;
  border-radius: 10px;
  padding: .6rem .75rem;
  margin: .15rem .25rem;
}
.nav-link:hover{ background: rgba(0,0,0,.04); color: #111; }
.sidebar-wrap .nav-link.active{ background: var(--brand-teal) !important; color: #fff !important; }
.sidebar-wrap .nav-link.active .badge{ background-color: rgba(255,255,255,.25) !important; color: #fff !important; }

/* Submenu */
.submenu-arrow{
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  font-size: 0.75rem;
}
.nav-link[aria-expanded="true"] .submenu-arrow{
  transform: rotate(180deg);
}
/* Abertura/fechamento do submenu Configurações (Bootstrap .collapsing) */
.sidebar-wrap #configSubmenu.collapsing{
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.collapse .nav-link{
  font-size: 0.875rem;
  padding: .5rem .75rem;
}
@media (prefers-reduced-motion: reduce){
  .sidebar-wrap #configSubmenu.collapsing{
    transition-duration: 0.01ms !important;
  }
  .submenu-arrow{
    transition-duration: 0.01ms;
  }
}

/* Topbar */
.topbar{
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  position: sticky;
  top: 0;
  z-index: 1030;
  padding-left: 296px; /* compensar sidebar fixa */
}
.topbars{
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  position: sticky;
  top: 0;
  z-index: 1030;
}
@media (max-width: 1199.98px){
  .topbars{ padding-left: 16px; }
}

@media (max-width: 1199.98px){
  .topbar{ padding-left: 16px; }
}
main{ padding-left: 296px; }
@media (max-width: 1199.98px){
  main{ padding-left: 0; }
}

/* Avatar placeholder */
.avatar{
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-lime), var(--brand-teal));
  box-shadow: inset 0 0 0 2px #fff, 0 2px 8px rgba(0,0,0,.08);
  color: black;
}

/* Loading transition */
#app-content{
  transition: opacity .25s ease;
}

/* Dark mode */
html[data-bs-theme="dark"] body{ background:#0f1115; }
html[data-bs-theme="dark"] .topbar,
html[data-bs-theme="dark"] .card{ background:#171a21; color:#e6e6e6; }

/* Sidebar dark mode */
html[data-bs-theme="dark"] .sidebar-wrap{ 
  background: #171a21 !important; 
  color: #e6e6e6 !important; 
  border-right-color: rgba(255,255,255,.1) !important; 
}

html[data-bs-theme="dark"] .sidebar-wrap .nav-link{ 
  color: #c9c9c9 !important; 
}

html[data-bs-theme="dark"] .sidebar-wrap .nav-link:hover{ 
  background: rgba(255,255,255,.05) !important; 
  color: #fff !important; 
}

html[data-bs-theme="dark"] .sidebar-wrap .nav-link.active{ 
  background: var(--brand-teal) !important; 
  color: #fff !important; 
}

html[data-bs-theme="dark"] .sidebar-wrap .nav-link.active .badge{ 
  background-color: rgba(255,255,255,.25) !important; 
  color: #fff !important; 
}

html[data-bs-theme="dark"] .sidebar-wrap .text-dark{ 
  color: #e6e6e6 !important; 
}

html[data-bs-theme="dark"] .sidebar-wrap .text-muted{ 
  color: #888 !important; 
}
html[data-bs-theme="dark"] .sidebar-logo-edit {
  color: #a0aec0;
}
html[data-bs-theme="dark"] .sidebar-logo-edit:hover {
  color: #63b3ed;
  background-color: rgba(99, 179, 237, 0.15);
}

html[data-bs-theme="dark"] .sidebar-wrap .badge.text-bg-secondary{ 
  background-color: #3d4451 !important; 
  color: #c9c9c9 !important; 
}

html[data-bs-theme="dark"] .sidebar-wrap .badge.text-bg-success{ 
  background-color: #198754 !important; 
  color: #fff !important; 
}

/* Topbar dark mode */
html[data-bs-theme="dark"] .topbar{ border-bottom-color: rgba(255,255,255,.1) !important; }

/* Avatar dark mode */
html[data-bs-theme="dark"] .avatar{ box-shadow: inset 0 0 0 2px #171a21, 0 2px 8px rgba(0,0,0,.3); }

/* Cards e tabelas dark mode */
html[data-bs-theme="dark"] .table{ color: #c9c9c9; }
html[data-bs-theme="dark"] .table-light{ background: #1f2329 !important; color: #c9c9c9 !important; }
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select{ background: #1f2329; border-color: rgba(255,255,255,.1); color: #e6e6e6; }

/* Botões dark mode */
html[data-bs-theme="dark"] .btn-outline-secondary{ 
  border-color: rgba(255,255,255,.2); 
  color: #c9c9c9; 
}
html[data-bs-theme="dark"] .btn-outline-secondary:hover{ 
  background: rgba(255,255,255,.1); 
  border-color: rgba(255,255,255,.3); 
  color: #fff; 
}
html[data-bs-theme="dark"] .btn-outline-dark{ 
  border-color: rgba(255,255,255,.2); 
  color: #c9c9c9; 
}
html[data-bs-theme="dark"] .btn-outline-dark:hover{ 
  background: rgba(255,255,255,.1); 
  border-color: rgba(255,255,255,.3); 
  color: #fff; 
}

/* Badges dark mode */
html[data-bs-theme="dark"] .text-bg-secondary{ background: #3d4451 !important; }

/* Links dark mode */
html[data-bs-theme="dark"] a{ color: #6eb9ff; }
html[data-bs-theme="dark"] a:hover{ color: #8fcaff; }

