:root {
  --dg-maroon: #932943;
  --dg-maroon-dark: #7a2138;
  --dg-maroon-light: #a8425c;
  --dg-bg: #f2f2f4;
  --dg-sidebar-width: 280px;
}

* { box-sizing: border-box; }

body {
  background: var(--dg-bg);
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
}

.app-wrapper { display: flex; min-height: 100vh; }

/* ---------- SIDEBAR ---------- */
.app-sidebar {
  width: var(--dg-sidebar-width);
  flex-shrink: 0;
  background: var(--dg-maroon);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  padding: 10px 18px;
  min-height: 70px;
  background: #fff;
  border-bottom: 1px solid #e5e5e8;
  border-right: 1px solid #e5e5e8;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sidebar-brand-title {
  font-family: 'Baloo 2', cursive, sans-serif;
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--dg-maroon);
  letter-spacing: .5px;
  margin-top: 1px;
  line-height: 1;
}
.sidebar-brand-sub {
  color: #666666;
  letter-spacing: 1.2px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

.sidebar-nav {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.25);
  border-radius: 3px;
}
.sidebar-nav::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}

.nav-link-item, .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 18px 11px 15px;
  border-left: 3px solid transparent;
  color: #f2dde3;
  text-decoration: none;
  background: transparent;
  font-size: .92rem;
  cursor: pointer;
}
.nav-link-item:hover, .nav-group-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link-item.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; border-left-color: #fff; }

.nav-group-toggle .chevron { transition: transform .2s; font-size: .75rem; flex-shrink: 0; }
.nav-group-toggle.open .chevron { transform: rotate(180deg); }

.nav-sublink {
  display: block;
  padding: 8px 18px 8px 43px;
  border-left: 3px solid transparent;
  color: #f2dde3;
  text-decoration: none;
  font-size: .87rem;
}
.nav-sublink:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-sublink.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; border-left-color: #fff; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.15);
  padding: 6px 0;
}

/* ---------- MAIN ---------- */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  background: #fff;
  min-height: 70px;
  border-bottom: 1px solid #e5e5e8;
}
.topbar-page-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.topbar-page-title h4 {
  font-size: 1.4rem;
  font-weight: 700;
}
.topbar-page-title .text-muted {
  font-size: 0.9rem;
}
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #2b2b2b; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

.app-content { flex: 1; }

/* ---------- CARDS / WIDGETS ---------- */
.stat-card {
  background: #fff;
  border-radius: 8px;
  border-left: 4px solid var(--dg-maroon);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card .stat-label { color: #6b6b6f; font-size: .8rem; text-transform: uppercase; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: #222; }

.card-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  padding: 20px;
}

.btn-maroon {
  background: var(--dg-maroon);
  border-color: var(--dg-maroon);
  color: #fff;
}
.btn-maroon:hover { background: var(--dg-maroon-dark); border-color: var(--dg-maroon-dark); color: #fff; }

.table thead th {
  background: #faf5f6;
  font-size: .78rem;
  text-transform: uppercase;
  color: #6b6b6f;
  border-bottom: 2px solid #eee;
}

.badge-activa { background: #1e9e5a; }
.badge-inactiva { background: #9b9ba1; }

/* ---------- LOGIN ---------- */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(rgba(20,20,20,.55), rgba(20,20,20,.55)),
              url('https://images.unsplash.com/photo-1500595046743-cd271d694d30?auto=format&fit=crop&w=1600&q=60') center/cover no-repeat;
}
.login-card {
  background: #fff;
  border-radius: 10px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.login-card .brand-title { color: var(--dg-maroon); font-weight: 800; font-size: 1.4rem; }
