:root {
    --navy: #1e3a5f;
    --navy-light: #2d5282;
    --azure: #3b82f6;
    --azure-dark: #2563eb;
    --azure-light: #60a5fa;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --success: #10b981;
    --error: #ef4444;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ─────────────────────────────────────────── */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: var(--sidebar-width);
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.logo {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: white;
    user-select: none;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}

.sidebar-close:hover {
    color: white;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.nav-section {
    display: block;
    padding: 16px 20px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-item.active {
    background: var(--azure);
    color: white;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    width: 100%;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ── OVERLAY (mobile) ────────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* ── MAIN WRAPPER ────────────────────────────────────── */

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── TOPBAR (mobile only) ────────────────────────────── */

.topbar {
    display: none;
    height: var(--topbar-height);
    background: var(--navy);
    align-items: center;
    padding: 0 20px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.hamburger {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}

.hamburger:hover {
    color: white;
}

.topbar-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 2px;
    color: white;
}

/* ── CONTENT ─────────────────────────────────────────── */

.content {
    flex: 1;
    padding: 32px 36px;
}

/* ── PAGE HEADER ─────────────────────────────────────── */

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 5px;
}

/* ── CARDS ───────────────────────────────────────────── */

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: white;
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--azure);
    transition: box-shadow 0.2s;
}

.kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.kpi-desc {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 6px;
}

/* ── FLASH MESSAGES ──────────────────────────────────── */

.flash {
    margin: 16px 36px 0;
    padding: 13px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    animation: slideDown 0.25s ease;
    transition: opacity 0.3s, transform 0.3s;
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── EMPTY STATE ─────────────────────────────────────── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    gap: 14px;
}

.empty-state-icon {
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
    color: var(--gray-500);
    font-weight: 500;
}

/* ── LOGIN PAGE ──────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

.login-footer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.login-footer a:hover {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.login-logo {
    text-align: center;
    margin-bottom: 6px;
}

.login-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 3px;
}

.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 36px;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 11px 15px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-input:focus {
    border-color: var(--azure);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input::placeholder {
    color: var(--gray-300);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 13px 24px;
    background: var(--azure);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-align: center;
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--azure-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* ── ERROR PAGES ─────────────────────────────────────── */

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    padding: 24px;
}

.error-card {
    text-align: center;
    padding: 40px;
}

.error-code {
    font-size: 88px;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 16px;
}

.error-message {
    font-size: 18px;
    color: var(--gray-500);
    margin-bottom: 32px;
}

/* ── BUTTON SYSTEM ───────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
    width: auto;
    margin-top: 0;
}

.btn:active { transform: scale(0.97); }

.btn.btn-primary {
    background: var(--azure);
    color: white;
}
.btn.btn-primary:hover { background: var(--azure-dark); }

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
}
.btn-outline:hover { border-color: var(--gray-400); color: var(--gray-800); }

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #fecaca;
}
.btn-danger:hover { background: #fecaca; }
.btn-success {
    background: #dcfce7;
    color: #166534;
    border: 1.5px solid #bbf7d0;
}
.btn-success:hover { background: #bbf7d0; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 6px;
}

/* ── PAGE HEADER LAYOUT ──────────────────────────────── */

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── BREADCRUMB ──────────────────────────────────────── */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--azure); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.bc-sep { color: var(--gray-300); }

/* ── FORM EXTRAS ─────────────────────────────────────── */

.form-card { max-width: 620px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.form-textarea {
    min-height: 90px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
}

.form-error-banner {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
}

.required { color: var(--error); margin-left: 2px; }

.inline-form { display: inline; margin: 0; }

/* ── COURSE CARDS ────────────────────────────────────── */

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.2s;
}
.course-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.course-card--inactive { opacity: 0.65; }

.course-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-name {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
}

.course-meta {
    font-size: 12.5px;
    color: var(--gray-500);
}

.course-desc {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--gray-500);
    margin-top: auto;
}

.course-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ── LEVEL BADGES ────────────────────────────────────── */

.level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.level-A1 { background: #d1fae5; color: #065f46; }
.level-A2 { background: #bbf7d0; color: #15803d; }
.level-B1 { background: #dbeafe; color: #1e40af; }
.level-B2 { background: #bfdbfe; color: #1d4ed8; }
.level-C1 { background: #ede9fe; color: #6d28d9; }
.level-C2 { background: #ddd6fe; color: #5b21b6; }

/* ── STATUS BADGES ───────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #f1f5f9; color: var(--gray-500); }

/* ── TABLE ───────────────────────────────────────────── */

.table-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--gray-50); }

.table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

/* ── TABS ────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 2px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    margin-bottom: 20px;
    width: fit-content;
}

.tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.tab:hover { background: var(--gray-100); color: var(--gray-800); }
.tab-active { background: var(--navy); color: white; }
.tab-active:hover { background: var(--navy-light); color: white; }

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    color: inherit;
}
.tab:not(.tab-active) .tab-badge {
    background: var(--gray-200);
    color: var(--gray-600);
}

.tab-content { /* no extra wrapper styles needed */ }

.tab-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
}

/* ── ATTENDANCE BADGES ───────────────────────────────── */

.att-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}
.att-full { background: #d1fae5; color: #065f46; }
.att-ok   { background: #fef9c3; color: #854d0e; }
.att-low  { background: #fee2e2; color: #991b1b; }

/* ── ATTENDANCE CHECKLIST IN MODAL ───────────────────── */

.att-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px 14px;
}

.att-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--gray-700);
    padding: 3px 0;
}
.att-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.att-name { font-weight: 500; }

/* ── MODAL ───────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1100;
    backdrop-filter: blur(2px);
}
.modal-overlay.show { display: block; }

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1200;
    background: white;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    flex-direction: column;
}
.modal.show { display: flex; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-100);
    flex-shrink: 0;
}
.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
}
.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}
.modal-close:hover { color: var(--gray-700); }

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--gray-100);
    flex-shrink: 0;
}

/* ── STUDENT SEARCH RESULTS ──────────────────────────── */

.student-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 12px;
}
.student-result:last-child { border-bottom: none; }

.student-result-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-800);
}
.student-result-email {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ── UTILITY ─────────────────────────────────────────── */

.text-muted { color: var(--gray-500); }
.link-primary { color: var(--azure); text-decoration: none; font-weight: 500; }
.link-primary:hover { text-decoration: underline; }

/* ── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar-close {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar {
        display: flex;
    }

    .content {
        padding: 20px;
    }

    .flash {
        margin: 12px 20px 0;
    }

    .card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .login-card {
        padding: 36px 28px;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 22px;
    }
}

/* ── GRADE BADGES ────────────────────────────────────── */

.grade-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.grade-insufficiente { background: #fee2e2; color: #991b1b; }
.grade-sufficiente   { background: #ffedd5; color: #9a3412; }
.grade-discreto      { background: #fef9c3; color: #854d0e; }
.grade-buono         { background: #dbeafe; color: #1e40af; }
.grade-ottimo        { background: #d1fae5; color: #065f46; }
.grade-eccellente    { background: #bbf7d0; color: #14532d; }

/* ── ADMIN TABLES & UTILITIES ───────────────────────── */

.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--gray-50); }
.data-table tfoot td { padding: 10px 16px; border-top: 2px solid var(--gray-200); font-size: 13px; }
.row-inactive td { opacity: 0.55; }

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }

.action-btns { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

.btn-xs {
    padding: 4px 9px;
    font-size: 11.5px;
    border-radius: 5px;
    white-space: nowrap;
}

.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.role-badge-admin   { background: #ede9fe; color: #6d28d9; }
.role-badge-teacher { background: #dbeafe; color: #1e40af; }
.role-badge-student { background: #d1fae5; color: #065f46; }

/* ── PRINT ───────────────────────────────────────────── */

@media print {
    .no-print { display: none !important; }
    .print-only { display: block !important; }
    body { font-family: Arial, sans-serif; font-size: 10pt; background: white; }
    table { border-collapse: collapse; width: 100%; }
    th, td { border: 1px solid #333; padding: 5px 8px; }
    th {
        background-color: #b8d4e8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    tr:nth-child(even) td {
        background-color: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
