body{direction:rtl;font-family:Tahoma,Vazirmatn,Arial,sans-serif}
.kes-login-wrapper{display:flex;justify-content:center;align-items:center;min-height:70vh}
.kes-login-box{background:#fff;padding:40px;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,.1);width:100%;max-width:400px}
.kes-btn{background:#2271b1;color:#fff;border:none;padding:12px 24px;border-radius:8px;cursor:pointer;font-size:15px;text-decoration:none;display:inline-block}
.kes-btn-outline{background:transparent;border:1px solid #2271b1;color:#2271b1;padding:10px 20px;border-radius:8px;text-decoration:none}
.kes-btn-danger{background:#d63638}
.kes-error{background:#fcf0f1;color:#d63638;padding:12px;border-radius:8px;margin-bottom:15px}
.kes-dashboard{max-width:1000px;margin:0 auto;padding:20px}
.kes-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:30px}
.kes-exam-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px}
.kes-exam-card{background:#fff;border:1px solid #e0e0e0;border-radius:12px;padding:20px}
.kes-table{width:100%;border-collapse:collapse;margin-top:15px}
.kes-table th,.kes-table td{padding:12px;border-bottom:1px solid #eee;text-align:right}
.kes-exam-wrapper{max-width:800px;margin:0 auto;padding:20px}
.kes-exam-header{display:flex;justify-content:space-between;align-items:center;background:#f0f6fc;padding:15px 20px;border-radius:10px;margin-bottom:25px}
.kes-timer{font-size:20px;font-weight:bold;color:#d63638}
.kes-question{background:#fff;border:1px solid #e0e0e0;border-radius:12px;padding:25px}
.q-options label{display:block;padding:12px 15px;margin:8px 0;border:1px solid #ddd;border-radius:8px;cursor:pointer}
.q-options label.selected,.q-options label:hover{background:#f0f6fc;border-color:#2271b1}
.kes-nav{display:flex;gap:12px;margin-top:25px;flex-wrap:wrap}
.kes-result-container{max-width:900px;margin:30px auto;padding:0 15px}
.kes-tabs{display:flex;gap:6px;margin-bottom:25px;border-bottom:2px solid #e5e7eb}
.kes-tab-btn{background:none;border:none;padding:12px 22px;font-size:15px;font-weight:600;color:#6b7280;cursor:pointer;border-bottom:3px solid transparent}
.kes-tab-btn.active{color:#2271b1;border-bottom-color:#2271b1}
.kes-tab-pane{display:none}.kes-tab-pane.active{display:block}
.kes-score-box{display:flex;gap:15px;flex-wrap:wrap;margin:25px 0}
.score-item{background:#f8f9fa;padding:15px 25px;border-radius:10px;text-align:center}
.score-item strong{font-size:24px}.green{color:#00a32a}.red{color:#d63638}
.kes-answer-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:20px;margin-bottom:20px;border-right:5px solid #9ca3af}
.kes-answer-card.correct{border-right-color:#10b981;background:#f0fdf4}
.kes-answer-card.wrong{border-right-color:#ef4444;background:#fef2f2}
.explanation-box{margin-top:16px;padding:14px;background:#f0f9ff;border-right:4px solid #0ea5e9;border-radius:8px}
.lesson-badge{display:inline-block;background:#e0f2fe;color:#0369a1;font-size:12px;padding:2px 10px;border-radius:20px;margin-bottom:8px}
@media print{.kes-result-actions,.kes-tabs{display:none!important}.kes-tab-pane{display:block!important}}

/* ========== صفحه آزمون ========== */
.kes-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden;
}
.kes-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #3b82f6);
    width: 0%;
    transition: width 0.5s;
}

.kes-lesson-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    background: #e0f2fe;
    padding: 12px 18px;
    border-radius: 10px;
    margin: 25px 0 18px;
    border-right: 5px solid #0284c7;
}

.kes-question {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 18px;
}

.q-number {
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
}

/* ========== مودال ========== */
.kes-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.kes-modal-content {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.kes-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
}
.kes-modal-header h3 {
    margin: 0;
    font-size: 18px;
}
.kes-modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}
.kes-modal-body {
    padding: 22px;
}

/* دکمه‌های مرور */
.review-btn {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.review-answered {
    background: #dcfce7;
    color: #166534;
}
.review-unanswered {
    background: #fee2e2;
    color: #991b1b;
}

.kes-btn-review {
    background: #0f766e;
    color: #fff;
}