:root {
  --brand-primary: #2563eb;
  --brand-secondary: #1e293b;
  --sidebar-width: 250px;
}

* { box-sizing: border-box; }

body {
  background: var(--bs-body-bg);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--brand-secondary);
  color: #fff;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .2s ease;
}
.app-sidebar .sidebar-brand { color: #fff; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-sidebar .nav-link { color: rgba(255,255,255,.75); padding: .55rem .75rem; border-radius: .4rem; font-size: .92rem; }
.app-sidebar .nav-link:hover, .app-sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.08); }
.app-sidebar .nav-section { color: rgba(255,255,255,.4); text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; margin: .9rem 0 .25rem .75rem; }

.app-main {
  flex: 1 1 auto;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 1020;
}

.app-content { flex: 1 1 auto; overflow-x: auto; }

.stat-card { border-radius: 1rem; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
}

/* wide content (tables) never overflows the page body */
.table-responsive-scroll { overflow-x: auto; }

/* Login / public pages */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  padding: 1rem;
}
.auth-card { max-width: 420px; width: 100%; border-radius: 1rem; }
