/* ============================================================================
   EVA — التعليم الابتدائي (v27)
   ============================================================================ */
body.eva-primary-on .cards-container { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
body.eva-primary-on.eva-primary-obs .cards-container { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
body.eva-primary-on #defaultGradeContainer, body.eva-primary-on #copyGradesContainer, body.eva-primary-on #bulkActionsContainer,
body.eva-primary-on #bulkApplyOverflowContainer { display: none !important; }

/* رأس الورقة */
.pr-head { grid-column: 1 / -1; display: grid; gap: 10px; padding: 14px 16px; border-radius: 20px; background: linear-gradient(135deg, #fffaf0, #fff 55%); border: 1px solid #f0dfb2; box-shadow: 0 8px 22px -20px rgba(43, 20, 87, .6); font-family: 'Tajawal', sans-serif; }
.pr-h1 { display: flex; align-items: center; gap: 12px; }
.pr-h1 > i { font-size: 28px; width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, #2b1457, #5a34a0); color: #f3d27a; }
.pr-h1 b { display: block; font-size: 17px; color: var(--eva-purple-900, #2b1457); }
.pr-h1 small { display: block; font-size: 12.5px; color: var(--eva-muted, #6a6486); }
.pr-h1 > div { flex: 1; min-width: 0; }
.pr-prog { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: #f4f0fb; color: #4b2a8f; font-size: 13px; font-weight: 800; white-space: nowrap; }
.pr-prog.is-full { background: #e7f8ef; color: #1b8a4d; }
.pr-legs { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-leg { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid #ebe5f6; font-size: 12.5px; font-weight: 700; color: #3a1f6e; }
.pr-leg small { color: #8f87a8; font-weight: 700; }
.pr-leg.is-exam { background: #fff3d6; border-color: #f0d68e; color: #7a5a12; }
.pr-leg.is-obs { border-radius: 12px; line-height: 1.7; background: #f4f0fb; }
.pr-leg.is-obs b { color: #2b1457; }
.pr-tip { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #6a6486; line-height: 1.6; }
.pr-tip i { font-size: 18px; color: #a8822f; flex: 0 0 auto; }
.pr-tip kbd { font: 700 11px/1 ui-monospace, monospace; padding: 2px 6px; border-radius: 5px; border: 1px solid #d9d2ea; background: #fff; }
.pr-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #3a1f6e; }

/* البطاقة */
.card.pr-card { text-align: right; padding: 26px 14px 14px !important; gap: 10px; }
.card.pr-card .student-name { margin: 0 !important; font-size: 15.5px; text-align: center; }
.card.pr-card.pr-done::before { background: linear-gradient(90deg, #1b8a4d, #63c98f); }
.card.pr-card.pr-part::before { background: linear-gradient(90deg, #c9a24b, #f0cf7c); }
.pr-grid { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.pr-f { display: grid; gap: 3px; min-width: 0; text-align: center; }
.pr-f > span { font-size: 10.5px; font-weight: 800; color: #6a6486; line-height: 1.25; min-height: 26px; display: flex; align-items: flex-end; justify-content: center; }
.pr-f.is-exam > span { color: #8a6418; }
.pr-in { width: 100%; box-sizing: border-box; height: 42px; border: 1.5px solid var(--eva-line, #ebe5f6); border-radius: 12px; background: var(--eva-purple-50, #f4f0fb); text-align: center; font: 800 16px 'Tajawal', sans-serif; color: var(--eva-ink, #1c1433); direction: ltr; font-feature-settings: "tnum"; padding: 0 2px; }
.pr-f.is-exam .pr-in { background: #fffaf0; border-color: #f0dfb2; }
.pr-in:focus { outline: 0; border-color: var(--eva-gold, #c9a24b); background: #fff; box-shadow: 0 0 0 4px rgba(201, 162, 75, .18); }
.pr-in.bad { border-color: #e74c3c !important; background: #fff1f0 !important; color: #b3261e; }
.pr-in:disabled { opacity: .4; }
.pr-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--eva-line, #ebe5f6); }
.pr-avg { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #6a6486; }
.pr-avg b { font-size: 17px; color: var(--eva-purple-900, #2b1457); margin-inline: 3px; font-feature-settings: "tnum"; }
.pr-obs { flex: 1; min-width: 0; border: 1px dashed #d9d2ea; background: #fcfbff; border-radius: 10px; padding: 7px 10px; font: 700 12.5px 'Tajawal', sans-serif; color: #3a1f6e; cursor: pointer; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-obs.is-manual { border-style: solid; border-color: #c9b8ec; background: #f4f0fb; }
.pr-obs:hover { border-color: var(--eva-gold, #c9a24b); }
.pr-obs-edit { flex: 1; display: flex; gap: 4px; min-width: 0; }
.pr-obs-edit .field-input { flex: 1; min-width: 0; padding: 6px 8px !important; font-size: 13px !important; height: auto !important; }
.pr-obs-edit button { border: 0; border-radius: 9px; padding: 0 9px; font: 700 12px 'Tajawal', sans-serif; cursor: pointer; background: #f4f0fb; color: #3a1f6e; }
.pr-obs-edit .pr-ok { background: #2b1457; color: #fff; }

/* الملاحظات فقط: مستويات التحكم */
.pr-mastery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pr-m { display: grid; justify-items: center; gap: 1px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid #ebe5f6; background: #fff; cursor: pointer; font-family: 'Tajawal', sans-serif; transition: transform .12s, background .12s, border-color .12s; }
.pr-m b { font-size: 18px; line-height: 1.1; color: #2b1457; }
.pr-m small { font-size: 11px; font-weight: 700; color: #6a6486; }
.pr-m:hover { transform: translateY(-1px); }
.pr-m.is-a.on { background: #e7f8ef; border-color: #63c98f; } .pr-m.is-a.on b { color: #1b8a4d; }
.pr-m.is-b.on { background: #eef5ff; border-color: #8fb6ea; } .pr-m.is-b.on b { color: #1e5aa8; }
.pr-m.is-c.on { background: #fff6e0; border-color: #f0cf7c; } .pr-m.is-c.on b { color: #9a6b00; }
.pr-m.is-d.on { background: #fff1f0; border-color: #f0a8a0; } .pr-m.is-d.on b { color: #b3261e; }
.pr-bulk .pr-m { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #3a1f6e; }
.pr-bulk .pr-m b { font-size: 14px; }
.pr-obs-in { padding: 8px 10px !important; font-size: 13px !important; height: auto !important; }
.card.pr-card.is-exempt .pr-grid, .card.pr-card.is-exempt .pr-mastery, .card.pr-card.is-exempt .pr-foot { opacity: .35; pointer-events: none; filter: grayscale(1); }
body.ordered-mode .card.pr-card.ordered-highlight { outline: 3px solid var(--eva-gold, #c9a24b); outline-offset: 2px; }
@media (max-width: 420px) { .pr-f > span { font-size: 10px; } .pr-in { height: 40px; font-size: 15px; } .pr-h1 > i { width: 40px; height: 40px; font-size: 22px; } }
.roster-role { display: grid; gap: 6px; margin-top: 12px; padding: 12px; border-radius: 14px; background: #fffaf0; border: 1px solid #f0dfb2; }
.roster-role > span { font-weight: 800; color: #2b1457; font-size: 14px; }
.roster-role small { color: #6a6486; font-size: 12px; line-height: 1.6; }
body.eva-primary-on #cardLegend [data-k="purple"], body.eva-primary-on #toggleToolsBtn, body.eva-primary-on #reportsBar { display: none !important; }
.pr-leg.is-obs { display: block; }
@media (max-width: 600px) { .pr-tip { display: none; } .pr-h1 small { line-height: 1.5; } }
.pr-colnote:empty{display:none}.pr-colnote{margin-top:8px;padding:8px 12px;border-radius:10px;background:#f4effc;color:#4a2582;font-weight:700;font-size:13px}
