:root { --brand: #4f46e5; --brand-soft: #eef2ff; --sidebar-w: 236px; }
body { background: #f6f7fb; font-size: .925rem; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: #fff; border-right: 1px solid #e5e7eb; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.25rem; font-weight: 700; font-size: 1.15rem; color: #111827; text-decoration: none; }
.logo { background: var(--brand); color: #fff; border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; font-size: .9rem; }
.sidebar .nav-link { color: #4b5563; display: flex; gap: .7rem; align-items: center; padding: .55rem 1.25rem; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: #f9fafb; color: #111827; }
.sidebar .nav-link.active { color: var(--brand); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 600; }
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; position: sticky; top: 0; z-index: 1030; }
.page-title { font-size: 1.1rem; margin: 0; font-weight: 600; }
.context-switch select { width: auto; }
.content { padding: 1.25rem; }
.card { border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.stat { padding: 1rem 1.1rem; }
.stat .label { color: #6b7280; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.45rem; font-weight: 700; }
a.stat-link { text-decoration: none; color: inherit; display: block; }
a.stat-link:hover .card { border-color: var(--brand); }
.class-card.active { background: var(--brand-soft); border-color: var(--brand); }
.class-card.active .label { color: var(--brand); font-weight: 600; }
.table thead th { font-size: .78rem; text-transform: uppercase; color: #6b7280; font-weight: 600; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr[data-href] { cursor: pointer; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.filters .form-control, .filters .form-select { min-width: 140px; }
.empty { text-align: center; color: #6b7280; padding: 2.5rem 1rem; }
.section-title { font-size: .95rem; font-weight: 600; margin-bottom: .75rem; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e5e7eb; padding: .75rem 1rem; margin: 0 -1rem -1rem; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #eef2ff, #f6f7fb); }
.help h2 { font-size: 1.1rem; margin-top: 1.75rem; }
.help ol li { margin-bottom: .35rem; }
.help .hint { background: #fffbeb; border-left: 3px solid #f59e0b; padding: .5rem .75rem; font-size: .875rem; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .main { margin-left: 0; }
  .topbar { flex-wrap: wrap; }
  .context-switch { order: 10; width: 100%; margin-left: 0 !important; }
  .context-switch select { flex: 1; }
}

/* Hamburger: hide / show the sidebar on large screens (remembered); slide-in drawer on phones */
.app.sidebar-hidden .sidebar { transform: translateX(-100%); }
.app.sidebar-hidden .main { margin-left: 0; }
.main { transition: margin-left .2s; }
.view-as-bar { background: #fef3c7; border-bottom: 1px solid #f59e0b; padding: .45rem 1.25rem; font-size: .875rem; }
.back-btn { white-space: nowrap; }
