:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #f5f3ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

/* Login */
.login-body {
    min-height: 100vh;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.login-card {
    width: min(1160px, 100%);
    min-height: 720px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

.login-panel {
    padding: 34px 28px;
    display: flex;
    flex-direction: column;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 19px;
    color: var(--text-main);
}

.login-brand-logo {
    width: min(190px, 100%);
    height: auto;
    display: block;
}

.login-logo {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.login-form-wrap {
    width: min(360px, 100%);
    margin: auto;
}

.login-form-wrap h1 {
    margin-bottom: 10px;
    color: #111827;
    font-size: 34px;
    line-height: 1.1;
    text-align: center;
}

.login-form-wrap .muted {
    margin-bottom: 34px;
    color: #8a94a6;
    text-align: center;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: #111827;
    font-size: 12px;
}

.login-form input,
.login-form select {
    width: 100%;
    height: 46px;
    border-radius: 8px;
    border-color: #e5e7eb;
    background: #fff;
    color: #111827;
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.login-form button {
    height: 48px;
    margin-top: 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4f46e5, #5b5ff4);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

.login-switch-row {
    display: flex;
    justify-content: center;
}

.login-switch-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #dbe4ff;
    border-radius: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    background: #f8faff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.login-switch-link:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: var(--primary-hover);
}

.login-showcase {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    color: #fff;
    background:
        radial-gradient(circle at 25% 0%, rgba(255,255,255,0.12) 0 22%, transparent 23%),
        radial-gradient(circle at 95% 75%, rgba(255,255,255,0.10) 0 26%, transparent 27%),
        linear-gradient(135deg, #4f46e5, #3b38f2);
}

.login-showcase::before,
.login-showcase::after {
    content: "";
    position: absolute;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
}

.login-showcase::before {
    width: 210px;
    height: 210px;
    right: 52px;
    bottom: 72px;
}

.login-showcase::after {
    width: 170px;
    height: 170px;
    left: 38px;
    bottom: -28px;
}

.showcase-content {
    position: relative;
    z-index: 1;
    min-height: 100%;
    padding: 150px 64px 64px;
}

.showcase-content h2 {
    max-width: 440px;
    margin-bottom: 10px;
    font-size: 30px;
    line-height: 1.28;
    font-weight: 700;
}

.showcase-content p {
    max-width: 440px;
    color: rgba(255, 255, 255, 0.78);
}

.showcase-dashboard {
    width: min(430px, 100%);
    margin-top: 38px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 60px rgba(30, 41, 59, 0.32);
}

.showcase-card {
    min-height: 96px;
    padding: 14px;
    border: 1px solid #edf0f7;
    border-radius: 8px;
    background: #fff;
    color: #111827;
}

.showcase-card span {
    display: block;
    color: #8a94a6;
    font-size: 11px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    color: var(--primary);
    font-size: 28px;
}

.mini-bars {
    height: 54px;
    margin-top: 16px;
    display: flex;
    align-items: end;
    gap: 8px;
}

.mini-bars i {
    flex: 1;
    border-radius: 999px 999px 3px 3px;
    background: linear-gradient(180deg, #6d5dfc, #c4b5fd);
}

.mini-bars i:nth-child(1) { height: 38%; }
.mini-bars i:nth-child(2) { height: 68%; }
.mini-bars i:nth-child(3) { height: 48%; }
.mini-bars i:nth-child(4) { height: 86%; }
.mini-bars i:nth-child(5) { height: 62%; }

.donut-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at center, #fff 0 38%, transparent 39%),
        conic-gradient(#5b5ff4 0 86%, #e5e7eb 0);
}

.donut-card strong {
    align-self: center;
    margin-top: 10px;
    font-size: 24px;
}

.table-card {
    display: grid;
    gap: 10px;
}

.table-card span {
    height: 12px;
    border-radius: 999px;
    background: #eef2ff;
}

.table-card span:nth-child(2) { width: 78%; }
.table-card span:nth-child(3) { width: 56%; }

/* Student Area */
.student-body {
    min-height: 100vh;
    background: #f8fafc;
}

.topbar {
    max-width: 1180px;
    margin: 24px auto 0;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.student-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.student-user .user-avatar {
    flex: 0 0 auto;
}

.student-nav {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
    background: #f1f5f9;
}

.student-nav a {
    padding: 8px 12px;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.student-nav a.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.topbar .inline {
    margin: 0;
}

.container {
    max-width: 1180px;
    margin: 24px auto 48px;
    padding: 0;
}

.student-body .flash-wrap {
    max-width: 1180px;
    margin: 0 auto 24px;
}

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

.student-test-card {
    min-height: 230px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.student-test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.student-test-card h3 {
    margin-bottom: 12px;
    color: var(--text-main);
    font-size: 20px;
    line-height: 1.35;
}

.student-test-card p {
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 14px;
}

.test-meta {
    display: inline-flex;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.student-test-action {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.student-test-action:hover {
    background: var(--primary-hover);
}

.results-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.results-kpi {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
    text-align: center;
}

.results-kpi-label {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.results-kpi-value {
    margin-top: 12px;
    color: var(--text-main);
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.chart-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.chart-card h3 {
    margin-bottom: 14px;
    font-size: 17px;
    text-align: center;
}

.chart-card:last-child {
    grid-column: span 2;
}

.chart-canvas {
    display: block;
    width: 100%;
    height: 240px;
}

.results-table-wrap {
    margin-top: 24px;
}

.results-table {
    min-width: 820px;
}

.results-table th,
.results-table td {
    text-align: center !important;
    vertical-align: middle;
}

.results-table th * {
    text-align: center;
}

.question-item {
    padding: 20px 0;
}

.question-item > p {
    margin-bottom: 14px;
}

.radio-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
    width: fit-content;
    min-width: 220px;
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
}

.radio-row:hover {
    background: #f8fafc;
    border-color: var(--border);
}

.radio-row input[type="radio"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.radio-row span {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
}

.radio-row:has(input[type="radio"]:checked) {
    background: #eef2ff;
    border-color: #c7d2fe;
}

@media (max-width: 900px) {
    .login-body {
        padding: 16px;
        align-items: stretch;
    }

    .login-card {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-panel {
        min-height: 620px;
    }

    .login-showcase {
        display: none;
    }

    .topbar {
        margin: 16px;
        grid-template-columns: 1fr;
    }

    .student-nav {
        width: 100%;
    }

    .student-nav a {
        flex: 1;
        text-align: center;
    }

    .container {
        margin: 16px;
    }

    .compact-form {
        width: 100%;
    }

    .results-kpi-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card:last-child {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .login-panel {
        min-height: 560px;
        padding: 24px 18px;
    }

    .login-form-wrap h1 {
        font-size: 28px;
    }
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding: 0;
    text-decoration: none;
}

.sidebar-logo-img {
    width: 100%;
    max-width: 190px;
    height: auto;
    display: block;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav-item i {
    font-size: 18px;
}

.sidebar-nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-subnav {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin: -2px 0 8px 42px;
}

.sidebar-subnav.open {
    display: flex;
}

.sidebar-subnav a {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.sidebar-subnav a:hover,
.sidebar-subnav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 12px;
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: #fee2e2;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.dashboard-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    min-width: 0;
    overflow-x: hidden;
}

.content-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 40px;
}

.page-title {
    grid-column: 2;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
}

.header-actions {
    grid-column: 3;
    justify-self: end;
}

.center-title {
    text-align: center;
}

.page-container > h2 {
    text-align: center;
}

.current-date {
    color: var(--text-muted);
    font-size: 14px;
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.stats-clickable {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.stats-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.stats-clickable.active {
    outline: 2px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 16px 34px rgba(99, 102, 241, 0.16);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
}

.stat-footer {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-trend {
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 700;
}

.stat-trend.up { background: #dcfce7; color: #10b981; }
.stat-trend.down { background: #fee2e2; color: #ef4444; }

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 32px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
}

/* Charts */
.bar-chart-v {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    padding-top: 20px;
}

.bar-v-item {
    width: 40px;
    background: #e0e7ff;
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all 0.3s;
}

.bar-v-item:hover, .bar-v-item.active {
    background: var(--primary);
}

.bar-v-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-muted);
}

.stats-chart-card {
    min-height: 320px;
}

.stats-bar-chart {
    display: grid;
    gap: 16px;
}

.stats-bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 170px) 1fr minmax(54px, auto);
    align-items: center;
    gap: 14px;
}

.stats-bar-row:hover .stats-bar-track,
.stats-bar-row.active .stats-bar-track {
    background: #cbd5e1;
}

.stats-bar-row.active .stats-bar-label {
    color: var(--primary);
}

.stats-bar-label {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-bar-track {
    height: 14px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.stats-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: inherit;
    min-width: 8px;
}

.stats-bar-value {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.stats-empty {
    margin: 0;
    padding: 48px 0;
    text-align: center;
}

.stats-detail-card {
    margin-top: 0;
}

.stats-detail-panel {
    display: none;
}

.stats-detail-panel.active {
    display: block;
}

.stats-detail-table th,
.stats-detail-table td {
    text-align: center;
    vertical-align: middle;
}

.stats-detail-table th:first-child,
.stats-detail-table td:first-child {
    text-align: left;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 900px) {
    .test-main-row,
    .test-settings-row,
    .test-toggle-grid,
    .single-question-form .test-settings-row,
    .add-answer-row {
        grid-template-columns: 1fr;
    }

    .test-preview-question-head {
        align-items: stretch;
        flex-direction: column;
    }

    .test-edit-points {
        min-width: 0;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .stats-bar-row {
        grid-template-columns: 1fr minmax(48px, auto);
        gap: 8px 12px;
    }

    .stats-bar-label {
        grid-column: 1 / -1;
    }
}

/* Tables */
.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
}

.premium-table td {
    padding: 20px 16px;
    border-bottom: 1px solid #f8fafc;
    font-size: 14px;
}

.badge {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active { background: #dcfce7; color: #10b981; }
.badge-completed { background: #e0f2fe; color: #0369a1; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-expired { background: #fee2e2; color: #ef4444; }

.action-btn-view {
    padding: 8px 20px;
    background: #f1f5f9;
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
}

.action-btn-view:hover {
    background: var(--primary);
    color: #fff;
}

/* General UI */
.card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card h2,
.dashboard-card h2 {
    text-align: center;
}

.grid-form {
    display: grid;
    gap: 16px;
}

.compact-form {
    width: 50%;
    margin: 0;
}

.test-settings-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.test-settings-row-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.test-settings-row-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.test-main-row {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(180px, 1fr);
    gap: 16px;
    align-items: end;
}

.test-main-row label {
    min-width: 0;
}

.test-main-row input,
.test-main-row select {
    width: 100%;
}

.test-settings-row label {
    min-width: 0;
}

.test-title-field input {
    width: 100%;
}

.teacher-notes-row {
    grid-template-columns: 1fr;
}

.teacher-notes-field textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
}

.student-create-form {
    width: 100%;
    overflow: visible;
}

.student-create-card,
.student-create-card form,
.student-form-stack {
    overflow: visible;
}

.student-create-card {
    min-height: 620px;
    padding-bottom: 32px;
}

.student-view-card h2 {
    margin-bottom: 18px;
}

.student-profile {
    display: grid;
    gap: 14px;
}

.student-profile h3 {
    margin: 14px 0 2px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.student-profile h3:first-child {
    margin-top: 0;
}

.student-profile-rows {
    border-top: 1px solid #e2e8f0;
}

.student-profile-row {
    display: grid;
    grid-template-columns: minmax(130px, 18%) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    min-height: 32px;
    border-bottom: 1px solid #e2e8f0;
    color: #4b5563;
    font-size: 12px;
}

.student-profile-label {
    color: #6b7280;
}

.student-profile-value {
    min-width: 0;
    color: #4b5563;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.student-profile-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.student-profile-badge-payment {
    background: #6366f1;
}

.student-profile-badge-status {
    background: #22a06b;
}

.student-profile-badge-status.inactive {
    background: #94a3b8;
}

.student-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.student-form-stack {
    display: grid;
    gap: 18px;
}

.student-form-primary-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: end;
}

.student-form-secondary-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.student-form-parent-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: end;
}

.student-form-address-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.student-form-account-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.student-form-stack > label {
    display: block;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-primary-row > label {
    display: block;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-secondary-row > label {
    display: block;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-parent-row > label {
    display: block;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-address-row > label {
    display: block;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-account-row > label {
    display: block;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-stack > label input,
.student-form-stack > label select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-primary-row > label input,
.student-form-primary-row > label select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-secondary-row > label input,
.student-form-secondary-row > label select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-parent-row > label input,
.student-form-parent-row > label select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-address-row > label input,
.student-form-address-row > label select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-account-row > label input,
.student-form-account-row > label select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-account-row > label input::placeholder {
    color: #94a3b8;
}

.student-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.student-form-grid label {
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-grid input,
.student-form-grid select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-field-wide {
    grid-column: span 2;
}

.student-form-row {
    display: grid;
    gap: 14px;
    align-items: end;
}

.student-form-row-main {
    grid-template-columns: minmax(260px, 1.15fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) minmax(240px, 1.15fr);
}

.student-form-row-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-form-row-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-form-row label {
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.student-form-row input,
.student-form-row select {
    width: 100%;
    min-height: 46px;
    border-color: #bfdbfe;
    background: #fff;
}

.student-form-row datalist {
    display: none;
}

.student-create-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 28px;
    padding-top: 6px;
}

.student-form-stack > .student-create-actions ~ .student-create-actions {
    display: none !important;
}

.student-create-actions button {
    min-width: 180px;
    font-size: 16px;
}

.student-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 10px;
    background: #64748b;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.student-secondary-action:hover {
    background: #475569;
    color: #fff;
}

@media (max-width: 900px) {
    .student-form-grid,
    .student-form-row,
    .student-form-row-main,
    .student-form-row-three,
    .student-form-row-two {
        grid-template-columns: 1fr;
    }

    .student-form-field-wide {
        grid-column: span 1;
    }

    .student-profile-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 8px 0;
        align-items: start;
    }
}

.word-import-card h2 {
    margin-bottom: 14px;
}

.template-download-row {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.template-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.template-download-link:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.18);
}

.word-import-form .test-settings-row {
    grid-template-columns: 1.2fr 1fr 0.8fr;
    align-items: end;
}

.word-import-form .test-settings-row label {
    text-align: center;
}

.single-question-form .test-settings-row {
    grid-template-columns: 2fr 1fr;
}

.single-question-form .test-settings-row label {
    text-align: center;
}

.single-question-form textarea {
    min-height: 92px;
}

.single-question-form .answer-list {
    display: grid;
    gap: 14px;
}

.question-type-field {
    display: grid;
    gap: 8px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
}

.question-type-field select {
    width: 100%;
}

.question-answer-panels {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.question-answer-panel[hidden] {
    display: none !important;
}

.question-answer-panel .muted {
    margin: 0;
}

.matching-pairs {
    display: grid;
    gap: 12px;
}

.matching-pair-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
    gap: 12px;
    align-items: end;
}

.matching-pair-row label {
    display: grid;
    gap: 8px;
}

.matching-pair-row input[type="text"],
.matching-pair-row select {
    width: 100%;
}

.add-answer-row {
    display: grid;
    grid-template-columns: 1fr minmax(210px, auto);
    gap: 14px;
    align-items: end;
}

.answer-correct-toggle {
    min-height: 48px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
}

.answer-correct-toggle > span:first-child {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.answer-correct-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.answer-correct-toggle input:checked + .test-toggle-switch {
    background: var(--primary);
}

.answer-correct-toggle input:checked + .test-toggle-switch::before {
    transform: translateX(20px);
}

.test-preview-card h2 {
    margin-bottom: 16px;
}

.test-preview-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 26px;
}

.test-preview-meta span {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 13px;
}

.test-time-limit-field {
    min-width: 0;
    width: min(320px, 100%);
}

.test-time-limit-field input {
    width: 100%;
}

.student-test-countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
}

.student-test-countdown strong {
    color: var(--text-main);
    font-size: 15px;
}

.test-preview-list {
    display: grid;
    gap: 22px;
}

.test-preview-question {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.test-preview-question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.test-preview-question-head h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 18px;
}

.test-preview-question-head span {
    color: var(--text-muted);
    font-size: 14px;
}

.test-preview-card textarea[readonly],
.test-preview-card input[readonly] {
    background: #fff;
    color: var(--text-main);
    cursor: default;
}

.test-edit-settings-form {
    margin-bottom: 26px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.test-edit-points {
    min-width: 260px;
    display: grid;
    grid-template-columns: 1fr 86px;
    align-items: center;
    gap: 12px;
}

.test-edit-points span {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.test-edit-points input {
    text-align: center;
}

.test-edit-question-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.test-edit-question-actions .table-action {
    border: 0;
    cursor: pointer;
}

.preview-answer-row {
    margin-top: 14px;
}

.preview-correct-toggle {
    cursor: default;
}

.preview-correct-toggle input:disabled + .test-toggle-switch {
    opacity: 1;
}

@media (max-width: 900px) {
    .test-preview-question-head {
        align-items: stretch;
        flex-direction: column;
    }

    .test-edit-points {
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .matching-pair-row {
        grid-template-columns: 1fr;
    }
}

.test-toggle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.test-toggle-option {
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.test-toggle-option:hover {
    border-color: #c7d2fe;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.test-toggle-option > span:first-child {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.test-toggle-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.test-toggle-switch {
    width: 44px;
    height: 24px;
    position: relative;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s;
}

.test-toggle-switch::before {
    content: "";
    width: 18px;
    height: 18px;
    position: absolute;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
    transition: transform 0.2s;
}

.test-toggle-option input:checked + .test-toggle-switch {
    background: var(--primary);
}

.test-toggle-option input:checked + .test-toggle-switch::before {
    transform: translateX(20px);
}

.grid-form fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.grid-form legend {
    float: left;
    width: 100%;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
}

.grid-form legend + .table-wrap {
    clear: both;
}

.grid-form > button[type="submit"] {
    justify-self: start;
    min-width: 180px;
    margin-top: 4px;
}

.assignment-create-card {
    padding: 0;
    overflow: hidden;
}

.assignment-create-card h2 {
    margin: 0;
    padding: 24px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.assignments-form {
    padding: 22px 24px 24px;
}

.assignments-form > label {
    padding: 16px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #fff;
}

.assignments-form > label span,
.assignments-form > label {
    color: var(--text-main);
}

.assignments-form input,
.assignments-form select {
    background: #fff;
}

.assignments-form .assignment-availability-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.assignments-form .assignment-availability-row > label {
    padding: 16px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #fff;
    color: var(--text-main);
}

.assignments-form fieldset {
    border-color: #eef2f7;
    border-radius: 12px;
    box-shadow: none;
}

.assignments-form legend {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.assignments-form .muted {
    margin: -6px 16px 2px;
}

.assignments-form > button[type="submit"] {
    justify-self: center;
    min-width: 220px;
    margin-top: 10px;
    box-shadow: 0 14px 28px rgba(99, 102, 241, 0.18);
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

input, select, textarea {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
}

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

.student-results-table-wrap {
    margin: 16px 0 32px;
}

.student-results-form .student-results-filter-row {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.5fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(220px, 1.1fr);
}

.student-results-form .student-results-filter-row > label {
    min-width: 0;
}

.student-results-form .student-results-action-cell {
    display: flex;
    flex-direction: column;
}

.student-results-form .student-results-action-cell > span {
    flex: 0 0 auto;
}

.student-results-form .student-results-submit-btn,
.student-results-form .student-results-export-btn {
    width: 100%;
    min-width: 0;
}

.student-results-form .student-results-export-btn {
    background: #eef2ff;
    color: var(--primary);
}

.student-results-form .student-results-export-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.student-results-form .student-results-export-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.group-results-form .group-results-filter-row {
    grid-template-columns: minmax(0, 0.6fr) minmax(0, 0.6fr) minmax(110px, 0.6fr) minmax(120px, 0.6fr) minmax(120px, 0.6fr);
}

.group-results-form .group-results-filter-row > label {
    min-width: 0;
}

.group-results-form .group-results-action-cell {
    display: flex;
    flex-direction: column;
}

.group-results-form .group-results-action-cell > span {
    flex: 0 0 auto;
}

.group-results-form .group-results-show-btn,
.group-results-form .group-results-export-btn {
    width: 100%;
    min-width: 0;
}

.student-results-table-wrap .stats-table th:not(:first-child),
.student-results-table-wrap .stats-table td:not(:first-child) {
    text-align: center;
}

.student-results-table-wrap .stats-table th:first-child {
    text-align: center;
}

.group-results-table-wrap {
    margin: 16px 0 32px;
    max-width: 100%;
    position: relative;
    overflow-y: hidden;
    isolation: isolate;
}

.group-results-table-wrap .stats-table {
    min-width: max-content;
}

.group-results-table-wrap .stats-table th,
.group-results-table-wrap .stats-table td {
    text-align: center;
}

.group-results-table-wrap .stats-table th:first-child,
.group-results-table-wrap .stats-table td:first-child {
    text-align: left;
}

.group-results-table-wrap .stats-table thead tr:first-child th:nth-child(2),
.group-results-table-wrap .stats-table thead tr:first-child th:nth-child(3),
.group-results-table-wrap .stats-table thead tr:first-child th:nth-child(4),
.group-results-table-wrap .stats-table thead tr:first-child th:nth-child(5),
.group-results-table-wrap .stats-table thead tr:last-child th:nth-child(5n+1):not(:first-child),
.group-results-table-wrap .stats-table tbody td:nth-child(6),
.group-results-table-wrap .stats-table tbody td:nth-child(11),
.group-results-table-wrap .stats-table tbody td:nth-child(16),
.group-results-table-wrap .stats-table tbody td:nth-child(21) {
    border-right: 1px dotted rgba(148, 163, 184, 0.45);
}

.group-results-subject-header {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    min-width: 34px;
    height: 148px;
    padding: 0 0 0 8px;
    line-height: 1.05;
    text-transform: none;
    font-size: 11px;
    vertical-align: bottom;
    text-align: left;
}

.group-results-student-cell {
    font-weight: 700;
    white-space: nowrap;
}

.stats-table,
.students-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.stats-table th,
.students-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    padding: 14px 16px;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.stats-table td,
.students-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.stats-table tbody tr:hover,
.students-table tbody tr:hover {
    background: #f8fafc;
}

.stats-table a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.stats-table a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.select-table th:first-child,
.select-table td:first-child {
    width: 56px;
    text-align: center;
}

.select-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.select-table tbody tr {
    cursor: pointer;
}

.tests-table {
    min-width: 1120px;
}

.tests-table th:first-child,
.tests-table td:first-child {
    min-width: 240px;
}

.tests-table th:not(:first-child),
.tests-table td:not(:first-child) {
    text-align: center;
    vertical-align: middle;
}

.tests-table .table-actions {
    align-items: center;
}

.tests-table td:nth-child(3),
.tests-table td:nth-child(4) {
    font-weight: 700;
}

.table-actions {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    min-height: 32px;
    padding: 7px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.table-action:visited,
.table-action:focus,
.table-action:hover {
    color: #fff;
}

.stats-table .table-action,
.stats-table .table-action:visited,
.stats-table .table-action:focus,
.stats-table .table-action:hover {
    color: #fff;
    text-decoration: none;
}

.table-action-form {
    margin: 0;
}

.table-action-form .table-action {
    border: 0;
    cursor: pointer;
}

.table-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.table-action-view {
    background: #64748b;
}

.table-action-edit {
    background: #2563eb;
}

.table-action-delete {
    background: #ef4444;
}

.group-list {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.students-table {
    min-width: 980px;
}

.students-list-card {
    padding-top: 26px;
}

.students-directory-card {
    padding: 28px;
    border: 1px solid #d7e6ff;
    background:
        radial-gradient(circle at top left, rgba(191, 219, 254, 0.55), transparent 22%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    box-shadow: 0 22px 44px rgba(59, 130, 246, 0.12);
}

.students-directory-card h2 {
    margin-bottom: 22px;
    text-align: left;
    color: #1e3a8a;
    font-size: 22px;
}

.students-directory-filters {
    display: grid;
    gap: 18px;
}

.students-filters-row {
    display: grid;
    gap: 16px;
}

.students-filters-row-primary {
    grid-template-columns: 1.5fr 1fr 1fr;
}

.students-filters-row-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.students-filters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.students-filter-field {
    min-width: 0;
    color: #334155;
    font-size: 15px;
}

.students-filter-field-name {
    min-width: 0;
}

.students-filter-field-wide {
    grid-column: span 2;
}

.students-filter-field input,
.students-filter-field select {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid #bfd4ff;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.students-filter-field input:focus,
.students-filter-field select:focus {
    outline: none;
    border-color: #6ea8fe;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.students-directory-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.students-directory-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.students-directory-btn:hover {
    transform: translateY(-1px);
}

.students-directory-btn-primary {
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.students-directory-btn-muted {
    background: linear-gradient(180deg, #67748f 0%, #52627d 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(71, 85, 105, 0.18);
}

.students-directory-btn-muted:hover,
.students-directory-btn-muted:visited,
.students-directory-btn-muted:focus {
    color: #fff;
    text-decoration: none;
}

.students-results-count {
    margin: 20px 0 14px;
    color: #5b6f8f;
    font-size: 15px;
    font-weight: 700;
}

.students-directory-table-wrap {
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    overflow-x: auto;
}

.students-directory-table th {
    background: linear-gradient(180deg, #eef5ff 0%, #e5eefb 100%);
    color: #31456b;
    font-size: 14px;
    text-transform: none;
}

.students-directory-table td {
    height: 78px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.92);
}

.students-directory-table tbody tr:hover td {
    background: #f8fbff;
}

.students-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    text-align: left;
}

.students-name-cell strong {
    color: #1e293b;
    font-size: 15px;
}

.students-name-cell span {
    color: #64748b;
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill-active {
    background: #dcfce7;
    color: #166534;
}

.status-pill-inactive {
    background: #e2e8f0;
    color: #475569;
}

.students-directory-empty {
    padding: 28px 16px;
    color: #64748b;
    font-weight: 600;
}

.students-list-card .table-wrap {
    border: 1px solid #dbeafe;
    border-radius: 14px;
    overflow-x: auto;
}

.students-list-table th,
.students-list-table td {
    text-align: center;
    vertical-align: middle;
}

.students-list-table th:nth-child(2),
.students-list-table td:nth-child(2) {
    text-align: center;
}

.students-list-table td {
    height: 72px;
    font-size: 15px;
}

.students-list-table .table-actions {
    align-items: center;
}

@media (max-width: 900px) {
    .students-filters-row,
    .students-filters-grid {
        grid-template-columns: 1fr;
    }

    .student-results-form .student-results-filter-row {
        grid-template-columns: 1fr;
    }

    .group-results-form .group-results-filter-row {
        grid-template-columns: 1fr;
    }

    .students-filter-field-wide {
        grid-column: auto;
    }

    .students-directory-card {
        padding: 20px;
    }
}

.teachers-table {
    min-width: 1080px;
}

.teachers-table input,
.teachers-table select {
    width: 100%;
    min-width: 130px;
}

.teachers-table td,
.teachers-table th {
    text-align: center;
    vertical-align: middle;
}

.teachers-table .table-actions {
    align-items: center;
}

.teachers-table td:nth-child(2) input,
.teachers-table td:nth-child(7) input {
    min-width: 220px;
}

.students-table input,
.students-table select {
    width: 100%;
    min-width: 120px;
}

.students-table .birth-year-input {
    min-width: 135px;
}

.students-table td:nth-child(5) select {
    min-width: 165px;
}

button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #eef2ff;
    color: var(--primary);
    padding: 9px 16px;
    border-radius: 10px;
}

.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}

.assignments-table {
    min-width: 1180px;
}

.assignments-table th:last-child,
.assignments-table td:last-child {
    width: 110px;
    text-align: right;
}

.student-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 240px;
}

.student-cell span {
    color: var(--text-muted);
    font-size: 12px;
}

.questions-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    font-weight: 700;
}

.flash-wrap {
    margin-bottom: 24px;
}

.flash {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
