
        :root {
            --primary-color: #059669;
            --primary-dark: #064e3b;
        }
        body { 
            font-family: 'Cairo', sans-serif; 
            background-color: #F8FAFC; 
            color: #1E293B; 
            overflow-x: hidden; 
        }
        .font-en { font-family: 'Fredoka', 'Cairo', sans-serif; }
        .no-scrollbar::-webkit-scrollbar { display: none; }
        .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
        
        .custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: #F1F5F9; border-radius: 8px; }
        .custom-scrollbar::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 8px; }
        .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
        
        .sticky-col { 
            position: sticky; 
            right: 0; 
            z-index: 25; 
            background: white; 
            border-left: 2px solid #E2E8F0; 
        }

        #main-table thead th, #eval-main-table thead th {
            position: sticky;
            top: 0;
            z-index: 35;
            background-color: #f8fafc;
            border-bottom: 2px solid #cbd5e1;
            box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
        }

        #main-table th.sticky-col, #eval-main-table th.sticky-col {
            position: sticky;
            top: 0;
            right: 0;
            z-index: 50 !important;
            background-color: #f8fafc !important;
            border-bottom: 2px solid #cbd5e1;
            border-left: 2px solid #e2e8f0;
        }

        #main-table td.sticky-col, #eval-main-table td.sticky-col {
            position: sticky;
            right: 0;
            z-index: 25;
            background-color: #ffffff;
            border-left: 2px solid #e2e8f0;
        }

        .student-name-full { display: block; }
        .student-name-first { display: none; }

        .sticky-col { transition: width .18s ease, min-width .18s ease, max-width .18s ease, padding .18s ease, box-shadow .18s ease; }

        .table-scrolled .sticky-col,
        .table-force-compact .sticky-col {
            width: 78px !important;
            min-width: 78px !important;
            max-width: 78px !important;
            padding-right: 4px !important;
            padding-left: 4px !important;
            box-shadow: -5px 0 14px rgba(15, 23, 42, 0.12) !important;
        }

        .table-scrolled .tracking-name-stack,
        .table-force-compact .tracking-name-stack {
            min-height: 32px !important;
            gap: 1px !important;
            align-items: center !important;
        }

        .table-scrolled .tracking-name-row,
        .table-force-compact .tracking-name-row {
            justify-content: center !important;
            gap: 3px !important;
        }

        .table-scrolled .tracking-name-cell .mini-badges-inline,
        .table-scrolled .tracking-name-cell .tracking-excellence-inline,
        .table-force-compact .tracking-name-cell .mini-badges-inline,
        .table-force-compact .tracking-name-cell .tracking-excellence-inline {
            display: none !important;
        }

        .table-scrolled .tracking-rank-chip,
        .table-force-compact .tracking-rank-chip {
            min-width: 22px !important;
            height: 19px !important;
            padding: 1px 4px !important;
            font-size: 8px !important;
        }

        .table-scrolled th.sticky-col,
        .table-force-compact th.sticky-col {
            text-align: center !important;
            padding-right: 4px !important;
            padding-left: 4px !important;
        }

        .table-scrolled .student-name-full,
        .table-force-compact .student-name-full {
            display: none !important;
        }

        .table-scrolled .student-name-first,
        .table-force-compact .student-name-first {
            display: block !important;
            font-size: 11px !important;
            font-weight: 900 !important;
            color: #0f172a !important;
            text-align: center !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .tab-content { display: none; }
        .tab-content.active { display: block; animation: fadeIn 0.25s ease-out; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

        .loader {
            border: 3.5px solid #f1f5f9;
            border-top: 3.5px solid var(--primary-color);
            border-radius: 50%;
            width: 36px;
            height: 36px;
            animation: spin 0.9s linear infinite;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        .bg-primary { background-color: var(--primary-color); }
        .text-primary { color: var(--primary-color); }
        .border-primary { border-color: var(--primary-color); }
        .modal-active { display: flex !important; animation: fadeIn 0.2s ease-out; }

        .input-error {
            border-color: #ef4444 !important;
            background-color: #fef2f2 !important;
            color: #ef4444 !important;
            animation: shake 0.3s cubic-bezier(.36,.07,.19,.97) both;
            box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
        }

        @keyframes shake {
            10%, 90% { transform: translate3d(-1px, 0, 0); }
            20%, 80% { transform: translate3d(2px, 0, 0); }
            30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
            40%, 60% { transform: translate3d(3px, 0, 0); }
        }

        .col-note-dot {
            position: absolute;
            top: 7px;
            left: 7px;
            width: 6px;
            height: 6px;
            border-radius: 999px;
            display: inline-block;
            background: #f59e0b;
            box-shadow: 0 0 0 2px rgba(245,158,11,.18);
        }

        .table-scroll-shell {
            overflow-x: auto;
            overflow-y: auto;
            max-height: min(72vh, 680px);
            -webkit-overflow-scrolling: touch;
            padding-bottom: 8px;
            touch-action: pan-x pan-y;
        }

        .top-scrollbar-shell {
            overflow-x: auto;
            overflow-y: hidden;
            height: 10px;
            margin: 0 0 8px;
            scrollbar-width: thin;
            scrollbar-color: rgba(148,163,184,.45) transparent;
            opacity: .55;
            transition: opacity .18s ease, height .18s ease;
        }
        .top-scrollbar-shell:hover { opacity: 1; height: 13px; }
        .top-scrollbar-spacer { height: 1px; }

        .tracking-jump-btn {
            background: #0f172a;
            color: white;
            border-radius: 1rem;
            padding: .65rem 1rem;
            font-size: 11px;
            font-weight: 900;
            box-shadow: 0 10px 25px rgba(15,23,42,.15);
        }

        .tracking-score-cell { min-width: 76px; }
        .tracking-score-wrap { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
        .tracking-score-badge { font-size:8px; line-height:1; font-weight:900; color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; border-radius:999px; padding:3px 5px; white-space:nowrap; }
        .tracking-score-badge.low { color:#b45309; background:#fffbeb; border-color:#fde68a; }
        .tracking-score-badge.fail { color:#be123c; background:#fff1f2; border-color:#fecdd3; }
        .sync-pulse { animation: syncPulse 1s ease-in-out infinite alternate; }
        @keyframes syncPulse { from { opacity:.55; } to { opacity:1; } }

        /* Continuous Assessment Interactive Button States */
        .eval-btn-state {
            transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }
        .eval-btn-state:active { transform: scale(0.92); }
        .eval-state-0 { background: #f8fafc; border-color: #e2e8f0; color: #94a3b8; }
        .eval-state-1 { background: #10b981; border-color: #059669; color: #ffffff; box-shadow: 0 3px 8px rgba(16,185,129,0.25); }
        .eval-state-2 { background: #f59e0b; border-color: #d97706; color: #ffffff; box-shadow: 0 3px 8px rgba(245,158,11,0.25); }
        .eval-state-3 { background: #ef4444; border-color: #dc2626; color: #ffffff; box-shadow: 0 3px 8px rgba(239,68,68,0.25); }

        .eval-badge-mastered { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
        .eval-badge-pending { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
        .eval-badge-support { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

        @page { size: A4 portrait; margin: 8mm; }
        .exam-report-sheet { width: 100%; max-width: 190mm; margin: 0 auto; background: #fff; color: #111827; }
        .exam-report-header-box { border: 1.6px solid #334155; border-radius: 16px; padding: 10px 14px; margin-bottom: 10px; page-break-inside: avoid; }
        .exam-report-header-grid { display: grid; grid-template-columns: 1fr 88px 1fr; gap: 10px; align-items: center; }
        .exam-report-ministry, .exam-report-meta { font-size: 12px; font-weight: 800; line-height: 1.75; }
        .exam-report-ministry { text-align: right; }
        .exam-report-meta { text-align: left; }
        .exam-report-logo-wrap { display: flex; align-items: center; justify-content: center; }
        .exam-report-logo, .exam-report-logo-fallback { width: 72px; height: 72px; }
        .exam-report-logo { object-fit: contain; }
        .exam-report-logo-fallback { border: 1.6px solid #94a3b8; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: #475569; }
        .exam-report-title-box { text-align: center; margin-top: 6px; }
        .exam-report-title-chip { display: inline-block; border: 1.8px solid #0f172a; border-radius: 12px; padding: 7px 22px; font-size: 18px; font-weight: 900; line-height: 1.4; }
        .exam-report-table { width: 100%; border-collapse: collapse; table-layout: fixed; border: 1.6px solid #1e293b; }
        .exam-report-table thead th { background: #f8fafc; color: #0f172a; font-size: 11px; font-weight: 900; padding: 8px 4px; border: 1px solid #334155; }
        .exam-report-table tbody td { border: 1px solid #475569; padding: 6px 4px; font-size: 11px; font-weight: 700; vertical-align: middle; text-align: center; }
        .exam-report-table .name-cell { text-align: right; padding-right: 8px; font-size: 11.5px; font-weight: 800; }
        .exam-report-table .score-input { width: 100%; max-width: 52px; height: 28px; border: 1px solid #cbd5e1; border-radius: 8px; text-align: center; font-size: 13px; font-weight: 900; outline: none; margin: 0 auto; display: block; }
        .exam-report-table .rating-chip { display: inline-block; min-width: 56px; border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 900; border: 1px solid #cbd5e1; }
        .exam-report-footer-box { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; padding-top: 12px; page-break-inside: avoid; }
        .exam-report-signature { text-align: center; font-size: 12px; font-weight: 900; line-height: 2; }
        .exam-report-signature .label { color: #475569; margin-bottom: 28px; }

        .tracking-name-stack { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 46px; padding-top: 2px; max-width: 100%; }
        .tracking-name-row { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
        .tracking-rank-chip { position: static; flex: 0 0 auto; min-width: 28px; height: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 900; color: #0f172a; background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; padding: 2px 6px; }
        .tracking-rank-chip.gold { background: linear-gradient(180deg,#fff7d6 0%,#fde68a 100%); border-color: #f59e0b; color: #92400e; }
        .tracking-rank-chip.silver { background: linear-gradient(180deg,#f8fafc 0%,#e2e8f0 100%); border-color: #94a3b8; color: #334155; }
        .tracking-rank-chip.bronze { background: linear-gradient(180deg,#ffedd5 0%,#fdba74 100%); border-color: #ea580c; color: #9a3412; }

        .honor-board-list { display: grid; gap: 10px; max-height: min(65vh, 520px); overflow: auto; padding-left: 4px; }
        .honor-board-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; }
        .honor-board-badge { min-width: 56px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-weight: 900; font-size: 12px; }
        .honor-board-badge.gold { background: linear-gradient(180deg,#fff7d6 0%,#fde68a 100%); color: #92400e; border: 1px solid #f59e0b; }
        .honor-board-badge.silver { background: linear-gradient(180deg,#f8fafc 0%,#e2e8f0 100%); color: #334155; border: 1px solid #94a3b8; }
        .honor-board-badge.bronze { background: linear-gradient(180deg,#ffedd5 0%,#fdba74 100%); color: #9a3412; border: 1px solid #ea580c; }
        .honor-board-badge.normal { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }

        .mini-badges-inline { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 0; align-items: center; }
        .mini-badge-chip { width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px solid #e2e8f0; font-size: 11px; }
        .mini-badge-chip.more { width: auto; min-width: 22px; padding: 0 6px; font-size: 10px; font-weight: 800; color: #475569; }

        .badge-media-thumb { width: 38px; height: 38px; border-radius: 12px; object-fit: contain; }
        .badge-media-inline { width: 18px; height: 18px; border-radius: 999px; object-fit: contain; }

        .student-report-sheet { width: 190mm; min-height: 277mm; margin: 0 auto; background: #ffffff; color: #0f172a; border: 2px solid #cbd5e1; box-shadow: 0 14px 30px rgba(15, 23, 42, .08); position: relative; overflow: hidden; }
        .student-report-body { position: relative; z-index: 1; padding: 8mm 10mm 7mm; display: flex; flex-direction: column; min-height: 277mm; gap: 5mm; }
        .student-report-topbar { display: grid; grid-template-columns: 1fr 76px 1fr; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; color: #1e293b; border-bottom: 2px solid #99f6e4; padding-bottom: 4mm; }
        .student-report-school { line-height: 1.65; text-align: right; }
        .student-report-meta { line-height: 1.75; text-align: left; }
        .student-report-logo { width: 68px; height: 68px; object-fit: contain; margin: 0 auto; }
        .student-report-title { text-align: center; padding: 4mm 5mm 3.5mm; border-radius: 18px; border: 2px solid #14b8a6; background: #f0fdfa; }
        .student-report-title h2 { margin: 0; font-size: 24px; font-weight: 900; color: #0f766e; }
        .student-report-summary { display: grid; grid-template-columns: 1.25fr 0.9fr 0.85fr; gap: 10px; }
        .student-card { border-radius: 22px; padding: 14px 16px; background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); color: white; display: flex; align-items: center; justify-content: space-between; }
        .student-report-avatar { width: 62px; height: 62px; border-radius: 18px; object-fit: cover; border: 2px solid rgba(255,255,255,.72); box-shadow: 0 6px 16px rgba(15,23,42,.18); background: rgba(255,255,255,.16); flex-shrink: 0; }
        .student-report-avatar-fallback { width: 62px; height: 62px; border-radius: 18px; display:flex; align-items:center; justify-content:center; font-size:28px; border:2px solid rgba(255,255,255,.38); background:rgba(255,255,255,.16); flex-shrink:0; }
        .rank-card { border-radius: 22px; border: 2px solid #cbd5e1; background: #f8fafc; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; text-align: center; }
        .rating-card { border-radius: 22px; border: 2px solid #facc15; background: #fffbeb; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; text-align: center; }
        .student-report-main { display: grid; grid-template-columns: 1.1fr .9fr; gap: 10px; }
        .report-panel { border: 1.5px solid #dbeafe; border-radius: 22px; background: #ffffff; padding: 14px; }
        .report-panel-title { font-size: 17px; font-weight: 900; color: #1e293b; margin: 0 0 10px; border-right: 6px solid #14b8a6; padding-right: 10px; }
        .metric-row { margin-bottom: 8px; }
        .metric-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; color: #334155; margin-bottom: 3px; }
        .metric-track { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; border: 1px solid #cbd5e1; }
        .metric-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14b8a6 0%, #0f766e 100%); }

        .ring-panel { display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; }
        .ring-wrap { width: 140px; height: 140px; position: relative; }
        .ring-wrap svg { width: 140px; height: 140px; transform: rotate(-90deg); }
        .ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
        .badges-box { width: 100%; border-radius: 18px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 10px; }
        .badges-title { font-size: 11px; font-weight: 900; color: #64748b; text-align: center; margin-bottom: 8px; }
        .badges-grid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
        .badge-item { width: 68px; min-height: 64px; border-radius: 16px; border: 1px solid #e2e8f0; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5px 3px; }

        /* Responsive compatibility improvements for mobile, iPad, and desktop */
        .mgt-action-btn {
            min-height: 40px;
            padding: 0.55rem 0.7rem;
            border-radius: 14px;
            font-size: 12px;
            font-weight: 900;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            white-space: nowrap;
            line-height: 1;
        }
        .mgt-mobile-card {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 1.5rem;
            padding: 14px;
            box-shadow: 0 6px 20px rgba(15,23,42,.05);
        }
        .mgt-mobile-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0,1fr));
            gap: 8px;
        }
        .mgt-mobile-meta {
            display: grid;
            grid-template-columns: 1fr;
            gap: 6px;
            margin-top: 10px;
        }
        .mgt-mobile-label {
            font-size: 10px;
            font-weight: 900;
            color: #64748b;
        }
        .mgt-mobile-value {
            font-size: 13px;
            font-weight: 800;
            color: #334155;
            word-break: break-word;
        }
        .student-mgt-shell { width: 100%; }

        @media (max-width: 767px) {
            #main-header { position: sticky; }
            #main-header h1 { font-size: 1.2rem !important; }
            #main-header p { font-size: 10px !important; }
            nav .nav-btn { padding: .7rem .9rem !important; font-size: 10px !important; }
            #content-students-mgt .rounded-[2\.5rem] { border-radius: 1.5rem !important; }
            .mgt-action-btn { min-height: 38px; font-size: 11px; padding: .55rem .65rem; }
            .table-scroll-shell { max-height: min(66vh, 540px); }
        }

        @media (min-width: 768px) and (max-width: 1024px) {
            .mgt-action-btn { min-height: 38px; font-size: 11px; padding: .55rem .6rem; }
        }

        /* V10: Responsive Exam + Student Reports */
        .exam-mobile-list { display: none; }
        .exam-mobile-card {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 1.35rem;
            padding: 13px;
            box-shadow: 0 5px 18px rgba(15,23,42,.05);
        }
        .exam-mobile-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0,1fr));
            gap: 7px;
            margin-top: 10px;
        }
        .exam-mobile-stat {
            border: 1px solid #e2e8f0;
            border-radius: 14px;
            padding: 8px 5px;
            text-align: center;
            background: #f8fafc;
        }
        .exam-mobile-stat-label { font-size: 9px; font-weight: 900; color: #64748b; }
        .exam-mobile-stat-value { font-size: 15px; font-weight: 900; color: #0f172a; margin-top: 2px; }
        .exam-mobile-score-input {
            width: 58px;
            height: 36px;
            border: 1.5px solid #cbd5e1;
            border-radius: 11px;
            text-align: center;
            font-size: 16px;
            font-weight: 900;
            outline: none;
            background: #fff;
        }
        .responsive-report-actions button,
        .responsive-exam-actions button { min-height: 42px; justify-content: center; }

        @media (max-width: 767px) {
            #content-exam > div { border-radius: 1.4rem !important; margin-bottom: 2rem !important; }
            #content-exam > div > div:first-child { padding: 14px !important; align-items: stretch !important; }
            #content-exam > div > div:first-child > div:first-child { width: 100%; display: grid !important; grid-template-columns: 1fr; gap: 8px !important; }
            #content-exam #exam-period-select { width: 100%; min-height: 42px; }
            .responsive-exam-actions { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px !important; width: 100%; }
            .responsive-exam-actions button { padding: 10px 8px !important; font-size: 10px !important; border-radius: 13px !important; }
            #exam-report-section { padding: 10px !important; max-width: none !important; width: 100% !important; }
            #exam-report-header, #exam-report-footer, .exam-report-table-wrap { display: none !important; }
            .exam-mobile-list { display: grid !important; gap: 10px; }

            #content-report { gap: 12px !important; }
            #content-report > div:first-child { padding: 12px !important; border-radius: 1.35rem !important; align-items: stretch !important; }
            #studentSelect { min-height: 46px; padding: 10px 12px !important; font-size: 12px; }
            .responsive-report-actions { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px !important; width: 100%; }
            .responsive-report-actions button { padding: 10px 7px !important; font-size: 10px !important; border-radius: 13px !important; }
            #report-card-container { max-width: 100% !important; width: 100% !important; overflow: visible !important; }
            .student-report-sheet { width: 100% !important; min-height: auto !important; border-radius: 20px; border-width: 1px; }
            .student-report-body { min-height: auto !important; padding: 12px !important; gap: 12px !important; }
            .student-report-topbar { grid-template-columns: 1fr 54px !important; gap: 7px !important; font-size: 9px !important; padding-bottom: 10px !important; }
            .student-report-topbar .student-report-meta { grid-column: 1 / -1; text-align: right !important; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding-top: 6px; border-top: 1px dashed #cbd5e1; }
            .student-report-logo { width: 48px !important; height: 48px !important; }
            .student-report-title { padding: 10px 8px !important; border-radius: 14px !important; }
            .student-report-title h2 { font-size: 16px !important; line-height: 1.5; }
            .student-report-summary { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
            .student-report-summary .student-card { grid-column: 1 / -1; padding: 11px !important; border-radius: 16px !important; gap: 8px; }
            .student-report-avatar, .student-report-avatar-fallback { width: 50px !important; height: 50px !important; border-radius: 14px !important; font-size: 22px !important; }
            .student-card > div:first-child .text-xl { font-size: 15px !important; }
            .rank-card, .rating-card { padding: 9px !important; border-radius: 15px !important; min-height: 78px; }
            .rank-card .text-xl, .rating-card .text-2xl { font-size: 15px !important; }
            .student-report-main { grid-template-columns: 1fr !important; gap: 9px !important; }
            .report-panel { padding: 11px !important; border-radius: 16px !important; }
            .report-panel-title { font-size: 14px !important; margin-bottom: 8px !important; }
            .ring-wrap, .ring-wrap svg { width: 116px !important; height: 116px !important; }
            .badges-box { padding: 8px !important; }
            .badge-item { width: 60px !important; min-height: 58px !important; }
            .exam-report-footer-box { grid-template-columns: 1fr !important; }
        }

        @media (min-width: 768px) and (max-width: 1024px) {
            #content-exam > div > div:first-child { padding: 18px !important; }
            .responsive-exam-actions { gap: 8px !important; }
            .responsive-exam-actions button { padding: 10px 12px !important; font-size: 10px !important; }
            #exam-report-section { padding: 14px !important; }
            .exam-report-header-grid { grid-template-columns: 1fr 68px 1fr !important; }
            .exam-report-logo, .exam-report-logo-fallback { width: 58px !important; height: 58px !important; }
            .exam-report-title-chip { font-size: 15px !important; padding: 6px 14px !important; }
            .exam-report-table thead th, .exam-report-table tbody td { font-size: 10px !important; padding: 6px 3px !important; }

            #content-report > div:first-child { padding: 18px !important; }
            .responsive-report-actions { gap: 8px !important; }
            .responsive-report-actions button { padding: 11px 13px !important; font-size: 11px !important; }
            #report-card-container { max-width: 100% !important; }
            .student-report-sheet { width: 100% !important; min-height: auto !important; }
            .student-report-body { min-height: auto !important; padding: 18px !important; gap: 14px !important; }
            .student-report-topbar { grid-template-columns: 1fr 64px 1fr !important; font-size: 10px !important; }
            .student-report-logo { width: 58px !important; height: 58px !important; }
            .student-report-title h2 { font-size: 20px !important; }
            .student-report-summary { grid-template-columns: 1.15fr .85fr .8fr !important; gap: 8px !important; }
            .student-report-main { grid-template-columns: 1fr .82fr !important; gap: 8px !important; }
            .report-panel { padding: 11px !important; }
        }

        @media print {
            html, body { background: white !important; padding: 0 !important; margin: 0 !important; }
            body.printing-section > * { display: none !important; }
            body.printing-section .print-active { display: block !important; width: 100% !important; margin: 0 auto !important; }
            .print-hidden { display: none !important; }
        }
    
        /* V9.2 - Compact responsive tracking tables for mobile, iPad and desktop */
        #main-table, #eval-main-table { font-size: 11px; }
        #main-table th, #main-table td, #eval-main-table th, #eval-main-table td { vertical-align: middle; }
        #main-table .tracking-score-cell { min-width: 56px; width: 56px; padding: 3px !important; }
        #main-table .tracking-score-wrap { gap: 1px; }
        #main-table .tracking-score-badge { font-size: 7px; padding: 2px 4px; }
        #main-table .tracking-mark-btn { width: 28px; height: 28px; border-radius: 9px; }
        #main-table .tracking-mark-btn svg { width: 13px; height: 13px; }
        #main-table thead .tracking-col-head { min-width: 58px; }
        #main-table thead .tracking-col-head > div { min-height: 42px; padding-left: 3px; padding-right: 3px; gap: 2px; }
        #main-table tbody .tracking-name-cell { padding-top: 7px !important; padding-bottom: 7px !important; padding-right: 10px !important; }
        #main-table thead .tracking-name-head { padding-top: 10px !important; padding-bottom: 10px !important; padding-right: 10px !important; }

        #eval-main-table .eval-skill-head { min-width: 100px; max-width: 130px; padding: 6px 4px !important; }
        #eval-main-table .eval-name-cell { padding-top: 7px !important; padding-bottom: 7px !important; padding-right: 10px !important; }
        #eval-main-table .eval-name-head { padding-top: 10px !important; padding-bottom: 10px !important; padding-right: 10px !important; }
        #eval-main-table .eval-state-cell { padding: 3px !important; }
        #eval-main-table .eval-btn-state { min-width: 58px !important; padding: 4px 6px !important; border-radius: 9px !important; font-size: 10px !important; line-height: 1.1; }
        #eval-main-table .eval-btn-state span { font-size: 10px !important; line-height: 1.1; white-space: nowrap; }

        @media (max-width: 1024px) {
            .table-scroll-shell { max-height: min(74vh, 720px); }
            #main-table .tracking-score-cell { min-width: 52px; width: 52px; }
            #main-table .tracking-mark-btn { width: 27px; height: 27px; }
            #main-table thead .tracking-col-head { min-width: 54px; }
            #main-table thead .tracking-col-head > div { min-height: 40px; }
            #eval-main-table .eval-skill-head { min-width: 92px; max-width: 118px; }
            #eval-main-table .eval-btn-state { min-width: 54px !important; padding: 4px !important; }
        }

        @media (max-width: 640px) {
            #main-table, #eval-main-table { font-size: 10px; }
            .table-scroll-shell { max-height: 76vh; }
            #main-table .tracking-score-cell { min-width: 46px; width: 46px; padding: 2px !important; }
            #main-table .tracking-mark-btn { width: 25px; height: 25px; border-width: 1.5px !important; border-radius: 8px; }
            #main-table .tracking-mark-btn svg { width: 12px; height: 12px; }
            #main-table .tracking-score-badge { font-size: 6.5px; padding: 1.5px 3px; }
            #main-table thead .tracking-col-head { min-width: 48px; }
            #main-table thead .tracking-col-head > div { min-height: 36px; padding: 2px; gap: 1px; }
            #main-table thead .tracking-col-head span:first-child { font-size: 8px !important; }
            #main-table thead .tracking-col-head span:nth-child(2) { font-size: 7px !important; }
            #main-table tbody .tracking-name-cell { padding-top: 5px !important; padding-bottom: 5px !important; padding-right: 6px !important; }
            #main-table thead .tracking-name-head { padding-top: 7px !important; padding-bottom: 7px !important; padding-right: 6px !important; }

            #eval-main-table .eval-skill-head { min-width: 82px; max-width: 100px; padding: 4px 3px !important; }
            #eval-main-table .eval-name-cell { padding-top: 5px !important; padding-bottom: 5px !important; padding-right: 6px !important; }
            #eval-main-table .eval-name-head { padding-top: 7px !important; padding-bottom: 7px !important; padding-right: 6px !important; }
            #eval-main-table .eval-state-cell { padding: 2px !important; }
            #eval-main-table .eval-btn-state { min-width: 48px !important; padding: 3px !important; border-radius: 8px !important; }
            #eval-main-table .eval-btn-state span { font-size: 9px !important; }
            .student-name-first { font-size: 10px !important; }
            .table-scrolled .sticky-col,
            .table-force-compact .sticky-col {
                width: 64px !important;
                min-width: 64px !important;
                max-width: 64px !important;
            }
            .table-scrolled .student-name-first,
            .table-force-compact .student-name-first { font-size: 9px !important; }
        }

        /* V9.5 - Student name redesign: name gets the full cell width; rank/WhatsApp live below it */
        #main-table .tracking-name-stack {
            width: 100%;
            min-width: 0;
            min-height: 46px;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: center;
            gap: 3px;
            padding: 1px 0;
        }
        #main-table .tracking-name-row {
            display: block;
            width: 100%;
            min-width: 0;
        }
        #main-table .tracking-student-name {
            width: 100%;
            min-width: 0;
            padding: 0 2px;
            color: #1e293b;
            font-size: 11px;
            font-weight: 900;
            line-height: 1.35;
            text-align: right;
            white-space: normal;
            overflow-wrap: anywhere;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        #main-table .tracking-student-name .student-name-full,
        #main-table .tracking-student-name .student-name-first {
            width: 100%;
            white-space: normal !important;
            overflow: visible !important;
            text-overflow: clip !important;
            font-size: inherit !important;
            line-height: inherit !important;
            text-align: inherit !important;
        }
        #main-table .tracking-name-actions {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 5px;
            min-height: 20px;
            padding-inline: 2px;
        }
        #main-table .tracking-wa-btn {
            width: 21px;
            height: 21px;
            min-width: 21px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: #ecfdf5;
            color: #059669;
            box-shadow: 0 1px 4px rgba(15,23,42,.08);
        }
        #main-table .tracking-wa-btn svg { width: 12px; height: 12px; }
        #main-table .tracking-rank-chip {
            min-width: 24px;
            height: 20px;
            padding: 1px 5px;
            font-size: 8px;
        }

        /* In tracking lists the automatic/compact presentation is the smart three-part name:
           student first name + father's name + family/last name. */
        #main-table .student-name-full { display: none; }
        #main-table .student-name-first { display: -webkit-box; }
        .table-force-full #main-table .student-name-full { display: -webkit-box !important; }
        .table-force-full #main-table .student-name-first { display: none !important; }

        /* Keep a useful name column while still guaranteeing room for at least two marks on phones. */
        .table-scrolled #main-table .sticky-col,
        .table-force-compact #main-table .sticky-col {
            width: 136px !important;
            min-width: 136px !important;
            max-width: 136px !important;
            padding-right: 6px !important;
            padding-left: 6px !important;
        }
        .table-scrolled #main-table .tracking-name-stack,
        .table-force-compact #main-table .tracking-name-stack {
            min-height: 42px !important;
            align-items: stretch !important;
            gap: 2px !important;
        }
        .table-scrolled #main-table .tracking-name-row,
        .table-force-compact #main-table .tracking-name-row {
            display: block !important;
        }
        .table-scrolled #main-table .tracking-student-name,
        .table-force-compact #main-table .tracking-student-name {
            font-size: 10px !important;
            text-align: right !important;
        }
        .table-scrolled #main-table .tracking-name-actions,
        .table-force-compact #main-table .tracking-name-actions {
            justify-content: flex-start !important;
        }

        @media (max-width: 1024px) {
            .table-scrolled #main-table .sticky-col,
            .table-force-compact #main-table .sticky-col {
                width: 124px !important;
                min-width: 124px !important;
                max-width: 124px !important;
            }
        }

        @media (max-width: 640px) {
            #main-table .tracking-name-stack { min-height: 42px; gap: 2px; }
            #main-table .tracking-student-name { font-size: 10px; line-height: 1.25; }
            #main-table .tracking-name-actions { min-height: 18px; gap: 4px; }
            #main-table .tracking-wa-btn { width: 19px; height: 19px; min-width: 19px; }
            #main-table .tracking-wa-btn svg { width: 11px; height: 11px; }
            #main-table .tracking-rank-chip { min-width: 22px; height: 18px; padding: 1px 4px; font-size: 7.5px; }
            #main-table tbody .tracking-name-cell { padding-right: 5px !important; padding-left: 5px !important; }
            .table-scrolled #main-table .sticky-col,
            .table-force-compact #main-table .sticky-col {
                width: 112px !important;
                min-width: 112px !important;
                max-width: 112px !important;
                padding-right: 4px !important;
                padding-left: 4px !important;
            }
            .table-scrolled #main-table .tracking-student-name,
            .table-force-compact #main-table .tracking-student-name {
                font-size: 9.5px !important;
                line-height: 1.22 !important;
            }
            /* Avoid secondary badge rows consuming vertical space on phones. */
            #main-table .tracking-name-cell .mini-badges-inline,
            #main-table .tracking-name-cell .tracking-excellence-inline { display: none !important; }
        }

    

        /* V9.7 — Smart badge identity: visible, elegant, and zero extra row height */
        #main-table .tracking-badge-signature {
            display: inline-flex;
            align-items: center;
            gap: 2px;
            height: 20px;
            max-width: 58px;
            padding: 1px 3px;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(255,251,235,.96), rgba(255,255,255,.96));
            border: 1px solid rgba(245,158,11,.28);
            box-shadow: 0 1px 4px rgba(15,23,42,.05);
            overflow: hidden;
            flex: 0 0 auto;
        }
        #main-table .tracking-badge-signature.is-empty { display:none; }
        #main-table .tracking-badge-token {
            position: relative;
            width: 17px;
            height: 17px;
            min-width: 17px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            background: #fff;
            border: 1px solid rgba(226,232,240,.9);
            font-size: 10px;
            line-height: 1;
        }
        #main-table .tracking-badge-token .badge-media-inline {
            width: 13px !important;
            height: 13px !important;
            object-fit: contain;
            border-radius: 999px;
        }
        #main-table .tracking-badge-token-count {
            position: absolute;
            left: -3px;
            top: -4px;
            min-width: 11px;
            height: 11px;
            padding: 0 2px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            background: #0f172a;
            color: #fff;
            border: 1px solid #fff;
            font-size: 6px;
            font-weight: 900;
            line-height: 1;
        }
        #main-table .tracking-badge-more {
            min-width: 16px;
            height: 16px;
            padding: 0 3px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            color: #92400e;
            background: #fef3c7;
            font-size: 7px;
            font-weight: 900;
            white-space: nowrap;
        }
        #main-table .tracking-name-cell:has(.student-has-badges) {
            box-shadow: inset -3px 0 0 rgba(245,158,11,.58), -4px 0 12px rgba(15,23,42,.04);
            background-image: linear-gradient(90deg, rgba(255,251,235,.45), rgba(255,255,255,0) 44%);
        }
        #main-table .tracking-name-cell:has(.student-has-badges) .tracking-student-name {
            color: #172033;
        }
        @media (max-width:640px) {
            #main-table .tracking-badge-signature { height:18px; max-width:52px; padding:1px 2px; gap:1px; }
            #main-table .tracking-badge-token { width:15px; height:15px; min-width:15px; }
            #main-table .tracking-badge-token .badge-media-inline { width:11px !important; height:11px !important; }
            #main-table .tracking-badge-more { height:14px; min-width:14px; font-size:6.5px; }
        }


        /* V11.6 — بصمة الشهادات وعرضها الكامل */
        .tracking-cert-signature { display:inline-flex; align-items:center; gap:2px; min-height:20px; max-width:62px; padding:1px 3px; border-radius:999px; background:linear-gradient(180deg, rgba(248,250,252,.98), rgba(255,255,255,.98)); border:1px solid rgba(168,85,247,.25); box-shadow:0 1px 4px rgba(15,23,42,.05); overflow:hidden; flex:0 0 auto; }
        .tracking-cert-token { position:relative; width:17px; height:17px; min-width:17px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; background:#fff; border:1px solid rgba(226,232,240,.9); font-size:10px; line-height:1; }
        .tracking-cert-token-count { position:absolute; left:-3px; top:-4px; min-width:11px; height:11px; padding:0 2px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; background:#7c3aed; color:#fff; border:1px solid #fff; font-size:6px; font-weight:900; line-height:1; }
        .tracking-cert-more { min-width:16px; height:16px; padding:0 3px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; color:#6d28d9; background:#f3e8ff; font-size:7px; font-weight:900; white-space:nowrap; }
        .student-cert-inline { display:flex; align-items:center; gap:5px; flex-wrap:wrap; margin-top:4px; }
        .student-cert-inline-label { font-size:10px; font-weight:900; color:#7c3aed; }
        .certificate-emblem-wrap { display:flex; justify-content:center; margin:-16px 0 8px; }
        .certificate-emblem { min-width:118px; padding:10px 18px; border-radius:999px; background:#fff; border:2px solid rgba(226,232,240,.95); box-shadow:0 12px 26px rgba(15,23,42,.12); display:inline-flex; align-items:center; justify-content:center; gap:10px; }
        .certificate-emblem-icon { font-size:30px; line-height:1; }
        .certificate-emblem-text { font-size:12px; font-weight:900; color:#0f172a; }
        .certificate-footer-strip { margin-top:16px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
        .certificate-footer-chip { background:#fff; border:1px solid #e2e8f0; border-radius:18px; padding:10px 12px; font-size:12px; line-height:1.9; color:#0f172a; font-weight:900; box-shadow:0 4px 12px rgba(15,23,42,.05); }
        .certificate-footer-chip span { color:#64748b; font-weight:800; }
        .certificate-report-stack { display:grid; gap:16px; }
        .certificate-report-item { background:linear-gradient(180deg,#f8fafc,#fff); border:1px solid #e2e8f0; border-radius:28px; padding:14px; box-shadow:0 18px 36px rgba(15,23,42,.08); }
        .certificate-report-toolbar { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
        .certificate-report-meta { font-size:12px; color:#64748b; font-weight:900; }
        .certificate-report-paper .certificate-shell { box-shadow:0 20px 35px rgba(15,23,42,.13); }
        .certificate-report-print-btn { background:#0f172a; color:#fff; padding:10px 14px; border-radius:14px; font-size:11px; font-weight:900; display:inline-flex; align-items:center; gap:6px; }
        @media (max-width:640px) { .tracking-cert-signature { max-width:58px; } .tracking-cert-token { width:15px; height:15px; min-width:15px; font-size:9px; } .certificate-emblem-wrap { margin:-10px 0 8px; } .certificate-emblem { min-width:96px; padding:8px 14px; gap:8px; } .certificate-emblem-icon { font-size:24px; } .certificate-emblem-text { font-size:11px; } .certificate-footer-strip { grid-template-columns:1fr; gap:8px; } .certificate-report-item { padding:10px; border-radius:22px; } .certificate-report-toolbar { margin-bottom:10px; } }


        /* V11.6 — سجل شهادات الطالب */
        .certificate-history-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; }
        .certificate-history-card { background:#fff; border:1px solid #e2e8f0; border-radius:22px; padding:14px; box-shadow:0 12px 28px rgba(15,23,42,.08); }
        .certificate-history-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
        .certificate-history-icon { width:44px; height:44px; border-radius:16px; display:flex; align-items:center; justify-content:center; font-size:24px; background:#faf5ff; border:1px solid #e9d5ff; flex:0 0 auto; }
        .certificate-history-title { font-size:13px; font-weight:900; color:#0f172a; line-height:1.6; }
        .certificate-history-date { font-size:10px; color:#64748b; font-weight:800; margin-top:2px; }
        .certificate-history-body { font-size:11px; color:#475569; font-weight:800; line-height:1.9; min-height:46px; }
        .certificate-history-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
        .certificate-history-summary { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
        .certificate-history-chip { padding:7px 11px; border-radius:999px; background:#faf5ff; color:#6d28d9; border:1px solid #e9d5ff; font-size:10px; font-weight:900; }
        @media (max-width:640px) {
            #certificate-history-modal { align-items:flex-end !important; padding:0 !important; }
            #certificate-history-modal .history-card-shell { width:100% !important; max-width:none !important; height:88vh; border-radius:24px 24px 0 0 !important; }
            .certificate-history-grid { grid-template-columns:1fr; gap:10px; }
            .certificate-history-card { border-radius:18px; padding:12px; }
        }

        /* V9.5 — Compact badge manager for phones/tablets */
        #badge-picker-modal { padding: 10px !important; }
        #badge-picker-modal .badge-modal-shell {
            width: min(100%, 560px);
            max-height: min(92dvh, 760px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border-radius: 24px;
        }
        #badge-picker-modal .badge-modal-head {
            flex: 0 0 auto;
            padding: 12px 14px;
        }
        #badge-picker-modal .badge-modal-toolbar {
            display: grid;
            grid-template-columns: 42px 1fr 42px;
            align-items: center;
            gap: 8px;
        }
        #badge-picker-modal .badge-modal-action {
            width: 40px;
            height: 40px;
            border-radius: 13px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(255,255,255,.25);
            background: rgba(255,255,255,.14);
            color: #fff;
            box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
        }
        #badge-picker-modal .badge-modal-action:active { transform: scale(.94); }
        #badge-picker-modal .badge-student-compact {
            margin-top: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 0;
        }
        #badge-picker-modal .badge-student-avatar {
            width: 36px;
            height: 36px;
            border-radius: 12px;
            flex: 0 0 36px;
        }
        #badge-picker-modal .badge-student-name {
            max-width: min(78vw, 390px);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 13px;
            line-height: 1.35;
        }
        #badge-picker-modal .badge-modal-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            padding: 12px;
            background: #fff;
        }
        #badge-picker-modal #picker-badges-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 9px;
        }
        #badge-picker-modal .badge-pick-card {
            min-height: 112px;
            padding: 10px 8px;
            gap: 6px;
            border-radius: 16px;
        }
        #badge-picker-modal .badge-pick-visual { font-size: 28px; line-height: 1; }
        #badge-picker-modal .badge-pick-name {
            font-size: 11px;
            line-height: 1.35;
            min-height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            overflow: hidden;
        }
        #badge-picker-modal .badge-counter-row { gap: 8px; }
        #badge-picker-modal .badge-counter-btn {
            width: 34px;
            height: 34px;
            border-radius: 11px;
            font-size: 16px;
        }
        #badge-picker-modal .badge-modal-footer {
            flex: 0 0 auto;
            padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
            border-top: 1px solid #e2e8f0;
            background: rgba(255,255,255,.96);
            backdrop-filter: blur(10px);
            display: flex;
            gap: 8px;
        }
        #badge-picker-modal .badge-modal-footer button { min-height: 42px; }
        @media (max-width: 480px) {
            #badge-picker-modal { align-items: flex-end !important; padding: 0 !important; }
            #badge-picker-modal .badge-modal-shell {
                width: 100%;
                max-height: 91dvh;
                border-radius: 24px 24px 0 0;
            }
            #badge-picker-modal .badge-modal-head { padding: 10px 12px 9px; }
            #badge-picker-modal .badge-modal-toolbar { grid-template-columns: 38px 1fr 38px; }
            #badge-picker-modal .badge-modal-action { width: 36px; height: 36px; border-radius: 11px; }
            #badge-picker-modal .badge-modal-title { font-size: 15px !important; }
            #badge-picker-modal .badge-modal-subtitle { display: none; }
            #badge-picker-modal .badge-student-compact { margin-top: 5px; }
            #badge-picker-modal .badge-student-avatar { width: 30px; height: 30px; flex-basis: 30px; border-radius: 10px; }
            #badge-picker-modal .badge-student-name { font-size: 12px; max-width: 72vw; }
            #badge-picker-modal .badge-modal-body { padding: 9px; }
            #badge-picker-modal #picker-badges-grid { gap: 7px; }
            #badge-picker-modal .badge-pick-card { min-height: 100px; padding: 8px 6px; }
            #badge-picker-modal .badge-pick-visual { font-size: 24px; }
            #badge-picker-modal .badge-pick-name { font-size: 10px; min-height: 27px; }
            #badge-picker-modal .badge-counter-btn { width: 32px; height: 32px; }
        }

    

        /* V10.8 — Smart class statistics, grade-aware analysis, charts, and controlled A4 pagination */
        .stats-kpi-card { border-radius: 1.25rem; padding: 14px; border: 1px solid #e2e8f0; background:#fff; box-shadow:0 5px 16px rgba(15,23,42,.04); }
        .stats-kpi-label { font-size:9px; font-weight:900; color:#64748b; margin-bottom:4px; }
        .stats-kpi-value { font-size:23px; font-weight:900; color:#0f172a; line-height:1.15; }
        .stats-kpi-sub { font-size:8px; font-weight:800; color:#94a3b8; margin-top:3px; }
        .stats-analysis-card { break-inside:avoid; page-break-inside:avoid; border:1px solid #e2e8f0; background:#fff; border-radius:1.35rem; padding:16px; box-shadow:0 4px 14px rgba(15,23,42,.035); }
        .stats-section-title { font-size:15px; font-weight:900; color:#0f172a; margin-bottom:12px; padding-right:10px; border-right:5px solid var(--primary-color); }
        .stats-progress-row { display:grid; grid-template-columns:110px 1fr 52px; gap:9px; align-items:center; margin-bottom:9px; }
        .stats-progress-label { font-size:10px; font-weight:900; color:#475569; }
        .stats-progress-track { height:10px; border-radius:999px; background:#e2e8f0; overflow:hidden; }
        .stats-progress-fill { height:100%; border-radius:999px; background:linear-gradient(90deg,var(--primary-color),#0f172a); }
        .stats-progress-value { font-size:10px; font-weight:900; color:#0f172a; text-align:left; }
        .stats-level-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
        .stats-level-item { border:1px solid #e2e8f0; border-radius:14px; padding:10px 6px; text-align:center; background:#f8fafc; }
        .stats-level-count { font-size:20px; font-weight:900; color:#0f172a; }
        .stats-level-label { font-size:9px; font-weight:900; color:#64748b; margin-top:2px; }
        .stats-student-table { width:100%; border-collapse:collapse; font-size:9px; }
        .stats-student-table th { background:#f1f5f9; color:#334155; font-weight:900; padding:7px 5px; border:1px solid #cbd5e1; }
        .stats-student-table td { padding:6px 5px; border:1px solid #e2e8f0; text-align:center; font-weight:800; color:#334155; }
        .stats-student-table td:first-child { text-align:right; font-weight:900; }
        .stats-follow-chip { display:inline-flex; align-items:center; justify-content:center; padding:2px 6px; border-radius:999px; font-size:8px; font-weight:900; }
        .stats-chart-bars { display:flex; align-items:flex-end; gap:10px; min-height:150px; padding:12px 8px 4px; border-top:1px dashed #e2e8f0; margin-top:10px; }
        .stats-chart-col { flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:6px; height:140px; }
        .stats-chart-value { font-size:10px; font-weight:900; color:#334155; }
        .stats-chart-track { width:min(52px,80%); height:96px; border-radius:14px 14px 8px 8px; background:#f1f5f9; border:1px solid #e2e8f0; display:flex; align-items:flex-end; overflow:hidden; }
        .stats-chart-fill { width:100%; min-height:3px; border-radius:12px 12px 6px 6px; background:linear-gradient(180deg,#10b981,#047857); }
        .stats-chart-label { font-size:9px; font-weight:900; color:#64748b; text-align:center; line-height:1.3; }
        .student-progress-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:10px; }
        .student-progress-card { border:1px solid #e2e8f0; border-radius:16px; padding:9px; background:#f8fafc; min-width:0; }
        .student-progress-head { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:6px; }
        .student-progress-title { font-size:10px; font-weight:900; color:#334155; }
        .student-progress-count { font-size:9px; font-weight:900; color:#047857; white-space:nowrap; }
        .student-progress-list { font-size:8px; font-weight:700; line-height:1.65; color:#64748b; max-height:58px; overflow:hidden; }
        .student-progress-list b { color:#334155; }
        .student-analysis-box { border:1px solid #dbeafe; background:#f8fbff; border-radius:18px; padding:11px 12px; margin-top:10px; }
        .student-analysis-title { font-size:11px; font-weight:900; color:#1e3a8a; margin-bottom:5px; }
        .student-analysis-text { font-size:9px; font-weight:700; line-height:1.8; color:#475569; }
        .student-recommend-box { border:1px solid #d1fae5; background:#ecfdf5; border-radius:18px; padding:11px 12px; margin-top:8px; }
        .student-recommend-title { font-size:11px; font-weight:900; color:#065f46; margin-bottom:5px; }
        .student-recommend-text { font-size:9px; font-weight:700; line-height:1.8; color:#475569; }
        @media (max-width:767px) { .student-progress-grid { grid-template-columns:1fr; } }

        .stats-classify-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
        .stats-classify-item { border:1px solid #e2e8f0; border-radius:16px; padding:12px 8px; text-align:center; background:#f8fafc; }
        .stats-classify-count { font-size:24px; font-weight:900; line-height:1; color:#0f172a; }
        .stats-classify-label { font-size:10px; font-weight:900; color:#475569; margin-top:5px; }
        .stats-classify-bar { height:7px; border-radius:999px; background:#e2e8f0; overflow:hidden; margin-top:8px; }
        .stats-classify-fill { height:100%; border-radius:999px; background:#0f766e; }
        .stats-pending-note { border:1px dashed #cbd5e1; background:#f8fafc; border-radius:14px; padding:10px 12px; font-size:10px; font-weight:800; color:#64748b; line-height:1.7; }
        .stats-print-pages { display:none; }
        .stats-print-page { width:190mm; min-height:277mm; box-sizing:border-box; padding:0; background:#fff; page-break-after:always; break-after:page; position:relative; }
        .stats-print-page:last-child { page-break-after:auto; break-after:auto; }
        .stats-continuation-head { border-bottom:2px solid #cbd5e1; padding-bottom:3mm; margin-bottom:4mm; display:flex; align-items:center; justify-content:space-between; gap:8mm; }
        .stats-continuation-head .title { font-size:16px; font-weight:900; color:#0f172a; }
        .stats-continuation-head .meta { font-size:9px; font-weight:800; color:#64748b; text-align:left; }
        .stats-print-page .stats-analysis-card, .stats-print-page .stats-kpi-card { box-shadow:none !important; }
        .stats-print-footer { position:absolute; bottom:0; right:0; left:0; border-top:1px solid #e2e8f0; padding-top:2mm; font-size:8px; font-weight:800; color:#94a3b8; display:flex; justify-content:space-between; }
        @media (max-width:767px) {
            #stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
            .stats-level-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
            .stats-progress-row { grid-template-columns:85px 1fr 45px; }
            .stats-student-table { font-size:8px; }
        }
        @media print {
            #stats-report-section { width:190mm !important; max-width:190mm !important; padding:0 !important; border:0 !important; box-shadow:none !important; border-radius:0 !important; }
            #stats-report-section > :not(.stats-print-pages) { display:none !important; }
            #stats-report-section .stats-print-pages { display:block !important; }
            .stats-print-page { display:block !important; }
            .stats-analysis-card, .stats-kpi-card, .stats-level-item { break-inside:avoid !important; page-break-inside:avoid !important; }
            .stats-student-table tr { break-inside:avoid !important; page-break-inside:avoid !important; }
            .stats-student-table thead { display:table-header-group; }
        }

    
        /* V11.6 — شهادات الشكر والتقدير */
        .certificate-shell { background: linear-gradient(180deg,#fff, #f8fafc); border:1px solid #e2e8f0; border-radius: 28px; overflow:hidden; box-shadow:0 20px 35px rgba(15,23,42,.08); }
        .certificate-stage { max-width: 210mm; margin: 0 auto; }
        .certificate-preview-page { width: 100%; background:#fff; border-radius: 28px; overflow:hidden; position: relative; }
        .certificate-topbar { padding: 18px 22px; color:#fff; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
        .certificate-theme-teal .certificate-topbar{ background:linear-gradient(135deg,#0f766e,#14b8a6); }
        .certificate-theme-blue .certificate-topbar{ background:linear-gradient(135deg,#1d4ed8,#3b82f6); }
        .certificate-theme-gold .certificate-topbar{ background:linear-gradient(135deg,#b45309,#f59e0b); }
        .certificate-theme-purple .certificate-topbar{ background:linear-gradient(135deg,#7c3aed,#a855f7); }
        .certificate-theme-rose .certificate-topbar{ background:linear-gradient(135deg,#be123c,#fb7185); }
        .certificate-theme-emerald .certificate-topbar{ background:linear-gradient(135deg,#047857,#10b981); }
        .certificate-theme-sky .certificate-topbar{ background:linear-gradient(135deg,#0369a1,#0ea5e9); }
        .certificate-mini-card.certificate-theme-teal .certificate-mini-head{ background:linear-gradient(135deg,#0f766e,#14b8a6); }
        .certificate-mini-card.certificate-theme-blue .certificate-mini-head{ background:linear-gradient(135deg,#1d4ed8,#3b82f6); }
        .certificate-mini-card.certificate-theme-gold .certificate-mini-head{ background:linear-gradient(135deg,#b45309,#f59e0b); }
        .certificate-mini-card.certificate-theme-purple .certificate-mini-head{ background:linear-gradient(135deg,#7c3aed,#a855f7); }
        .certificate-mini-card.certificate-theme-rose .certificate-mini-head{ background:linear-gradient(135deg,#be123c,#fb7185); }
        .certificate-mini-card.certificate-theme-emerald .certificate-mini-head{ background:linear-gradient(135deg,#047857,#10b981); }
        .certificate-mini-card.certificate-theme-sky .certificate-mini-head{ background:linear-gradient(135deg,#0369a1,#0ea5e9); }
        .certificate-watermark { position:absolute; inset:auto 18px 18px auto; opacity:.05; font-size:120px; font-weight:900; line-height:1; pointer-events:none; }
        .certificate-body { padding: 22px; background: radial-gradient(circle at top left, rgba(255,255,255,.95), rgba(248,250,252,1)); }
        .certificate-title { text-align:center; margin:10px 0 6px; font-size:29px; font-weight:900; color:#0f172a; }
        .certificate-subtitle { text-align:center; color:#64748b; font-weight:800; font-size:12px; margin-bottom:14px; }
        .certificate-student-banner { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
        .certificate-student-chip { padding:8px 14px; border-radius:999px; background:#f8fafc; border:1px solid #e2e8f0; font-weight:900; font-size:12px; color:#0f172a; }
        .certificate-message { background:#fff; border:2px dashed #cbd5e1; border-radius:24px; padding:18px 16px; text-align:center; font-size:17px; font-weight:800; line-height:2.1; color:#1e293b; }
        .certificate-meta-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:16px; }
        .certificate-meta-box { background:#f8fafc; border:1px solid #e2e8f0; border-radius:20px; padding:12px; }
        .certificate-meta-label { font-size:10px; color:#64748b; font-weight:900; margin-bottom:5px; }
        .certificate-meta-value { font-size:13px; color:#0f172a; font-weight:900; line-height:1.8; }
        .certificate-signs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:16px; }
        .certificate-sign-card { background:#fff; border-top:2px solid #cbd5e1; padding-top:10px; text-align:center; }
        .certificate-sign-role { font-size:11px; color:#64748b; font-weight:900; }
        .certificate-sign-name { font-size:14px; color:#0f172a; font-weight:900; margin-top:6px; }
        .certificate-tools { display:flex; gap:10px; flex-wrap:wrap; }
        .certificate-mini-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; }
        .certificate-mini-card { border:1px solid #e2e8f0; border-radius:22px; overflow:hidden; background:#fff; box-shadow:0 12px 24px rgba(15,23,42,.06); }
        .certificate-mini-head { padding:12px 14px; color:#fff; font-weight:900; display:flex; justify-content:space-between; gap:8px; align-items:center; }
        .certificate-mini-body { padding:14px; }
        .certificate-mini-text { font-size:11px; line-height:1.95; color:#334155; font-weight:800; min-height:52px; }
        .certificate-mini-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
        .certificate-type-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
        .certificate-type-card { border:1.5px solid #e2e8f0; border-radius:18px; padding:12px 10px; background:#fff; text-align:center; cursor:pointer; transition:.2s; }
        .certificate-type-card.active { border-color:#0ea5e9; box-shadow:0 0 0 4px rgba(14,165,233,.12); transform:translateY(-1px); }
        .certificate-type-icon { font-size:26px; line-height:1; margin-bottom:6px; }
        .certificate-type-name { font-size:12px; font-weight:900; color:#0f172a; }
        .certificate-type-note { font-size:10px; color:#64748b; font-weight:800; margin-top:4px; line-height:1.7; }
        @media (max-width: 768px) {
            #certificate-modal { align-items:flex-end !important; padding:0 !important; }
            #certificate-modal .modal-card { width:100% !important; max-width:none !important; height:92vh; border-radius:24px 24px 0 0; overflow:hidden; }
            #certificate-modal .modal-content { padding:12px !important; }
            .certificate-title { font-size:24px; }
            .certificate-message { font-size:15px; padding:16px 12px; }
            .certificate-meta-grid, .certificate-signs { grid-template-columns:1fr; }
            .certificate-tools button { flex:1 1 calc(50% - 6px); }
        }

    
        /* V11.6 — شهادة رسمية مستوحاة من نمط شهادات التقدير */
        .certificate-shell{
            --cert:#2457a7; --cert2:#4c7dd1; --certDark:#173f7e;
            position:relative; background:#fff; border:1px solid #dbe3ee; border-radius:26px;
            overflow:hidden; box-shadow:0 22px 45px rgba(15,23,42,.14); isolation:isolate;
        }
        .certificate-theme-gold{--cert:#c77600;--cert2:#f3a10c;--certDark:#8f4d00}
        .certificate-theme-blue{--cert:#285eb4;--cert2:#5b8de1;--certDark:#173f7e}
        .certificate-theme-purple{--cert:#6d3fc0;--cert2:#9b6be6;--certDark:#4a288c}
        .certificate-theme-emerald{--cert:#0d7b65;--cert2:#35aa8d;--certDark:#075545}
        .certificate-theme-sky{--cert:#1678ad;--cert2:#55a9d6;--certDark:#0b527b}
        .certificate-theme-teal{--cert:#0f766e;--cert2:#42b8ad;--certDark:#0a554f}
        .certificate-theme-rose{--cert:#b8385b;--cert2:#e66f91;--certDark:#81253f}
        .certificate-preview-page{position:relative;min-height:500px;background:#fff;overflow:hidden}
        .certificate-preview-page:before,
        .certificate-preview-page:after{content:"";position:absolute;z-index:0;pointer-events:none;border-radius:50% 50% 0 0}
        .certificate-preview-page:before{width:115%;height:190px;left:-14%;bottom:-92px;background:var(--cert);transform:rotate(3deg);box-shadow:0 -22px 0 rgba(226,232,240,.75)}
        .certificate-preview-page:after{width:78%;height:115px;right:-16%;bottom:-45px;background:var(--certDark);transform:rotate(-8deg)}
        .certificate-topbar{position:relative;z-index:2;background:transparent!important;color:#0f172a;padding:20px 24px 10px;display:grid;grid-template-columns:1fr auto 1fr;align-items:start;gap:12px;border-bottom:none}
        .certificate-topbar>div:first-child{font-weight:900;line-height:1.8}
        .certificate-topbar>div:last-child{text-align:left!important;font-weight:900}
        .certificate-topbar .text-center{color:var(--certDark)}
        .certificate-body{position:relative;z-index:2;padding:8px 34px 105px;background:transparent!important}
        .certificate-emblem-wrap{margin:0 0 5px;display:flex;justify-content:center}
        .certificate-emblem{position:relative;min-width:136px;padding:9px 18px;border-radius:999px;background:#fff;border:2px solid rgba(36,87,167,.24);box-shadow:0 8px 18px rgba(15,23,42,.10);display:inline-flex;align-items:center;justify-content:center;gap:10px}
        .certificate-emblem:before,.certificate-emblem:after{content:"★";color:var(--cert);font-size:22px;opacity:.9}
        .certificate-emblem-icon{font-size:27px;line-height:1}
        .certificate-emblem-text{font-size:12px;font-weight:900;color:var(--certDark)}
        .certificate-title{font-size:34px!important;line-height:1.35;margin:10px 0 2px!important;text-align:center;color:#0b1324!important;font-weight:900}
        .certificate-subtitle{font-size:13px!important;color:var(--cert)!important;text-align:center;font-weight:900;letter-spacing:.2px;margin-bottom:10px!important}
        .certificate-ornament{display:flex;align-items:center;justify-content:center;gap:9px;margin:7px auto 16px;color:var(--cert)}
        .certificate-ornament:before,.certificate-ornament:after{content:"";height:2px;width:min(25vw,175px);background:linear-gradient(90deg,transparent,var(--cert),transparent)}
        .certificate-student-banner{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:0 0 14px!important}
        .certificate-student-chip{padding:7px 13px;border-radius:999px;background:#fff;border:1px solid #dbe3ee;box-shadow:0 3px 8px rgba(15,23,42,.04);font-size:11px!important;font-weight:900;color:#334155}
        .certificate-recipient-label{text-align:center;color:#475569;font-size:14px;font-weight:900;margin-top:6px}
        .certificate-recipient-name{text-align:center;color:#0b1324;font-size:32px;font-weight:900;line-height:1.35;margin:5px 0 9px}
        .certificate-message{max-width:700px;margin:0 auto;background:transparent!important;border:none!important;border-radius:0!important;padding:7px 15px!important;text-align:center;font-size:16px!important;font-weight:800;line-height:2;color:#1e293b!important}
        .certificate-signs{position:relative;z-index:2;display:grid;grid-template-columns:1fr 1fr;gap:34px;margin:23px auto 0!important;max-width:620px}
        .certificate-sign-card{background:rgba(255,255,255,.94)!important;border-top:2px solid #cbd5e1!important;padding:9px 8px 0!important;text-align:center}
        .certificate-sign-role{font-size:10px!important;color:#64748b!important;font-weight:900}
        .certificate-sign-name{font-size:13px!important;color:#0f172a!important;font-weight:900;margin-top:4px!important}
        .certificate-watermark{position:absolute!important;left:28px!important;right:auto!important;bottom:20px!important;font-size:90px!important;opacity:.055!important;z-index:1}
        .certificate-footer-strip,.certificate-meta-grid{display:none!important}
        @media(max-width:640px){
            .certificate-preview-page{min-height:430px}.certificate-topbar{padding:14px 14px 8px;grid-template-columns:1.25fr .8fr .8fr;font-size:10px}.certificate-body{padding:5px 15px 88px}.certificate-title{font-size:25px!important}.certificate-subtitle{font-size:11px!important}.certificate-recipient-name{font-size:25px}.certificate-message{font-size:13px!important;line-height:1.9;padding:5px 4px!important}.certificate-signs{gap:12px;margin-top:16px!important}.certificate-emblem{min-width:112px;padding:7px 12px}.certificate-emblem:before,.certificate-emblem:after{font-size:17px}.certificate-preview-page:before{height:135px;bottom:-73px}.certificate-preview-page:after{height:90px;bottom:-48px}.certificate-watermark{font-size:65px!important;left:12px!important}}



/* V11.6 Report PDF layout fix — cohesive A4 pagination */
.student-report-tail { display:block; }
@media print {
    .student-report-sheet { width:190mm !important; min-height:0 !important; height:auto !important; overflow:visible !important; box-shadow:none !important; }
    .student-report-body { min-height:0 !important; height:auto !important; padding:5mm 7mm 5mm !important; gap:3mm !important; }
    .student-report-topbar,.student-report-title,.student-report-summary,.report-panel,.student-report-main,.student-report-tail,.certificate-report-item,.exam-report-footer-box { break-inside:avoid !important; page-break-inside:avoid !important; }
    .student-report-topbar { grid-template-columns:1fr 60px 1fr !important; font-size:9.5px !important; padding-bottom:2.5mm !important; }
    .student-report-logo { width:54px !important; height:54px !important; }
    .student-report-title { padding:2.4mm 4mm !important; }
    .student-report-title h2 { font-size:19px !important; }
    .student-report-summary { gap:7px !important; }
    .student-report-summary .student-card { padding:9px 11px !important; border-radius:15px !important; }
    .student-report-avatar,.student-report-avatar-fallback { width:48px !important; height:48px !important; border-radius:12px !important; }
    .rank-card,.rating-card { padding:7px !important; border-radius:14px !important; min-height:70px !important; }
    .student-report-sheet button { display:none !important; }
    .student-report-sheet .report-panel { padding:8px !important; border-radius:14px !important; }
    .student-report-sheet .report-panel-title { font-size:13px !important; margin-bottom:6px !important; padding-right:7px !important; border-right-width:4px !important; }
    .student-progress-grid { gap:6px !important; }
    .student-progress-card { padding:7px !important; border-radius:12px !important; }
    .student-analysis-box,.student-recommend-box { padding:7px 9px !important; margin-top:6px !important; border-radius:12px !important; }
    .student-analysis-title,.student-recommend-title { font-size:10px !important; }
    .student-analysis-text,.student-recommend-text { font-size:8.5px !important; line-height:1.6 !important; }
    .student-certificates-section { break-before:page !important; page-break-before:always !important; margin-top:0 !important; }
    .certificate-report-stack { gap:8px !important; }
    .certificate-report-item { padding:6px !important; border-radius:14px !important; box-shadow:none !important; }
    .certificate-report-toolbar { margin-bottom:5px !important; }
    .certificate-report-meta { font-size:9px !important; }
    .student-report-sheet .certificate-report-paper .certificate-shell { border-radius:14px !important; box-shadow:none !important; }
    .student-report-sheet .certificate-report-paper .certificate-preview-page { min-height:350px !important; }
    .student-report-sheet .certificate-report-paper .certificate-topbar { padding:10px 14px 5px !important; font-size:9px !important; }
    .student-report-sheet .certificate-report-paper .certificate-body { padding:2px 20px 66px !important; }
    .student-report-sheet .certificate-report-paper .certificate-emblem-wrap { margin:-8px 0 3px !important; }
    .student-report-sheet .certificate-report-paper .certificate-emblem { min-width:90px !important; padding:5px 10px !important; gap:6px !important; }
    .student-report-sheet .certificate-report-paper .certificate-emblem-icon { font-size:20px !important; }
    .student-report-sheet .certificate-report-paper .certificate-emblem-text { font-size:9px !important; }
    .student-report-sheet .certificate-report-paper .certificate-title { font-size:23px !important; margin:4px 0 0 !important; }
    .student-report-sheet .certificate-report-paper .certificate-subtitle { font-size:9px !important; }
    .student-report-sheet .certificate-report-paper .certificate-ornament { margin:2px 0 !important; }
    .student-report-sheet .certificate-report-paper .certificate-recipient-label { font-size:10px !important; margin-top:2px !important; }
    .student-report-sheet .certificate-report-paper .certificate-recipient-name { font-size:22px !important; margin:2px 0 4px !important; }
    .student-report-sheet .certificate-report-paper .certificate-message { font-size:11px !important; line-height:1.65 !important; padding:3px 4px !important; }
    .student-report-sheet .certificate-report-paper .certificate-signs { grid-template-columns:1fr 1fr !important; gap:24px !important; margin-top:10px !important; }
    .student-report-sheet .certificate-report-paper .certificate-sign-card { padding-top:5px !important; }
    .student-report-sheet .certificate-report-paper .certificate-sign-role { font-size:8px !important; }
    .student-report-sheet .certificate-report-paper .certificate-sign-name { font-size:10px !important; margin-top:2px !important; }
    .student-report-sheet .certificate-report-paper .certificate-preview-page:before { height:115px !important; bottom:-65px !important; }
    .student-report-sheet .certificate-report-paper .certificate-preview-page:after { height:70px !important; bottom:-40px !important; }
    .student-report-main { grid-template-columns:1.12fr .88fr !important; gap:7px !important; }
    .ring-wrap,.ring-wrap svg { width:108px !important; height:108px !important; }
    .badges-box { padding:6px !important; }
    .badge-item { width:54px !important; min-height:50px !important; border-radius:11px !important; }
    .exam-report-footer-box { display:flex !important; flex-direction:row !important; align-items:flex-start !important; gap:18px !important; margin-top:8px !important; padding-top:6px !important; }
    .exam-report-signature { flex:1 1 50% !important; min-width:0 !important; font-size:10px !important; line-height:1.55 !important; }
    .exam-report-signature .label { margin-bottom:12px !important; }
}


/* V11.6 — Report student full-name fix */
.student-card > .flex { flex: 1 1 auto; min-width: 0; }
.student-card > .flex > .min-w-0 { flex: 1 1 auto; min-width: 0; }
.student-report-name {
    margin-top: 4px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 900;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 100%;
}
@media print {
    .student-report-name {
        font-size: 14px !important;
        line-height: 1.35 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    .student-card > .flex { flex: 1 1 auto !important; min-width: 0 !important; }
}


/* V11.6 compact awards — one fixed icon for badges + one fixed icon for certificates */
#main-table .tracking-name-actions{flex-wrap:nowrap!important;overflow:visible!important;max-width:100%;}
#main-table .tracking-award-icon{position:relative;width:22px;height:22px;min-width:22px;max-width:22px;flex:0 0 22px;padding:0;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;overflow:visible;box-shadow:0 1px 4px rgba(15,23,42,.08);}
#main-table .tracking-award-icon-badge{background:#fffbeb;border:1px solid #fbbf24;color:#92400e;}
#main-table .tracking-award-icon-cert{background:#faf5ff;border:1px solid #c4b5fd;color:#6d28d9;}
#main-table .tracking-award-glyph{font-size:12px;line-height:1;display:block;}
#main-table .tracking-award-count{position:absolute;top:-6px;left:-6px;min-width:14px;height:14px;padding:0 3px;border-radius:999px;background:#0f172a;color:#fff;border:1.5px solid #fff;font-size:7px;font-weight:900;line-height:11px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;white-space:nowrap;}
#main-table .tracking-award-icon-cert .tracking-award-count{background:#7c3aed;}
#main-table .tracking-badge-signature,#main-table .tracking-cert-signature{display:none!important;}
@media(max-width:640px){
  #main-table .tracking-name-actions{gap:3px!important;}
  #main-table .tracking-award-icon{width:19px;height:19px;min-width:19px;max-width:19px;flex-basis:19px;}
  #main-table .tracking-award-glyph{font-size:10px;}
  #main-table .tracking-award-count{top:-5px;left:-5px;min-width:12px;height:12px;font-size:6.5px;padding:0 2px;}
}

/* Badge history modal */
.award-history-modal-head{background:linear-gradient(135deg,#b45309,#f59e0b);}
.award-history-summary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px;}
.award-history-chip{display:inline-flex;align-items:center;gap:5px;padding:7px 11px;border-radius:999px;background:#fffbeb;color:#92400e;border:1px solid #fde68a;font-size:10px;font-weight:900;}
.award-history-chip .badge-media-inline{width:16px!important;height:16px!important;object-fit:contain;border-radius:999px;}
.award-history-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:12px;}
.award-history-card{background:linear-gradient(180deg,#fffdf7,#fff);border:1px solid #fde7b0;border-radius:22px;padding:14px;box-shadow:0 10px 24px rgba(15,23,42,.07);}
.award-history-head{display:flex;align-items:center;gap:11px;margin-bottom:11px;}
.award-history-visual{width:48px;height:48px;min-width:48px;border-radius:16px;display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid #fde68a;overflow:hidden;}
.award-history-visual .badge-media-thumb{width:34px!important;height:34px!important;object-fit:contain;border-radius:10px;}
.award-history-title{font-size:14px;font-weight:900;color:#0f172a;line-height:1.5;}
.award-history-seq{font-size:9px;font-weight:800;color:#a16207;margin-top:2px;}
.award-history-date-row{display:grid;grid-template-columns:auto 1fr;gap:5px 8px;padding:10px 11px;border-radius:15px;background:#f8fafc;border:1px solid #e2e8f0;font-size:10px;font-weight:800;color:#475569;line-height:1.7;}
.award-history-date-row span:first-child{grid-row:1 / span 2;align-self:center;padding:5px 8px;border-radius:999px;background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;font-weight:900;}
.award-history-date-row.award-history-undated{grid-template-columns:1fr;}
.award-history-date-row.award-history-undated span:first-child{grid-row:auto;}
.award-history-note{margin-top:9px;font-size:10px;color:#64748b;font-weight:800;line-height:1.8;}
.certificate-history-date{line-height:1.75!important;white-space:normal!important;}
@media(max-width:640px){
  #badge-history-modal{align-items:flex-end!important;padding:0!important;}
  #badge-history-modal .award-history-shell{width:100%!important;max-width:none!important;height:90vh;border-radius:24px 24px 0 0!important;}
  .award-history-grid{grid-template-columns:1fr;gap:9px;}
  .award-history-card{padding:12px;border-radius:18px;}
  .award-history-visual{width:42px;height:42px;min-width:42px;border-radius:14px;}
  .award-history-date-row{font-size:9.5px;}
}


/* V11.7 — ترتيب الطالب + تصدير ثابت A4 + شهادة مستقلة */
.student-rank-highlight{background:linear-gradient(180deg,#fff,#f8fafc);border:1px solid #dbeafe;box-shadow:0 8px 22px rgba(15,23,42,.06)}
.student-rank-number{display:flex;align-items:center;justify-content:center;gap:7px;font-size:20px;font-weight:900;color:#0f172a;margin-top:3px;white-space:nowrap}
.student-rank-medal{font-size:24px;line-height:1}.student-rank-total{font-size:9px;font-weight:900;color:#64748b;margin-top:3px;text-align:center}.student-rank-classification{font-size:9px;font-weight:800;color:#0f766e;margin-top:4px;text-align:center}
.pdf-render-host .pdf-export-mode{display:block!important;visibility:visible!important;background:#fff!important;margin:0!important}
.pdf-export-mode .student-report-sheet{width:190mm!important;max-width:190mm!important;min-height:0!important;height:auto!important;margin:0 auto!important;border-radius:0!important;overflow:visible!important;box-shadow:none!important}
.pdf-export-mode .student-report-body{min-height:0!important;height:auto!important;padding:5mm 7mm 5mm!important;gap:3mm!important}
.pdf-export-mode .student-report-topbar{grid-template-columns:1fr 60px 1fr!important;font-size:9.5px!important;padding-bottom:2.5mm!important}
.pdf-export-mode .student-report-logo{width:54px!important;height:54px!important}.pdf-export-mode .student-report-title{padding:2.4mm 4mm!important}.pdf-export-mode .student-report-title h2{font-size:19px!important}
.pdf-export-mode .student-report-summary{grid-template-columns:1.25fr .9fr .85fr!important;gap:7px!important}.pdf-export-mode .student-report-name{font-size:14px!important;line-height:1.35!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important}
.pdf-export-mode .report-panel{padding:8px!important;border-radius:14px!important;break-inside:avoid!important;page-break-inside:avoid!important}.pdf-export-mode .student-report-main{grid-template-columns:1.12fr .88fr!important;gap:7px!important;break-inside:avoid!important}.pdf-export-mode .student-report-tail{break-inside:avoid!important}.pdf-export-mode .exam-report-footer-box{display:flex!important;flex-direction:row!important;gap:18px!important;break-inside:avoid!important}
.pdf-export-mode .student-certificates-section{break-before:page!important;page-break-before:always!important}.pdf-export-mode .certificate-report-item{break-inside:avoid!important;page-break-inside:avoid!important;padding:6px!important;box-shadow:none!important}.pdf-export-mode button{display:none!important}
.certificate-standalone-export{width:190mm!important;margin:0 auto!important;background:#fff!important}.certificate-standalone-export .certificate-shell{width:190mm!important;max-width:190mm!important;border-radius:0!important;box-shadow:none!important}.certificate-standalone-export .certificate-preview-page{min-height:267mm!important;height:267mm!important}.certificate-standalone-export .certificate-topbar{padding:16mm 14mm 5mm!important}.certificate-standalone-export .certificate-body{padding:4mm 15mm 30mm!important}.certificate-standalone-export .certificate-title{font-size:34px!important}.certificate-standalone-export .certificate-recipient-name{font-size:30px!important}.certificate-standalone-export .certificate-message{font-size:16px!important;line-height:1.9!important;max-width:160mm!important;margin-left:auto!important;margin-right:auto!important}.certificate-standalone-export .certificate-signs{display:grid!important;grid-template-columns:1fr 1fr!important;gap:24mm!important;margin-top:14mm!important}
@media(max-width:640px){.student-rank-number{font-size:17px}.student-rank-medal{font-size:21px}}

/* V11.7.4 — PDF/Drive report layout parity with print A4 */
.pdf-render-host{width:210mm!important;max-width:210mm!important;box-sizing:border-box!important;direction:rtl!important;overflow:visible!important;}
.pdf-render-host .pdf-export-mode{width:200mm!important;max-width:200mm!important;margin:0 auto!important;box-sizing:border-box!important;overflow:visible!important;direction:rtl!important;}
.pdf-export-mode,.pdf-export-mode *{box-sizing:border-box!important;}
.pdf-export-mode .student-report-sheet{width:190mm!important;max-width:190mm!important;margin:0 auto!important;overflow:visible!important;}
.pdf-export-mode .student-report-body{width:100%!important;max-width:100%!important;overflow:visible!important;}
.pdf-export-mode .student-report-topbar,
.pdf-export-mode .student-report-title,
.pdf-export-mode .student-report-summary,
.pdf-export-mode .student-report-main,
.pdf-export-mode .student-report-tail,
.pdf-export-mode .report-panel,
.pdf-export-mode .student-card,
.pdf-export-mode .rank-card,
.pdf-export-mode .rating-card,
.pdf-export-mode .certificate-report-item,
.pdf-export-mode .certificate-report-paper,
.pdf-export-mode .certificate-shell,
.pdf-export-mode .certificate-preview-page,
.pdf-export-mode .exam-report-footer-box{min-width:0!important;max-width:100%!important;}
.pdf-export-mode .student-report-summary>* ,
.pdf-export-mode .student-report-main>*{min-width:0!important;max-width:100%!important;overflow:hidden!important;}
.pdf-export-mode .student-report-name,
.pdf-export-mode .certificate-recipient-name,
.pdf-export-mode .certificate-message,
.pdf-export-mode .student-progress-list,
.pdf-export-mode .report-panel{overflow-wrap:anywhere!important;word-break:normal!important;white-space:normal!important;}

/* Keep the first page compact and balanced */
.pdf-export-mode .student-report-summary{grid-template-columns:1.3fr .82fr .78fr!important;gap:6px!important;}
.pdf-export-mode .student-report-summary .student-card{padding:8px 9px!important;border-radius:14px!important;}
.pdf-export-mode .rank-card,.pdf-export-mode .rating-card{padding:8px!important;border-radius:14px!important;}
.pdf-export-mode .student-progress-grid{gap:6px!important;}
.pdf-export-mode .student-progress-card{padding:7px!important;border-radius:12px!important;min-width:0!important;}
.pdf-export-mode .student-progress-title{font-size:9px!important;}.pdf-export-mode .student-progress-count{font-size:8px!important;}
.pdf-export-mode .student-progress-list{font-size:7.5px!important;line-height:1.55!important;}

/* Page 2: compact certificate followed by skills/badges/signatures */
.pdf-export-mode .student-certificates-section{break-before:page!important;page-break-before:always!important;margin-top:0!important;}
.pdf-export-mode .certificate-report-stack{gap:6px!important;}
.pdf-export-mode .certificate-report-item{padding:5px!important;border-radius:12px!important;margin:0!important;}
.pdf-export-mode .certificate-report-toolbar{margin-bottom:4px!important;min-height:0!important;}
.pdf-export-mode .certificate-report-meta{font-size:8.5px!important;line-height:1.4!important;}
.pdf-export-mode .certificate-report-paper .certificate-shell{border-radius:12px!important;box-shadow:none!important;width:100%!important;max-width:100%!important;overflow:hidden!important;}
.pdf-export-mode .certificate-report-paper .certificate-preview-page{min-height:315px!important;height:315px!important;width:100%!important;overflow:hidden!important;}
.pdf-export-mode .certificate-report-paper .certificate-topbar{padding:8px 12px 4px!important;grid-template-columns:1fr auto 1fr!important;gap:6px!important;font-size:8px!important;}
.pdf-export-mode .certificate-report-paper .certificate-body{padding:0 16px 58px!important;}
.pdf-export-mode .certificate-report-paper .certificate-emblem-wrap{margin:-6px 0 2px!important;}
.pdf-export-mode .certificate-report-paper .certificate-emblem{min-width:82px!important;padding:4px 8px!important;gap:5px!important;}
.pdf-export-mode .certificate-report-paper .certificate-emblem-icon{font-size:18px!important;}
.pdf-export-mode .certificate-report-paper .certificate-emblem-text{font-size:8px!important;}
.pdf-export-mode .certificate-report-paper .certificate-title{font-size:20px!important;line-height:1.2!important;margin:2px 0 0!important;}
.pdf-export-mode .certificate-report-paper .certificate-subtitle{font-size:8px!important;line-height:1.2!important;}
.pdf-export-mode .certificate-report-paper .certificate-ornament{margin:1px 0!important;font-size:12px!important;}
.pdf-export-mode .certificate-report-paper .certificate-recipient-label{font-size:8.5px!important;margin-top:1px!important;}
.pdf-export-mode .certificate-report-paper .certificate-recipient-name{font-size:18px!important;line-height:1.25!important;margin:1px auto 3px!important;max-width:94%!important;text-align:center!important;}
.pdf-export-mode .certificate-report-paper .certificate-chip{font-size:7.5px!important;padding:3px 7px!important;}
.pdf-export-mode .certificate-report-paper .certificate-meta-row{gap:5px!important;margin-bottom:3px!important;}
.pdf-export-mode .certificate-report-paper .certificate-message{font-size:9px!important;line-height:1.55!important;padding:2px 3px!important;max-width:96%!important;margin:0 auto!important;}
.pdf-export-mode .certificate-report-paper .certificate-signs{display:grid!important;grid-template-columns:1fr 1fr!important;gap:18px!important;margin-top:7px!important;}
.pdf-export-mode .certificate-report-paper .certificate-sign-card{padding-top:4px!important;min-width:0!important;}
.pdf-export-mode .certificate-report-paper .certificate-sign-role{font-size:7px!important;}
.pdf-export-mode .certificate-report-paper .certificate-sign-name{font-size:8.5px!important;margin-top:1px!important;white-space:normal!important;}
.pdf-export-mode .certificate-report-paper .certificate-preview-page:before{height:92px!important;bottom:-54px!important;}
.pdf-export-mode .certificate-report-paper .certificate-preview-page:after{height:58px!important;bottom:-33px!important;}
.pdf-export-mode .certificate-report-paper .certificate-watermark{font-size:48px!important;bottom:8px!important;}

/* Tail should stay attached to page 2, not create a third page */
.pdf-export-mode .student-report-tail{margin-top:6px!important;break-inside:avoid!important;page-break-inside:avoid!important;}
.pdf-export-mode .student-report-main{grid-template-columns:1.12fr .88fr!important;gap:6px!important;break-inside:avoid!important;page-break-inside:avoid!important;}
.pdf-export-mode .student-report-main .report-panel{padding:7px!important;border-radius:12px!important;}
.pdf-export-mode .student-report-main .report-panel-title{font-size:11px!important;margin-bottom:4px!important;}
.pdf-export-mode .ring-wrap,.pdf-export-mode .ring-wrap svg{width:90px!important;height:90px!important;}
.pdf-export-mode .badges-box{padding:5px!important;}
.pdf-export-mode .badge-item{width:48px!important;min-height:48px!important;padding:4px!important;}
.pdf-export-mode .exam-report-footer-box{display:flex!important;flex-direction:row!important;align-items:flex-start!important;gap:18px!important;margin-top:5px!important;padding-top:4px!important;}
.pdf-export-mode .exam-report-signature{flex:1 1 50%!important;min-width:0!important;font-size:8.5px!important;line-height:1.4!important;text-align:center!important;}
.pdf-export-mode .exam-report-signature .label{margin-bottom:7px!important;font-size:8px!important;}

/* V11.7.5 — Arabic PDF text rendering stability */
.pdf-export-mode,
.pdf-export-mode * {
    letter-spacing: normal !important;
    font-kerning: none !important;
    font-variant-ligatures: normal !important;
    text-rendering: geometricPrecision !important;
}
.pdf-export-mode .certificate-report-paper .certificate-topbar,
.pdf-export-mode .certificate-report-paper .certificate-title,
.pdf-export-mode .certificate-report-paper .certificate-recipient-label,
.pdf-export-mode .certificate-report-paper .certificate-recipient-name,
.pdf-export-mode .certificate-report-paper .certificate-message,
.pdf-export-mode .certificate-report-paper .certificate-sign-role,
.pdf-export-mode .certificate-report-paper .certificate-sign-name,
.pdf-export-mode .certificate-report-paper .certificate-chip,
.pdf-export-mode .certificate-report-paper .certificate-emblem-text,
.pdf-export-mode .report-panel-title,
.pdf-export-mode .student-report-name,
.pdf-export-mode .student-report-summary,
.pdf-export-mode .student-progress-card,
.pdf-export-mode .exam-report-signature {
    word-spacing: .12em !important;
}
.pdf-export-mode .certificate-report-paper .certificate-title {
    line-height: 1.35 !important;
    font-size: 19px !important;
}
.pdf-export-mode .certificate-report-paper .certificate-recipient-name {
    line-height: 1.4 !important;
    font-size: 17px !important;
}
.pdf-export-mode .certificate-report-paper .certificate-message {
    line-height: 1.75 !important;
    font-size: 8.8px !important;
}
.pdf-export-mode .certificate-report-paper .certificate-topbar {
    line-height: 1.65 !important;
}
.pdf-export-mode .certificate-report-paper .certificate-sign-name {
    line-height: 1.5 !important;
}
\n\n/* V11.7.6 — isolate Arabic/English/emoji in continuous-evaluation PDF rows */\n.eval-report-row { min-width:0; gap:10px; }\n.eval-report-title {\n    min-width:0; max-width:72%; display:inline-flex; align-items:center; gap:6px;\n    white-space:normal; overflow:visible; text-overflow:clip;\n    unicode-bidi:isolate; line-height:1.6;\n}\n.eval-report-title[dir=\"ltr\"] { direction:ltr; text-align:left; }\n.eval-report-title[dir=\"rtl\"] { direction:rtl; text-align:right; }\n.eval-report-icon, .eval-report-status-icon {\n    display:inline-flex; flex:0 0 auto; width:1.35em; min-width:1.35em;\n    align-items:center; justify-content:center; line-height:1; unicode-bidi:isolate;\n    font-family: \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Noto Color Emoji\", sans-serif;\n}\n.eval-report-title-text {\n    display:inline-block; min-width:0; unicode-bidi:isolate; direction:inherit;\n    font-family:'Cairo', Arial, Tahoma, sans-serif;\n}\n.eval-report-status {\n    display:inline-flex; align-items:center; gap:4px; flex:0 0 auto;\n    unicode-bidi:isolate; direction:rtl; white-space:nowrap;\n}\n.pdf-export-mode .eval-report-row { gap:7px!important; }\n.pdf-export-mode .eval-report-title {\n    max-width:76%!important; font-size:9px!important; line-height:1.55!important;\n    letter-spacing:0!important; word-spacing:normal!important; font-kerning:none!important;\n    overflow:visible!important; text-overflow:clip!important; white-space:normal!important;\n}\n.pdf-export-mode .eval-report-title[dir=\"ltr\"] .eval-report-title-text {\n    direction:ltr!important; unicode-bidi:isolate!important; text-align:left!important;\n    font-family:Arial, Tahoma, sans-serif!important;\n}\n.pdf-export-mode .eval-report-title[dir=\"rtl\"] .eval-report-title-text {\n    direction:rtl!important; unicode-bidi:isolate!important; text-align:right!important;\n    font-family:'Cairo', Tahoma, Arial, sans-serif!important;\n}\n.pdf-export-mode .eval-report-icon,\n.pdf-export-mode .eval-report-status-icon {\n    font-family:\"Segoe UI Emoji\", \"Apple Color Emoji\", \"Noto Color Emoji\", sans-serif!important;\n    letter-spacing:0!important; word-spacing:0!important; transform:none!important;\n}\n.pdf-export-mode .eval-report-status {\n    font-size:8.5px!important; gap:3px!important; letter-spacing:0!important; word-spacing:normal!important;\n}\n