:root{
    --blue:#2563eb;
    --blue-dark:#1d4ed8;
    --bg:#f4f7fb;
    --text:#172033;
    --muted:#667085;
    --border:#d9e2ef;
    --white:#fff;
    --danger:#dc2626;
    --success:#16a34a;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;
    background:var(--bg);
    color:var(--text);
}

a{
    text-decoration:none;
    color:inherit;
}

.container{
    max-width:1100px;
    margin:auto;
    padding:24px;
}

.card{
    background:var(--white);
    border:1px solid var(--border);
    border-radius:18px;
    padding:22px;
    box-shadow:0 10px 30px rgba(20,40,90,.06);
}

.btn{
    border:0;
    border-radius:12px;
    background:var(--blue);
    color:#fff;
    padding:11px 16px;
    font-weight:700;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:8px;
}

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

.btn.secondary{
    background:#eef4ff;
    color:var(--blue);
}

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

.btn.success{
    background:var(--success);
}

.btn:disabled{
    opacity:.55;
    cursor:not-allowed;
}

.input,
select,
textarea{
    width:100%;
    border:1px solid var(--border);
    border-radius:12px;
    padding:12px 14px;
    background:#fff;
    font-size:15px;
}

label{
    font-weight:700;
    display:block;
    margin:10px 0 7px;
}

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

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

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

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

.topbar{
    background:#fff;
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    z-index:10;
}

.topbar-inner{
    max-width:1100px;
    margin:auto;
    padding:14px 24px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.brand{
    font-weight:900;
    color:var(--blue);
    font-size:20px;
}

.muted{
    color:var(--muted);
}

.timer{
    font-size:18px;
    font-weight:900;
    background:#eef4ff;
    color:var(--blue);
    border-radius:12px;
    padding:10px 14px;
}

.question-img{
    width:100%;
    max-height:360px;
    object-fit:contain;
    background:#f8fafc;
    border:1px solid var(--border);
    border-radius:14px;
    padding:12px;
}

.options{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
    margin-top:18px;
}

.option{
    border:2px solid var(--border);
    border-radius:14px;
    padding:10px;
    background:#fff;
    cursor:pointer;
    transition:.15s;
}

.option input{
    display:none;
}

.option.active{
    border-color:var(--blue);
    box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

.option span{
    font-weight:900;
    color:var(--blue);
    display:block;
    margin-bottom:8px;
}

.option img{
    width:100%;
    height:110px;
    object-fit:contain;
}

.nav-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:20px;
}

.sidebar-layout{
    display:grid;
    grid-template-columns:250px 1fr;
    min-height:100vh;
}

.sidebar{
    background:#0f172a;
    color:#fff;
    padding:22px;
}

.sidebar .brand{
    color:#fff;
    margin-bottom:22px;
}

.sidebar a{
    display:block;
    padding:12px 14px;
    border-radius:12px;
    margin:6px 0;
    color:#dbeafe;
}

.sidebar a:hover,
.sidebar a.active{
    background:#1d4ed8;
    color:#fff;
}

.main{
    padding:24px;
}

.table-wrap{
    overflow:auto;
}

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

.table th,
.table td{
    border-bottom:1px solid var(--border);
    padding:12px;
    text-align:left;
    vertical-align:middle;
}

.table th{
    background:#f8fafc;
    font-size:13px;
    text-transform:uppercase;
    color:var(--muted);
}

.thumb{
    width:78px;
    height:58px;
    object-fit:contain;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
}

.alert{
    padding:12px 14px;
    border-radius:12px;
    margin:12px 0;
}

.alert.error{
    background:#fee2e2;
    color:#991b1b;
}

.alert.success{
    background:#dcfce7;
    color:#166534;
}

.preview{
    max-width:180px;
    max-height:100px;
    display:block;
    margin-top:8px;
    border:1px solid var(--border);
    border-radius:10px;
    padding:6px;
    background:#fff;
}

/* =========================
   SUBTEST ALPHABET
========================= */

.alphabet-options{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:20px;
    margin-top:24px;
}

.alphabet-choice{
    width:100%;
    height:90px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:38px;
    font-weight:800;
    border:2px solid var(--border);
    border-radius:16px;
    background:#fff;
    color:var(--text);
    transition:all .2s ease;
}

.alphabet-options .option{
    padding:0;
    overflow:hidden;
}

.alphabet-options .option:hover .alphabet-choice{
    border-color:var(--blue);
    background:#eef4ff;
    transform:translateY(-2px);
}

.alphabet-options .option.active .alphabet-choice{
    background:var(--blue);
    border-color:var(--blue);
    color:#fff;
    box-shadow:0 0 0 4px rgba(37,99,235,.15);
}

.alphabet-options input{
    display:none;
}

/* =========================
   RESPONSIVE
========================= */

@media(max-width:800px){
    .grid.two,
    .grid.three,
    .grid.four,
    .options,
    .sidebar-layout{
        grid-template-columns:1fr;
    }

    .sidebar{
        position:relative;
    }

    .main{
        padding:16px;
    }

    .container{
        padding:16px;
    }

    .nav-actions{
        gap:10px;
        flex-wrap:wrap;
    }

    .topbar-inner{
        padding:12px 16px;
    }
}

@media(max-width:768px){
    .alphabet-options{
        grid-template-columns:repeat(3,1fr);
    }

    .alphabet-choice{
        height:75px;
        font-size:30px;
    }
}

@media(max-width:480px){
    .alphabet-options{
        grid-template-columns:repeat(2,1fr);
    }
}