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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.btn {
    display: inline-block;
    padding: 11px 22px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    letter-spacing: 0.01em;
}

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

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

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #047857;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #b91c1c;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control:hover:not(:focus) {
    border-color: var(--gray-400);
}

.header {
    background: var(--white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: var(--dark);
    font-size: 22px;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav a {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: var(--gray-900);
}

.btn-logout {
    background: var(--danger) !important;
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600 !important;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #dc2626 !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

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

.user-name {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
}

.user-role {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-teacher {
    background: #dbeafe;
    color: #1e40af;
}

.role-student {
    background: #d1fae5;
    color: #065f46;
}

.role-testing {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    font-size: 10px;
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-900);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background: var(--gray-50);
}

h2, h3 {
    color: var(--gray-900);
    font-weight: 600;
    margin-bottom: 12px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 18px;
        margin-bottom: 14px;
    }

    .header .container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .header h1 {
        font-size: 18px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .nav a {
        font-size: 13px;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px; /* Touch target */
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .card {
        padding: 14px;
        border-radius: 6px;
    }

    .header h1 {
        font-size: 16px;
    }

    .nav {
        gap: 8px;
    }

    .nav a {
        font-size: 12px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
    }
}

