#qb-teacher-portal {
    max-width: 480px;
    margin: 20px auto;
    font-family: 'IBM Plex Sans Arabic', -apple-system, "Segoe UI", Tahoma, Arial, sans-serif !important;
    direction: rtl;
    text-align: right;
}

#qb-teacher-portal *,
#qb-teacher-portal *::before,
#qb-teacher-portal *::after {
    font-family: inherit;
    box-sizing: border-box;
}

#qb-teacher-portal .qb-hidden {
    display: none !important;
}

#qb-teacher-portal input,
#qb-teacher-portal select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
    margin: 4px 0 12px;
}

#qb-teacher-portal label {
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.qbt-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.qbt-card h2 {
    margin: 0 0 4px;
}

.qbt-sub {
    font-size: 13px;
    color: #6b6b6b;
    margin: 0 0 18px;
}

.qbt-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.qbt-auth-tab {
    flex: 1;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.qbt-auth-tab.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.qbt-btn {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.qbt-btn-primary {
    background: #1a1a1a;
    color: #fff;
    border: none;
    width: 100%;
}

.qbt-btn-small {
    font-size: 12px;
    padding: 6px 12px;
}

.qbt-upload-progress {
    text-align: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 10px;
}

.qbt-upload-progress-num {
    font-size: 18px;
    font-weight: 800;
    margin: 10px 0 0;
}

.qbt-upload-progress-label {
    font-size: 12px;
    color: #888;
    margin: 4px 0 0;
}

.qbt-error {
    color: #a32d2d;
    font-size: 12px;
    margin-bottom: 8px;
    display: none;
}
.qbt-error.qbt-show {
    display: block;
}

.qbt-success {
    color: #2a6b45;
    background: #eaf3de;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 8px;
    display: none;
}
.qbt-success.qbt-show {
    display: block;
}

.qbt-note-inline {
    font-size: 11px;
    color: #888;
    margin: 6px 0 0;
}

.qbt-track-toggle {
    display: flex;
    gap: 8px;
    margin: 4px 0 12px;
}

.qbt-track-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.qbt-track-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.qbt-track-btn:disabled {
    cursor: not-allowed;
}

/* بانر تحفيزي */
.qbt-promo-banner {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qbt-promo-icon {
    font-size: 20px;
}

.qbt-promo-banner p {
    font-size: 13px;
    margin: 0;
    color: #333;
    font-weight: 500;
}

/* الإحصائيات البنكية */
.qbt-bank-stats {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.qbt-bank-stat {
    flex: 1;
    text-align: center;
}

.qbt-bank-stat-num {
    font-size: 21px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.qbt-bank-stat-label {
    font-size: 10px;
    color: #999;
    margin: 3px 0 0;
}

.qbt-bank-divider {
    width: 1px;
    height: 30px;
    background: #eee;
}

/* هيكل الداشبورد: تبويبات يمين + محتوى */
.qbt-dashboard-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.qbt-side-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 92px;
    flex-shrink: 0;
}

.qbt-side-tab {
    padding: 10px 6px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
}

.qbt-side-tab.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.qbt-dashboard-content {
    flex: 1;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    min-width: 0;
}

@media (max-width: 420px) {
    .qbt-dashboard-layout {
        flex-direction: column;
    }
    .qbt-side-tabs {
        flex-direction: row;
        width: 100%;
    }
}

/* كروت الإحصائيات (زي داشبورد الأدمن) */
.qbt-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.qbt-stat-box {
    background: #f7f7f5;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.qbt-stat-box-highlight {
    background: #1a1a1a;
}

.qbt-stat-box-highlight .qbt-stat-num,
.qbt-stat-box-highlight .qbt-stat-label {
    color: #fff;
}

.qbt-stat-num {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.qbt-stat-label {
    font-size: 11px;
    color: #6b6b6b;
    margin: 2px 0 0;
}

.qbt-referral-box {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.qbt-referral-label {
    font-size: 12px;
    color: #333;
    margin: 0 0 6px;
    font-weight: 600;
}

.qbt-referral-row {
    display: flex;
    gap: 6px;
}

.qbt-referral-row input {
    flex: 1;
    font-size: 11px;
    padding: 8px;
    margin: 0;
}

/* بطاقة الرصيد البارزة (زي بطاقة بنكية) */
.qbt-wallet-hero {
    background: linear-gradient(135deg, #1a1a1a, #333);
    border-radius: 12px;
    padding: 18px;
    color: #fff;
}

.qbt-wallet-hero-label {
    font-size: 12px;
    opacity: 0.8;
    margin: 0 0 4px;
}

.qbt-wallet-hero-amount {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.qbt-wallet-hero .qbt-wallet-progress-track {
    background: rgba(255,255,255,0.2);
    margin-top: 10px;
    margin-bottom: 0;
}

.qbt-wallet-box {
    background: #f7f7f5;
    border-radius: 10px;
    padding: 14px;
}

.qbt-wallet-progress-track {
    background: #e0e0e0;
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.qbt-wallet-progress-fill {
    background: #4caf50;
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}

/* شات الملاحظات */
.qbt-conversation-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px;
}

.qbt-messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 4px;
}

.qbt-msg-bubble {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.qbt-msg-mine {
    align-self: flex-end;
    background: #1a1a1a;
    color: #fff;
    border-radius: 14px 14px 2px 14px;
}

.qbt-msg-admin {
    align-self: flex-start;
    background: #f0f0ee;
    color: #222;
    border-radius: 14px 14px 14px 2px;
}

.qbt-message-input-row {
    display: flex;
    gap: 6px;
}

.qbt-message-input-row input {
    flex: 1;
    margin: 0;
}

.qbt-message-input-row button {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.qbt-pending-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.qbt-pending-icon {
    font-size: 44px;
    margin-bottom: 12px;
}

.qbt-pending-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
}

.qbt-pending-body {
    font-size: 14px;
    color: #6b6b6b;
    line-height: 1.7;
    margin: 0 0 20px;
}

.qbt-pending-banner {
    background: #fdf0e0;
    border: 2px solid #d4a017;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 16px;
}

.qbt-pending-title {
    font-size: 16px;
    font-weight: 800;
    color: #7a5c0a;
    margin: 0 0 4px;
}

.qbt-pending-sub {
    font-size: 12px;
    color: #7a5c0a;
    margin: 0 0 2px;
}

.qbt-pending-eta {
    font-size: 11px;
    color: #a3843a;
    margin: 0;
}

.qbt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.qbt-header-right {
    text-align: left;
}

.qbt-datetime {
    font-size: 11px;
    color: #999;
    line-height: 1.5;
    margin: 0 0 6px;
}

.qbt-teacher-meta {
    font-size: 12px;
    color: #6b6b6b;
    margin: 2px 0 0;
}

.qbt-students-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.qbt-students-header span {
    font-size: 14px;
    font-weight: 600;
}

#qbt-add-student-row {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}

.qbt-student-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: #f7f7f5;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
}

.qbt-student-info {
    flex: 1;
}

.qbt-student-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.qbt-student-stage {
    font-size: 12px;
    color: #6b6b6b;
    margin: 2px 0 0;
}

.qbt-student-badges {
    text-align: left;
    margin-left: 8px;
}

.qbt-student-exam-badge {
    display: block;
    font-size: 10px;
    background: #eee;
    color: #555;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 3px;
}

.qbt-student-attempt-note {
    display: block;
    font-size: 9px;
    color: #999;
}

.qbt-remove-link {
    background: none;
    border: none;
    color: #a32d2d;
    font-size: 12px;
    cursor: pointer;
}

.qbt-request-btn {
    background: #fdf6e3;
    color: #7a5c0a;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    padding: 6px 10px;
    cursor: pointer;
    margin: 0 6px;
}

.qbt-request-card {
    background: #f7f7f5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.qbt-request-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
}

.qbt-request-student {
    font-weight: 400;
    color: #888;
}

.qbt-request-photos {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.qbt-request-photos img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.qbt-request-inline-form {
    flex: 1 0 100%;
    margin-top: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
}

.qbt-request-inline-form label {
    font-size: 11px;
    color: #666;
    display: block;
    margin-bottom: 6px;
}

.qbt-request-inline-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    font-size: 13px;
}

.qbt-request-inline-form button {
    width: 100%;
}

.qbt-request-student-section {
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.qbt-request-student-heading {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 10px;
}

.qbt-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    cursor: pointer;
    padding: 20px;
}

.qbt-lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.qbt-student-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.qbt-ideal-student {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid #eee;
}

.qbt-ideal-avatar {
    width: 60px;
    height: 60px;
    background: #eaf3de;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 10px;
    border: 3px solid #2e7d32;
}

.qbt-ideal-label {
    font-size: 11px;
    color: #2e7d32;
    font-weight: 700;
    margin: 0 0 4px;
}

.qbt-ideal-name {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.qbt-ideal-sub {
    font-size: 11px;
    color: #888;
    margin: 4px 0 0;
}

.qbt-rank-list {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #eee;
}

.qbt-rank-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7f7f5;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
}

.qbt-rank-num {
    font-size: 11px;
    color: #888;
    width: 16px;
}

.qbt-rank-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.qbt-rank-name {
    font-size: 12px;
    flex: 1;
}

.qbt-rank-percent {
    font-size: 11px;
    color: #2e7d32;
    font-weight: 700;
}

.qbt-request-grade-row {
    display: flex;
    gap: 8px;
}

.qbt-request-grade-row input {
    width: 80px;
    padding: 7px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.qbt-request-grade {
    font-size: 13px;
    font-weight: 700;
    color: #2e7d32;
    margin: 0;
}

.qbt-upload-subject-box {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.qbt-upload-subject-name {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.qbt-contribution-row {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.qbt-receipt-row {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12px;
    color: #444;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qbt-receipt-row a {
    color: #1a1a1a;
    text-decoration: underline;
    font-size: 11px;
    flex-shrink: 0;
    margin-right: 8px;
}

.qbt-empty {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 30px 0;
}

.qbt-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f7f5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 13px;
}

.qbt-result-score {
    font-weight: 600;
    color: #1a1a1a;
}

.qbt-score {
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0 16px;
}

.qbt-review-item {
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-right: 3px solid #ccc;
    background: #f7f7f5;
}

.qbt-review-item.correct {
    border-right-color: #2e7d32;
}

.qbt-review-item.wrong {
    border-right-color: #c62828;
}

.qbt-review-q {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
}

.qbt-review-answer {
    font-size: 12px;
    margin: 2px 0;
    color: #444;
}

.qbt-review-answer.wrong-text {
    color: #c62828;
}

.qbt-review-answer.correct-text {
    color: #2e7d32;
}
