* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0f766e;
    --accent: #f59e0b;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --dark: #1e293b;
    --gray: #64748b;
    --light-gray: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --sidebar-tablet: 70px;
}
body {
    font-family: 'Poppins', sans-serif;
    background: var(--light-gray);
    color: var(--dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    display: flex;
    min-height: 100vh;
}
.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.login-left::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.login-left::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -10%;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}
.login-brand {
    text-align: center;
    z-index: 1;
    margin-bottom: 3rem;
}
.logo-icon {
    width: 90px; height: 90px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}
.logo-icon img { max-width: 70%; max-height: 70%; object-fit: contain; }
.login-brand h1 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}
.login-brand h1 span { font-weight: 300; opacity: 0.9; }
.login-brand p { font-size: 1rem; opacity: 0.9; margin-bottom: 0.3rem; }
.login-brand .subtitle { font-size: 0.85rem; opacity: 0.7; }
.login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    z-index: 1;
    width: 100%;
    max-width: 320px;
}
.feature-item {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.3s ease;
}
.feature-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}
.feature-item i { font-size: 1.5rem; margin-bottom: 0.5rem; display: block; }
.feature-item span { font-size: 0.8rem; font-weight: 500; }
.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--light-gray);
}
.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    overflow: hidden;
}
.login-card form { width: 100%; box-sizing: border-box; }
.login-card h2 { font-size: 1.6rem; color: var(--dark); margin-bottom: 0.3rem; }
.login-subtitle { color: var(--gray); font-size: 0.9rem; margin-bottom: 1.5rem; }
.role-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.role-btn {
    flex: 1;
    padding: 0.8rem 0.5rem;
    border: 2px solid var(--light-gray);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
}
.role-btn i { font-size: 1.2rem; color: var(--gray); }
.role-btn span { font-size: 0.75rem; font-weight: 600; color: var(--gray); }
.role-btn:hover { border-color: var(--primary-light); background: var(--primary-light); }
.role-btn.active { border-color: var(--primary); background: var(--primary-light); }
.role-btn.active i, .role-btn.active span { color: var(--primary); }
.form-group { 
    margin-bottom: 1.2rem; 
    width: 100%;
    box-sizing: border-box;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.4rem;
}
.form-group label i { margin-right: 0.4rem; color: var(--primary); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
    margin: 0;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.password-wrapper { 
    position: relative; 
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.password-wrapper input { 
    width: 100%;
    max-width: 100%;
    padding-right: 2.5rem; 
    box-sizing: border-box;
    margin: 0;
}
.toggle-password {
    position: absolute;
    right: 0.5rem; 
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
}
.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}
.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.login-footer { text-align: center; margin-top: 1.5rem; }
.login-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.login-footer .version { font-size: 0.75rem; color: var(--gray); margin-top: 0.5rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 2rem 1rem;
}
.modal-content {
    background: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.close {
    position: absolute;
    right: 1rem; top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.close:hover { 
    color: var(--danger); 
    background: #fee2e2;
}

/* ===== DASHBOARD LAYOUT - DESKTOP ===== */
.dashboard { display: flex; min-height: 100vh; }

/* Desktop Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
    transition: all 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.sidebar-header .logo-icon {
    width: 45px; height: 45px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.sidebar-header h3 { font-size: 1rem; font-weight: 600; }
.sidebar-header p { font-size: 0.7rem; opacity: 0.7; }
.sidebar-nav { padding: 1rem 0; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--primary);
}
.nav-item i { width: 20px; text-align: center; }
.nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    margin-top: 0.5rem;
}
.sidebar-footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: var(--dark);
}
.user-info { display: flex; align-items: center; gap: 0.8rem; }
.user-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.user-details p { font-size: 0.85rem; font-weight: 500; }
.user-details span { font-size: 0.7rem; opacity: 0.6; }
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    min-height: 100vh;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 1rem;
}
.topbar h1 { font-size: 1.4rem; color: var(--dark); }
.topbar-actions { display: flex; gap: 0.8rem; align-items: center; }

/* ===== TABLET LAYOUT (768px - 1023px) ===== */
@media (max-width: 1023px) and (min-width: 768px) {
    .sidebar {
        width: var(--sidebar-tablet);
        overflow: visible;
    }
    .sidebar-header {
        padding: 1rem 0.5rem;
        justify-content: center;
    }
    .sidebar-header .logo-icon {
        width: 40px; height: 40px;
        font-size: 1.1rem;
    }
    .sidebar-header h3, .sidebar-header p,
    .nav-item span, .nav-section,
    .user-details, .sidebar-footer .btn {
        display: none !important;
    }
    .nav-item {
        justify-content: center;
        padding: 1rem 0.5rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .nav-item:hover, .nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
        background: rgba(255,255,255,0.05);
    }
    .nav-item i { width: auto; font-size: 1.2rem; }
    .sidebar-footer {
        padding: 0.5rem;
        display: flex;
        justify-content: center;
    }
    .user-info { justify-content: center; }
    .main-content {
        margin-left: var(--sidebar-tablet);
        padding: 1rem 1.5rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}


/* ===== MOBILE BOTTOM NAVIGATION ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #e2e8f0;
    z-index: 300;
    padding: 0.4rem 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.3rem 0.6rem;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    flex: 1;
    max-width: 80px;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.bottom-nav-item i {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item:active {
    background: var(--primary-light);
}

/* Adjust main content for mobile bottom nav */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: flex;
    }

    .main-content {
        padding-bottom: 70px !important;
    }

    /* Ensure sidebar overlay works properly */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-lg);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: rgba(255,255,255,0.1);
        border: none;
        color: white;
        border-radius: 50%;
        cursor: pointer;
        margin-left: auto;
    }

    .sidebar-header {
        padding: 1rem 1.2rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: 70px;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.8rem 1rem;
        background: white;
        margin: -1rem -1rem 1rem -1rem;
        border-bottom: 1px solid #e2e8f0;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius-sm);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

    .mobile-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--dark);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .form-group {
        width: 100%;
    }

    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
        overflow-x: auto;
    }

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

    .option-row {
        flex-direction: column;
        align-items: stretch;
    }

    .option-row input[type="text"] {
        width: 100%;
    }

    .ujian-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .question-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .question-actions > div {
        justify-content: center;
    }

    .question-nav {
        gap: 0.3rem;
    }

    .nav-number {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .modal-content {
        margin: 1rem auto;
        padding: 1.5rem;
        max-width: calc(100% - 2rem);
    }

    .score-details {
        grid-template-columns: 1fr;
    }

    .login-container {
        flex-direction: column;
    }

    .login-left {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .login-features {
        max-width: 100%;
        grid-template-columns: repeat(2, 1fr);
    }

    .login-right {
        padding: 1.5rem 1rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .role-selector {
        flex-direction: column;
    }

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

    /* Ujian card mobile */
    .ujian-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.8rem;
    }

    .ujian-card button {
        width: 100%;
        justify-content: center;
    }
}

/* ===== MOBILE SMALL (max 480px) ===== */
@media (max-width: 480px) {
    .login-features {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .question-nav {
        gap: 0.2rem;
    }

    .nav-number {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .ujian-container {
        padding: 0.5rem;
    }

    .question-card {
        padding: 1rem;
    }

    .answer-option {
        padding: 0.8rem;
    }

    .bottom-nav-item {
        font-size: 0.6rem;
        padding: 0.2rem 0.3rem;
    }

    .bottom-nav-item i {
        font-size: 1rem;
    }
}
/* ===== COMPONENTS ===== */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #b45309; transform: translateY(-1px); }
.btn-outline { background: white; border: 2px solid #e2e8f0; color: var(--dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon {
    width: 55px; height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }
.stat-info h3 { font-size: 1.6rem; font-weight: 700; color: var(--dark); }
.stat-info p { font-size: 0.85rem; color: var(--gray); }

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.card-header h3 { font-size: 1.1rem; color: var(--dark); }
.card-body { padding: 1.5rem; }

/* Tables */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.9rem 1rem; text-align: left; font-size: 0.85rem; }
th {
    background: var(--light-gray);
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
tr { border-bottom: 1px solid #f1f5f9; transition: background 0.2s ease; }
tr:hover { background: #f8fafc; }
td { vertical-align: middle; }
.badge {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}
.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }

/* Question Types */
.question-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.type-pg { background: #dbeafe; color: #1e40af; }
.type-pgk { background: #fce7f3; color: #be185d; }
.type-mj { background: #fef3c7; color: #92400e; }
.type-is { background: #dcfce7; color: #166534; }
.type-ur { background: #ede9fe; color: #5b21b6; }

/* Soal Editor */
.soal-editor {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.soal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
    flex-wrap: wrap;
    gap: 1rem;
}
.soal-header h3 { font-size: 1.2rem; color: var(--dark); }
.soal-form-group { margin-bottom: 1.5rem; }
.soal-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.9rem;
}
.soal-form-group input,
.soal-form-group select,
.soal-form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
}
.soal-form-group input:focus,
.soal-form-group select:focus,
.soal-form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.soal-form-group textarea { min-height: 100px; resize: vertical; }
.option-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.option-row input[type="text"] {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-width: 200px;
}
.option-row input[type="checkbox"],
.option-row input[type="radio"] {
    width: 18px; height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}
.option-row label {
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.option-row .btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.option-row .btn-remove:hover { background: #b91c1c; }
.matching-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
}
.matching-row input {
    padding: 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: inherit;
    width: 100%;
}

/* Ujian Interface */
.ujian-container { 
    max-width: 900px; 
    margin: 0 auto; 
    padding: 1rem;
}
.ujian-header {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.ujian-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.ujian-timer.warning { color: var(--danger); background: #fee2e2; }
.ujian-timer.danger {
    color: white;
    background: var(--danger);
    animation: pulse 1s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.question-nav {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    justify-content: center;
}
.nav-number {
    width: 38px; height: 38px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.nav-number:hover { border-color: var(--primary); color: var(--primary); }
.nav-number.active { background: var(--primary); color: white; border-color: var(--primary); }
.nav-number.answered { background: var(--success); color: white; border-color: var(--success); }
.nav-number.flagged { border-color: var(--warning); color: var(--warning); }
.nav-number.answered.flagged { 
    background: var(--success); 
    color: white;
    border-color: var(--warning);
    box-shadow: inset 0 0 0 2px var(--warning);
}
.question-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.question-number {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.question-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--dark);
    margin-bottom: 1.5rem;
}
.question-stimulus {
    background: #f8fafc;
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}
.answer-options { display: flex; flex-direction: column; gap: 0.8rem; }
.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}
.answer-option:hover { border-color: var(--primary); background: var(--primary-light); }
.answer-option.selected { border-color: var(--primary); background: var(--primary-light); }
.answer-option input { margin-top: 0.2rem; width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.answer-option label { flex: 1; cursor: pointer; font-size: 0.95rem; line-height: 1.5; }
.answer-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}
.answer-textarea:focus { outline: none; border-color: var(--primary); }
.short-answer-input {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
}
.short-answer-input:focus { outline: none; border-color: var(--primary); }
.matching-container { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.matching-column { background: #f8fafc; padding: 1rem; border-radius: var(--radius-sm); }
.matching-column h4 { font-size: 0.9rem; margin-bottom: 1rem; color: var(--primary); }
.matching-item {
    padding: 0.8rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.matching-item:hover { border-color: var(--primary); }
.matching-item.selected { border-color: var(--primary); background: var(--primary-light); }
.matching-item.matched { border-color: var(--success); background: #dcfce7; }
.question-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 1rem;
}
.btn-flag {
    background: none;
    border: 2px solid var(--warning);
    color: var(--warning);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
.btn-flag:hover, .btn-flag.flagged { background: var(--warning); color: white; }
.btn-nav {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
.btn-nav-prev { background: var(--light-gray); color: var(--dark); }
.btn-nav-prev:hover { background: #e2e8f0; }
.btn-nav-next { background: var(--primary); color: white; }
.btn-nav-next:hover { background: var(--primary-dark); }

/* Upload Soal */
.upload-area {
    border: 3px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upload-area i { font-size: 3rem; color: var(--gray); margin-bottom: 1rem; }
.upload-area p { color: var(--gray); font-size: 0.95rem; }
.upload-area .upload-hint { font-size: 0.8rem; color: var(--gray); margin-top: 0.5rem; }

/* Tabs */
.tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 0.8rem 1.2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* Form inline */
.form-inline {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-inline .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }

/* Filters */
.filter-bar {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Alert */
.alert {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: var(--primary-light); color: #1e40af; border: 1px solid #93c5fd; }

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.spinner {
    width: 50px; height: 50px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal Large */
.modal-large .modal-content {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Score Display */
.score-display { text-align: center; padding: 2rem; }
.score-circle {
    width: 150px; height: 150px;
    border-radius: 50%;
    border: 8px solid var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.score-circle .score-value { font-size: 2.5rem; font-weight: 700; color: var(--primary); }
.score-circle .score-label { font-size: 0.8rem; color: var(--gray); }
.score-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.score-detail-item { background: var(--light-gray); padding: 1rem; border-radius: var(--radius-sm); }
.score-detail-item h4 { font-size: 1.3rem; color: var(--dark); }
.score-detail-item p { font-size: 0.8rem; color: var(--gray); }

/* Exam Lock Screen */
.exam-lock {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--dark);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    text-align: center;
    padding: 2rem;
}
.exam-lock i { font-size: 4rem; margin-bottom: 1.5rem; color: var(--danger); }
.exam-lock h2 { font-size: 1.8rem; margin-bottom: 1rem; }
.exam-lock p { font-size: 1rem; opacity: 0.8; max-width: 500px; line-height: 1.6; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.95rem; }

/* Print */
@media print {
    .sidebar, .topbar, .btn, .question-actions, .exam-lock, .mobile-header { display: none !important; }
    .main-content { margin-left: 0; padding: 0; }
    .question-card { box-shadow: none; border: 1px solid #e2e8f0; }
    body { background: white; }
}

/* Hide scrollbar but keep functionality */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* Selection prevention during exam */
.exam-active {
    user-select: none;
    -webkit-user-select: none;
}
.exam-active img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.8rem;
    background: var(--dark);
    color: white;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 0.5rem;
}
[data-tooltip]:hover::after {
    opacity: 1;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile header (hidden on desktop) */
.mobile-header {
    display: none;
}

/* Device-specific visibility helpers */
@media (min-width: 1024px) {
    .hide-desktop { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet { display: none !important; }
    .show-mobile-only { display: none !important; }
}
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
    .show-desktop-only { display: none !important; }
}
