:root {
    --brand: #16456b;
    --brand-dark: #0f3350;
    --sidebar-w: 248px;
}
body { background: #f1f4f8; font-size: 14px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand), #1d6fa5); }
.login-card { background: #fff; padding: 2rem; border-radius: 14px; width: 100%; max-width: 380px; }
.brand-badge { width: 54px; height: 54px; border-radius: 14px; background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 26px; }

/* Shell */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: var(--brand-dark); color: #cfe0ee; overflow-y: auto; z-index: 1030; transition: transform .2s; }
.sidebar-brand { padding: 16px 18px; font-size: 18px; font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08); position: sticky; top: 0; background: var(--brand-dark); }
.sidebar-nav { padding: 8px 0 40px; }
.nav-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: #6f97b8; padding: 14px 18px 4px; }
.nav-link-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: #cfe0ee;
    text-decoration: none; cursor: pointer; border-left: 3px solid transparent; }
.nav-link-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link-item.active { background: rgba(255,255,255,.10); color: #fff; border-left-color: #4ea3e0; }
.nav-link-item i { width: 18px; text-align: center; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin .2s; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e3e8ee; display: flex;
    align-items: center; gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 1020; }
.page { padding: 20px; }
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }

/* KPI cards */
.kpi-card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(16,42,67,.07); }
.kpi-card .kpi-label { color: #6b7c8f; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 20px; }

.card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,42,67,.06); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f5; font-weight: 600; }
.page-title { font-size: 20px; font-weight: 700; color: #1b2a3a; }
table.dataTable tbody td { vertical-align: middle; }
.dt-buttons .btn { margin-right: 4px; }
.filter-bar { background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(16,42,67,.06); }
.table-actions .btn { padding: 2px 7px; }
.required-star { color: #d33; }
.tt-cell { min-height: 46px; font-size: 12px; padding: 4px; border-radius: 6px; }
.tt-cell.has-lesson { background: #e8f1fa; border: 1px solid #cfe1f2; }
.cursor-pointer { cursor: pointer; }

/* Global API activity bar (top of viewport) */
#api-loader { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000;
    background: linear-gradient(90deg, #2e8bc0, #4ea3e0, #16456b); opacity: 0;
    transition: width .2s ease, opacity .2s ease; pointer-events: none; }
#api-loader.active { width: 100%; opacity: 1; animation: api-loader-pulse 1.1s ease-in-out infinite; }
@keyframes api-loader-pulse { 0% { opacity: .55 } 50% { opacity: 1 } 100% { opacity: .55 } }

/* Export button toolbar sits above the table */
.dt-export-toolbar { margin-top: -4px; }
button[data-busy="1"], .btn:disabled { cursor: progress; }
