:root{
--primary:#d62828; --bg:#0d0f14; --surface:#171b23; --border:#242a36; --text:#e9eef4; --muted:#8b98a9; --danger:#b00020;
}
body.theme-dark{ background:var(--bg); color:var(--text); }
.topbar{ background:linear-gradient(90deg, #0d0f14, #171b23); border-bottom:1px solid var(--border); }
.brand-dot{ width:10px; height:10px; border-radius:50%; background:var(--primary); display:inline-block }
.sidebar{ position:fixed; top:56px; bottom:0; left:0; width:270px; background:var(--surface); border-right:1px solid var(--border); transform:translateX(0); transition:transform .2s ease; z-index:1030 }
.sidebar .logo{ width:120px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.sidebar .nav-link{ color:var(--muted); display:flex; align-items:center; gap:.6rem; padding:.65rem 1rem; border-left:3px solid transparent }
.sidebar .nav-link:hover{ color:var(--text); background:rgba(255,255,255,.04) }
.sidebar .nav-link.active{ color:var(--text); background:rgba(214,40,40,.1); border-left-color:var(--primary) }
@media (max-width: 991.98px){
.sidebar{ transform:translateX(-100%); }
.sidebar.open{ transform:translateX(0); }
}
.main{ margin-left:270px; padding:18px }
@media (max-width: 991.98px){ .main{ margin-left:0 } }
.card-soft{ background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:0 10px 30px rgba(0,0,0,.18) }
.btn-primary{ background:var(--primary); border-color:var(--primary) }
.text-muted{ color:var(--muted)!important }
.badge-soft{ background:rgba(214,40,40,.15); color:#ffdede; border:1px solid rgba(214,40,40,.35) }
.table-dark.table-striped>tbody>tr:nth-of-type(odd)>*{ --bs-table-bg:rgba(255,255,255,.02) }

/* Sidebar com grupos */
.sidebar .nav-group > .nav-link.collapsible{
  width:100%;
  text-align:left;
  justify-content:space-between;
  gap:.6rem;
  cursor:pointer;
  border-left:3px solid transparent;
}
.sidebar .nav-group > .nav-link.collapsible .caret{
  transition: transform .2s ease;
  opacity:.8;
}
.sidebar .nav-group > .nav-link.collapsible.rotate .caret{
  transform: rotate(-180deg);
}

.sidebar .subnav{
  padding-left:.5rem;
  margin:.25rem 0 .5rem 0;
  border-left:1px dashed var(--border);
}
.sidebar .subnav .nav-link{
  padding:.55rem 1rem .55rem 1.25rem;
}
.sidebar .subnav .nav-link.active{
  background: rgba(214,40,40,.12);
  border-left:3px solid var(--primary);
}

/* Ajustes visuais coerentes */
.sidebar .nav-link i.bi{
  font-size:1rem;
  width:1.25rem;
}
