/* منجاز — واجهات نظام النقاط والأوسمة (نقاطي، نجومي، فصولي، الشهادة) */
.gm { display: grid; gap: 14px; }
.gm-load { text-align: center; color: var(--mut); padding: 34px 16px; }
.gm-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; }
.gm-card > h3, .gm-h { font-size: 16.5px; font-weight: 900; color: var(--b1); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gm-h small, .gm-card > h3 small { font-size: 12.5px; font-weight: 700; color: var(--mut); }
.gm-sub { color: var(--mut); font-size: 13.5px; line-height: 1.9; margin: 0 0 10px; }
.gm-mut { color: var(--mut); }
.gm-ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; }
.gm-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gm-row > .x-in { flex: 1; min-width: 150px; }
.gm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gm-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 920px) { .gm-grid3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .gm-grid2 { grid-template-columns: 1fr; } }

/* البطاقة الرئيسية للرصيد */
.gm-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: center; color: #fff; border-radius: 22px; padding: 22px 20px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 12% 120%, rgba(91, 190, 151, .55), transparent 55%), linear-gradient(135deg, #12475B, #1E7290 58%, #2A9C86); box-shadow: 0 14px 34px rgba(21, 80, 102, .22); }
.gm-hero::after { content: ''; position: absolute; inset-inline-start: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .06); pointer-events: none; }
.gm-hero .lbl { font-size: 13.5px; font-weight: 800; opacity: .9; }
.gm-hero .big { font-size: clamp(40px, 9vw, 62px); font-weight: 900; line-height: 1.05; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.gm-hero .big small { font-size: .38em; font-weight: 800; color: #fff; -webkit-text-fill-color: #fff; opacity: .92; margin-inline-start: 6px; }
.gm-hero .eq { font-weight: 800; font-size: 15px; opacity: .95; }
.gm-hero .notes { display: grid; gap: 8px; position: relative; z-index: 1; }
.gm-hero .note { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; font-weight: 700; line-height: 1.7; }
.gm-hero .note b { font-weight: 900; }
.gm-hero .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.gm-hero .btn.pri { background: #fff; color: var(--b1); box-shadow: none; }
.gm-hero .btn.ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); }
@media (max-width: 700px) { .gm-hero { grid-template-columns: 1fr; padding: 20px 16px; } }

/* مسار الدورة (الأيام والأسابيع) */
.gm-track { display: grid; gap: 6px; }
.gm-track.d7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gm-track.d4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gm-step { border-radius: 12px; padding: 7px 2px 6px; text-align: center; background: #F4F8F7; border: 1.5px solid #E3ECEB; font-weight: 900; font-size: 14px; color: #6B7C7F; min-width: 0; }
.gm-step small { display: block; font-size: 10.5px; font-weight: 700; opacity: .85; margin-top: 1px; }
.gm-step.done { background: #E3F4EE; border-color: #A9DAC6; color: #1F6B57; }
.gm-step.today { background: var(--g1); border-color: var(--g1); color: #fff; box-shadow: 0 5px 14px rgba(42, 156, 134, .32); }
.gm-step.next { border-style: dashed; border-color: var(--g1); color: var(--g1); background: #fff; }
.gm-step.gold { background: linear-gradient(135deg, #FBE7B4, #F6CF6E); border-color: #E9B949; color: #6E4A06; }
.gm-step.gold.next { background: #FFF8E6; }
.gm-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 4px 0 10px; }
.gm-day { text-align: center; font-size: 12px; font-weight: 800; color: var(--mut); }
.gm-day i { display: grid; place-items: center; width: 100%; aspect-ratio: 1; max-width: 40px; margin: 0 auto 3px; border-radius: 50%; background: #F1F5F4; border: 1.5px solid #E1EAE8; font-style: normal; color: #5f7673; }
.gm-day.on i { background: var(--g1); border-color: var(--g1); color: #fff; }
.gm-day.today i { border-color: var(--b2); border-width: 2px; }
.gm-day.future i { opacity: .55; }
.gm-big2 { font-size: 26px; font-weight: 900; color: var(--b1); line-height: 1.2; }
.gm-big2 small { font-size: 13px; color: var(--mut); font-weight: 700; margin-inline-start: 4px; }
.gm-kv { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 6px 0 10px; }
.gm-pill { display: inline-flex; align-items: center; gap: 5px; background: #EAF6F3; color: #1F6B57; border-radius: 999px; padding: 3px 11px; font-size: 12.5px; font-weight: 800; }
.gm-pill.warn { background: #FFF4DE; color: #8A5A00; }
.gm-pill.gold { background: #FFF2CF; color: #7A5205; }
.gm-pill.gray { background: #EEF2F1; color: #5E6B6E; }

/* شريط التقدم */
.gm-bar { height: 10px; background: #E8F0EE; border-radius: 999px; overflow: hidden; }
.gm-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--g2), var(--g1)); border-radius: inherit; min-width: 4px; transition: width .5s; }
.gm-bar.gold i { background: linear-gradient(90deg, #F6CF6E, #E59C2F); }
.gm-bar-lbl { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 800; color: var(--mut); margin-top: 5px; gap: 8px; }

/* الأوسمة */
.gm-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gm-badge { border: 1px solid var(--line); border-radius: 18px; padding: 16px 10px 12px; text-align: center; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.gm-badge .bi { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #EEF3F2; color: #5f7673; margin-bottom: 4px; border: 2px dashed #D3DEDB; }
.gm-badge .bi svg { width: 28px; height: 28px; }
.gm-badge b { font-size: 14.5px; color: var(--ink); }
.gm-badge p { font-size: 12.5px; color: var(--mut); line-height: 1.6; margin: 0; }
.gm-badge .gm-bar { width: 100%; height: 7px; margin-top: 6px; }
.gm-badge small { font-size: 11.5px; font-weight: 800; color: var(--mut); }
.gm-badge.on { border-color: #F0D58C; background: linear-gradient(180deg, #FFFBEF, #fff 60%); }
.gm-badge.on .bi { background: linear-gradient(135deg, #F8D677, #E59C2F); color: #fff; border: 0; box-shadow: 0 7px 18px rgba(229, 156, 47, .35); }
.gm-badge.on small { color: #8A5A00; }
.gm-badge .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; padding: 8px 12px; min-height: 38px; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.gm-badge .btn .gm-ic { width: 16px; height: 16px; }

/* السجل */
.gm-hist { display: grid; gap: 0; }
.gm-hist .r { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #EEF3F2; }
.gm-hist .r:last-child { border-bottom: 0; }
.gm-hist .r .t { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.6; word-break: break-word; }
.gm-hist .r .t small { display: block; color: var(--mut); font-weight: 600; font-size: 12px; }
.gm-hist .r .p { font-weight: 900; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gm-pos { color: #1c7a4a; } .gm-neg { color: #b03a2e; } .gm-zero { color: var(--mut); }

/* القواعد */
.gm-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.gm-rule { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #FBFDFC; }
.gm-rule b { display: flex; gap: 6px; align-items: center; color: var(--b1); font-size: 14.5px; margin-bottom: 4px; }
.gm-rule p { margin: 0; font-size: 13px; line-height: 1.8; color: #33474C; }
.gm-rule em { font-style: normal; font-weight: 900; color: var(--g1); }

/* حالات الصفحة */
.gm-state { text-align: center; padding: 30px 18px; }
.gm-state .bi { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: #EAF6F3; color: var(--g1); }
.gm-state .bi svg { width: 32px; height: 32px; }
.gm-state h2 { font-size: 20px; color: var(--b1); margin-bottom: 6px; }
.gm-state p { color: var(--mut); line-height: 1.9; max-width: 520px; margin: 0 auto 14px; }

/* لوحة الشرف */
.gm-board { display: grid; gap: 6px; }
.gm-board .r { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #F8FBFA; border: 1px solid #EAF1EF; border-radius: 12px; padding: 8px 10px; }
.gm-board .r.me { background: #E8F6F1; border-color: #A9DAC6; }
.gm-board .rk { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; background: #E5EEEC; color: #4C5E61; }
.gm-board .rk.g1 { background: linear-gradient(135deg, #F8D677, #E59C2F); color: #fff; }
.gm-board .rk.g2 { background: linear-gradient(135deg, #E6EBEE, #AEB8C0); color: #fff; }
.gm-board .rk.g3 { background: linear-gradient(135deg, #F1C9A4, #C98A55); color: #fff; }
.gm-board .nm { font-weight: 800; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-board .sc { font-weight: 900; color: var(--b1); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gm-seg { display: inline-flex; background: #EAF3F1; border-radius: 12px; padding: 4px; gap: 4px; }
.gm-seg button { border: 0; background: transparent; font: inherit; font-weight: 800; font-size: 13px; padding: 7px 12px; border-radius: 9px; color: var(--b1); cursor: pointer; }
.gm-seg button[aria-pressed=true] { background: #fff; color: var(--g1); box-shadow: 0 2px 8px rgba(21, 80, 102, .12); }

/* الفصول (الطالب والمعلم) */
.gm-class { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; }
.gm-class .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.gm-class .top b { font-size: 16px; color: var(--ink); }
.gm-class .top small { display: block; color: var(--mut); font-weight: 700; font-size: 12.5px; margin-top: 2px; }
.gm-ranks { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.gm-ranks .x { flex: 1; min-width: 120px; background: #F4F8F7; border-radius: 12px; padding: 8px 10px; text-align: center; font-size: 12.5px; color: var(--mut); font-weight: 700; }
.gm-ranks .x b { display: block; font-size: 20px; color: var(--b1); font-weight: 900; }

/* المهام */
.gm-tasks { display: grid; gap: 8px; }
.gm-task { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; display: grid; gap: 6px; }
.gm-task.done { background: #F6FBF8; border-color: #CBE8DA; }
.gm-task.rev { opacity: .6; }
.gm-task .hd { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.gm-task .hd b { font-size: 15px; color: var(--ink); line-height: 1.6; flex: 1; min-width: 160px; }
.gm-task p { margin: 0; font-size: 13.5px; color: #33474C; line-height: 1.8; white-space: pre-line; }
.gm-task .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.gm-task .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.gm-task textarea { min-height: 56px; }

/* قائمة الطلاب للمنح */
.gm-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.gm-st { position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 10px 9px; background: #fff; cursor: pointer; text-align: start; font: inherit; color: inherit; display: grid; gap: 3px; min-width: 0; transition: border-color .15s, background .15s; }
.gm-st:hover { border-color: #B9D6CF; }
.gm-st.on { border-color: var(--g1); background: #EAF6F2; box-shadow: 0 0 0 2px rgba(42, 156, 134, .18); }
.gm-st .nm { font-weight: 900; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline-end: 22px; }
.gm-st .ln { display: flex; gap: 8px; font-size: 12px; color: var(--mut); font-weight: 700; flex-wrap: wrap; }
.gm-st .ln b { color: var(--b1); }
.gm-st .ck { position: absolute; inset-inline-end: 8px; top: 9px; width: 18px; height: 18px; border-radius: 6px; border: 2px solid #C5D6D2; display: grid; place-items: center; color: #fff; }
.gm-st.on .ck { background: var(--g1); border-color: var(--g1); }
.gm-st:focus-visible { outline: 3px solid rgba(30, 114, 144, .45); outline-offset: 2px; }
.gm-st .cap { font-size: 11px; color: #8A5A00; font-weight: 800; }
.gm-award-set { background: #F7FBFA; border: 1px solid #DCEAE6; border-radius: 16px; padding: 12px; display: grid; gap: 8px; }
.gm-award-set .lab { font-size: 12.5px; font-weight: 900; color: var(--b1); }
.gm-award-set .x-chips { gap: 5px; }
.gm-award-set .x-chip { padding: 6px 11px; min-width: 38px; text-align: center; }
.gm-roster.has-bar { padding-bottom: 8px; }
.gm-award { position: sticky; bottom: calc(10px + var(--mbh, 0px)); z-index: 5; background: #10303A; color: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 10px 28px rgba(16, 40, 47, .25); display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.gm-award .sel { font-size: 13.5px; font-weight: 800; }
.gm-award .btn.pri { background: linear-gradient(135deg, #F8D677, #E59C2F); color: #4A3002; box-shadow: none; }

/* الكود */
.gm-code { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: linear-gradient(135deg, #EAF6F3, #E3F0F7); border: 1px solid #CFE6DF; border-radius: 16px; padding: 12px 14px; }
.gm-code .cd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 30px; font-weight: 900; letter-spacing: 6px; color: var(--b1); direction: ltr; }
.gm-code .tx { flex: 1; min-width: 190px; font-size: 13px; line-height: 1.8; color: #33474C; font-weight: 600; }

/* وضع العرض على شاشة الفصل */
.gm-screen { position: fixed; inset: 0; z-index: 1000; background: radial-gradient(circle at 80% -10%, rgba(91, 190, 151, .35), transparent 50%), linear-gradient(160deg, #0F3A4A, #155066 55%, #1B6B66); color: #fff; overflow: auto; padding: 26px clamp(14px, 4vw, 48px); }
.gm-screen .hd { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.gm-screen h2 { font-size: clamp(24px, 4vw, 44px); font-weight: 900; }
.gm-screen h2 small { display: block; font-size: .45em; opacity: .85; font-weight: 700; margin-top: 4px; }
.gm-screen .rows { display: grid; gap: 10px; max-width: 1100px; margin: 0 auto; }
.gm-screen .rw { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; padding: 12px 18px; font-size: clamp(18px, 2.6vw, 30px); font-weight: 800; }
.gm-screen .rw .rk { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); font-weight: 900; }
.gm-screen .rw.g1 .rk { background: linear-gradient(135deg, #F8D677, #E59C2F); color: #5A3C02; }
.gm-screen .rw.g2 .rk { background: linear-gradient(135deg, #F1F4F6, #AEB8C0); color: #36414A; }
.gm-screen .rw.g3 .rk { background: linear-gradient(135deg, #F1C9A4, #C98A55); color: #4A2A10; }
.gm-screen .rw .sc { font-variant-numeric: tabular-nums; color: #FBE7B4; white-space: nowrap; }
.gm-screen .rw .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-screen .btn { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.gm-screen .gm-seg { background: rgba(255, 255, 255, .12); }
.gm-screen .gm-seg button { color: #fff; }
.gm-screen .gm-seg button[aria-pressed=true] { background: #fff; color: var(--b1); }

/* نافذة صغيرة داخل الصفحة */
.gm-modal { position: fixed; inset: 0; z-index: 900; background: rgba(16, 40, 47, .5); display: grid; place-items: center; padding: 16px; }
.gm-modal .box { background: #fff; border-radius: 20px; width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.gm-modal .box h3 { font-size: 17px; color: var(--b1); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.gm-modal .box h3 button { border: 0; background: #F1F5F4; border-radius: 10px; width: 34px; height: 34px; font-size: 16px; cursor: pointer; }
.gm-x { border: 0; background: none; color: #b03a2e; font: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; padding: 4px 6px; }
.gm-link { border: 0; background: none; color: var(--b2); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; }

/* تنبيه المكافأة (داخل الصفحات) */
.gm-pop { position: fixed; inset-inline: 0; bottom: calc(26px + var(--mbh, 0px)); margin: auto; width: max-content; max-width: min(92vw, 460px); z-index: 1200; background: #10303A; color: #fff; border-radius: 16px; padding: 11px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); font-weight: 800; font-size: 14px; opacity: 0; transform: translateY(14px); transition: .28s; pointer-events: none; }
.gm-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.gm-pop .st { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #F8D677, #E59C2F); color: #fff; flex: none; }
.gm-pop .st svg { width: 19px; height: 19px; }
.gm-pop button { border: 0; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-weight: 800; border-radius: 10px; padding: 6px 10px; cursor: pointer; margin-inline-start: 4px; }

@media print { .gm-award, .gm-pop, .gm-screen .hd .btn { display: none !important; } }

/* الشهادة */
.gm-cert { margin: 14px auto 0; max-width: 1000px; }
.gm-verify { display: flex; align-items: center; gap: 8px; font-size: clamp(8px, 1.1vw, 11.5px); color: #5E6B6E; font-weight: 700; text-align: start; }
.gm-verify .qr svg { width: clamp(38px, 6vw, 66px); height: auto; display: block; }
.gm-hero .big{display:flex;align-items:center;gap:12px}.gm-hero .big .gm-bigcoin{display:inline-flex;animation:gmCoinIn .7s cubic-bezier(.2,.9,.3,1.2) both}.gm-hero .big .gm-bigcoin svg{width:clamp(44px,11vw,64px);height:auto;filter:drop-shadow(0 4px 8px rgba(120,70,0,.4))}
@keyframes gmCoinIn{from{transform:rotateY(90deg) scale(.6);opacity:0}to{transform:none;opacity:1}}@media (prefers-reduced-motion:reduce){.gm-hero .big .gm-bigcoin{animation:none}}
