/* =====================================================================
 *  التدريب — أنماط شاشتَي «الدورات التدريبية» و«تدريبي»
 *  يتبع متغيّرات النظام نفسها (--line, --muted, --brand…) فلا لون خارجها.
 * ===================================================================== */

/* ------------------------------------------------- شبكة بطاقات الدورات */
.trn-grid{display:grid;gap:12px;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));margin-top:12px}

.trn-card{display:flex;gap:12px;align-items:flex-start;background:var(--card,#fff);
  border:1px solid var(--line,#DFE7EE);border-radius:11px;padding:14px 14px 12px;
  cursor:pointer;position:relative;overflow:hidden;
  transition:box-shadow .15s,transform .15s,border-color .15s}
.trn-card::before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:4px;
  background:var(--cc,#1E6B8C)}
.trn-card:hover{box-shadow:0 3px 14px rgba(16,42,63,.09);border-color:var(--cc,#1E6B8C)}
.trn-card.done{background:linear-gradient(180deg,rgba(46,125,80,.05),transparent 60%)}
.trn-card.fail::before{background:var(--high,#B0413E)}

.trn-ci{font-size:24px;line-height:1;flex:0 0 auto;margin-top:2px}
.trn-cb{min-width:0;flex:1}
.trn-ct{font-weight:600;font-size:13.5px;line-height:1.5;
  display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.trn-cs{color:var(--muted,#5E7488);font-size:11px;margin-top:3px}
.trn-cm{display:flex;gap:10px;flex-wrap:wrap;margin-top:7px;
  color:var(--muted,#5E7488);font-size:11px}
.trn-cm span{white-space:nowrap}
.trn-hascert{color:#2E7D50;font-weight:600}
.trn-cgo{align-self:center;color:var(--cc,#1E6B8C);font-size:11.5px;font-weight:600;
  white-space:nowrap}

/* ------------------------------------------------------ شريط التقدّم */
.trn-prog{height:6px;border-radius:99px;background:var(--line,#DFE7EE);
  overflow:hidden;margin-top:8px}
.trn-prog>span{display:block;height:100%;border-radius:99px;
  background:var(--cc,#1E6B8C);transition:width .3s}
.trn-prog.sm{height:5px;margin:0;min-width:64px}
.trn-prog.big{height:9px;flex:1;margin:0}

/* ---------------------------------------------------- رأس شاشة الدورة */
.trn-hi{font-size:19px;vertical-align:-2px}
.trn-hint{background:#FDF6E7;border:1px solid #F0DFB8;color:#8A6210;
  border-radius:9px;padding:9px 13px;font-size:11.5px;margin:10px 0}
.trn-rangebar{color:var(--muted,#5E7488);font-size:11.5px;margin:8px 2px 12px}
.trn-range{font-size:11.5px;padding:4px 8px;border-radius:7px;
  border:1px solid var(--line,#DFE7EE);background:var(--card,#fff);color:inherit}

.trn-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  background:var(--card,#fff);border:1px solid var(--line,#DFE7EE);
  border-radius:10px;padding:11px 14px;margin:10px 0 12px}
.trn-barn{font-size:11.5px;color:var(--muted,#5E7488);font-variant-numeric:tabular-nums;
  white-space:nowrap}
.trn-barx{font-size:11.5px;color:var(--muted,#5E7488);
  padding-inline-start:12px;border-inline-start:1px solid var(--line,#DFE7EE)}
.trn-ok{color:#2E7D50}

/* -------------------------------------------- مشغّل الدروس: رفّ ومسرح */
.trn-play{display:grid;grid-template-columns:260px 1fr;gap:12px;align-items:start}
@media (max-width:900px){.trn-play{grid-template-columns:1fr}}

.trn-rail{background:var(--card,#fff);border:1px solid var(--line,#DFE7EE);
  border-radius:11px;padding:6px;position:sticky;top:8px;max-height:76vh;overflow:auto}
.trn-lrow{display:flex;gap:9px;align-items:flex-start;padding:9px 10px;
  border-radius:8px;cursor:pointer;transition:background .12s}
.trn-lrow:hover{background:var(--hover,#F4F8FB)}
.trn-lrow.on{background:var(--hover,#EAF3F9);box-shadow:inset 2px 0 0 var(--brand,#1B6EA8)}
.trn-lrow.on:dir(ltr){box-shadow:inset -2px 0 0 var(--brand,#1B6EA8)}
.trn-ln{flex:0 0 20px;height:20px;border-radius:50%;display:grid;place-items:center;
  font-size:10.5px;font-weight:700;background:var(--line,#DFE7EE);color:var(--muted,#5E7488)}
.trn-lrow.done .trn-ln{background:#E7F3EC;color:#2E7D50}
.trn-lt{min-width:0;flex:1}
.trn-lt b{display:block;font-size:12px;font-weight:600;line-height:1.5}
.trn-lk{display:block;color:var(--muted,#5E7488);font-size:10.5px;margin-top:2px}

.trn-stage{min-width:0}
.trn-sum{color:var(--muted,#5E7488);font-size:12px;margin-bottom:10px}
.trn-text{font-size:13px;line-height:1.95;text-align:justify;margin-top:10px;
  white-space:normal}
.trn-lfoot{margin-top:14px;padding-top:12px;border-top:1px dashed var(--line,#DFE7EE)}

.trn-video{position:relative;width:100%;aspect-ratio:16/9;border-radius:10px;
  overflow:hidden;background:#0D1B26;margin-bottom:10px;max-width:100%}
.trn-video iframe,.trn-video video{position:absolute;inset:0;width:100%;height:100%;border:0}
/* الروابط التي تلبس ثوب الزرّ: يبقى عليها خطُّ الرابط بأنماط النظام،
   فتُقرأ نصّاً مسطَّراً داخل زرّ. نُزيله هنا لا هناك. */
a.btn,a.btn:hover,a.btn:visited{text-decoration:none}
.trn-stage .btn{margin-inline-end:6px}

.trn-blocked{background:#FDF6E7;border:1px solid #F0DFB8;color:#8A6210;
  border-radius:9px;padding:12px;font-size:11.5px;margin-bottom:10px}
.trn-url{word-break:break-all;max-width:340px}
.trn-kind{font-size:11px;color:var(--muted,#5E7488);white-space:nowrap}

/* ------------------------------------------------ أسئلة شاشة التهيئة */
.trn-qlist{display:flex;flex-direction:column;gap:10px}
.trn-q{border:1px solid var(--line,#DFE7EE);border-radius:9px;padding:11px 13px}
.trn-qh{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.trn-qh b{font-size:12.5px;font-weight:600;flex:1;min-width:160px;line-height:1.6}
.trn-qn{flex:0 0 auto;min-width:20px;height:20px;padding:0 5px;border-radius:6px;
  display:grid;place-items:center;background:var(--hover,#EAF3F9);
  color:var(--brand,#1B6EA8);font-size:10.5px;font-weight:700}
.trn-pts{font-size:10.5px;color:var(--muted,#5E7488);border:1px solid var(--line,#DFE7EE);
  border-radius:99px;padding:1px 7px}
.trn-opts{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.trn-opt{font-size:11.5px;border:1px solid var(--line,#DFE7EE);border-radius:7px;
  padding:4px 9px;color:var(--muted,#5E7488)}
.trn-opt.on{background:#E7F3EC;border-color:#B7DCC4;color:#2E7D50;font-weight:600}
.trn-expl{margin-top:8px;font-size:11.5px;color:var(--muted,#5E7488);
  border-inline-start:2px solid var(--line,#DFE7EE);padding-inline-start:9px;line-height:1.8}

/* ------------------------------------------------------ ورقة الاختبار */
.trn-exam{display:flex;flex-direction:column;gap:11px;margin-top:10px}
.trn-eq,.trn-rq{background:var(--card,#fff);border:1px solid var(--line,#DFE7EE);
  border-radius:11px;padding:14px 16px}
.trn-eqh{display:flex;gap:9px;align-items:flex-start;flex-wrap:wrap}
.trn-eqh b{font-size:13px;font-weight:600;flex:1;min-width:180px;line-height:1.75}
.trn-eopts{display:flex;flex-direction:column;gap:7px;margin-top:11px}
.trn-eopt{display:flex;gap:9px;align-items:center;border:1px solid var(--line,#DFE7EE);
  border-radius:8px;padding:9px 12px;cursor:pointer;font-size:12.5px;
  transition:background .12s,border-color .12s}
.trn-eopt:hover{background:var(--hover,#F4F8FB)}
.trn-eopt.on{border-color:var(--brand,#1B6EA8);background:var(--hover,#EAF3F9);font-weight:600}
.trn-eopt input{accent-color:var(--brand,#1B6EA8);width:15px;height:15px;flex:0 0 auto}

/* شريط التسليم لاصقٌ بأسفل الشاشة — وهناك يقف زرّا «إضافة ملاحظة»
   و«بلاغ اشتباه» العائمان (يسار الشاشة دائماً، z-index 60 و61). فلولا
   رفعُ الشريط فوقهما وتركُ فجوةٍ يساره لَحجبا زرَّ التسليم: يراه المستخدم
   ثم ينقره فيفتح له نموذج ملاحظة. والفجوة يسارٌ فيزيائيّ لا منطقيّ لأن
   الزرَّين مثبّتان بـleft لا بـinset-inline. */
.trn-efoot{position:sticky;bottom:0;z-index:62;display:flex;gap:12px;align-items:center;
  justify-content:space-between;flex-wrap:wrap;margin-top:14px;
  background:var(--card,#fff);border:1px solid var(--line,#DFE7EE);
  border-radius:11px;padding:12px 16px;padding-left:172px;
  box-shadow:0 -2px 12px rgba(16,42,63,.06)}
@media (max-width:700px){.trn-efoot{padding-left:74px}}
.trn-eleft{font-size:11.5px;color:var(--muted,#5E7488)}
.trn-timer{font-variant-numeric:tabular-nums;font-weight:700;font-size:15px;
  background:var(--hover,#EAF3F9);color:var(--brand,#1B6EA8);
  border-radius:9px;padding:7px 13px;margin-inline-start:auto}
.trn-timer.low{background:#FBE9E7;color:#B0413E}

/* ------------------------------------------------------------ النتيجة */
.trn-res{display:flex;gap:18px;align-items:center;flex-wrap:wrap;
  border-radius:13px;padding:20px 22px;margin:12px 0;
  border:1px solid var(--line,#DFE7EE);background:var(--card,#fff)}
.trn-res.pass{background:linear-gradient(180deg,#EFF8F2,#fff);border-color:#B7DCC4}
.trn-res.fail{background:linear-gradient(180deg,#FDF0EE,#fff);border-color:#EBC4BF}
.trn-resbig{font-size:44px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.trn-resbig span{font-size:19px;font-weight:600;margin-inline-start:3px}
.trn-res.pass .trn-resbig{color:#2E7D50}
.trn-res.fail .trn-resbig{color:#B0413E}
.trn-resm{flex:1;min-width:180px}
.trn-resst{font-size:14.5px;font-weight:700;margin-bottom:4px}
.trn-resa{display:flex;gap:8px;flex-wrap:wrap}
.trn-rq.ok{border-inline-start:3px solid #2E7D50}
.trn-rq.bad{border-inline-start:3px solid #B0413E}
.trn-rmark{font-weight:700;font-size:15px}
.trn-rq.ok .trn-rmark{color:#2E7D50}
.trn-rq.bad .trn-rmark{color:#B0413E}
.trn-right{color:#2E7D50;font-weight:600}

/* ------------------------------------------------------------ الشهادة */
.trn-cert{cursor:pointer;color:var(--brand,#1B6EA8);text-decoration:underline;
  text-underline-offset:2px}
.trn-certs{display:grid;gap:9px;grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.trn-certchip{display:flex;gap:10px;align-items:center;cursor:pointer;
  border:1px solid var(--line,#DFE7EE);border-radius:9px;padding:10px 12px;
  transition:border-color .12s,background .12s}
.trn-certchip:hover{border-color:#2E7D50;background:#F5FBF7}
.trn-certchip .ic{font-size:19px}
.trn-certchip div{min-width:0;flex:1}
.trn-certchip b{display:block;font-size:12px;font-weight:600;line-height:1.5}
.trn-certchip span.mono{font-size:10.5px;color:var(--muted,#5E7488)}
.trn-certchip .hh{font-size:11px;color:#2E7D50;font-weight:600;white-space:nowrap}

.trn-cert-sheet{display:flex;justify-content:center;padding:14px 0}
.trn-cert-brd{width:100%;max-width:860px;background:#fff;text-align:center;
  border:2px solid #1E6B8C;border-radius:6px;padding:38px 46px 30px;position:relative;
  box-shadow:0 4px 26px rgba(16,42,63,.10)}
.trn-cert-brd::before{content:"";position:absolute;inset:9px;border:1px solid #C3D2DE;
  border-radius:3px;pointer-events:none}
/* رأس الورقة: الشعار أولاً وبارزاً — هو ما يُعرَف به المكتب قبل اسمه.
   وobject-fit حتى لا يُمطَّ شعارٌ عريضٌ ولا يُقصَّ طويل. */
.trn-cert-top{display:flex;flex-direction:column;align-items:center}
.trn-cert-logo{max-height:84px;max-width:260px;object-fit:contain;margin-bottom:10px}
/* الاكليشة شريطٌ عريض لا مربّع — تأخذ عرض الورقة وتُقصّ ارتفاعاً */
.trn-cert-lhead{display:block;width:100%;max-height:130px;object-fit:contain;
  margin:0 auto 12px}
.trn-cert-mono{display:grid;place-items:center;width:66px;height:66px;border-radius:50%;
  border:2px solid #1E6B8C;color:#1E6B8C;font-size:22px;font-weight:800;margin-bottom:10px}
.trn-cert-firm{font-size:18px;font-weight:700;color:#102A3F}
.trn-cert-lic{font-size:11px;color:#5E7488;margin-top:3px}

/* الخطّان الصغيران: أعرضُ وأدكن فوق، وأقصرُ وأخفّ تحته. عنصران فارغان
   لا صورة — يُطبعان بأي طابعة ولا ينتظران تحميلاً. */
.trn-cert-rule{display:flex;flex-direction:column;align-items:center;gap:3px;margin:16px 0}
.trn-cert-rule i{display:block;background:#1E6B8C;border-radius:2px}
.trn-cert-rule i:first-child{width:170px;height:2px}
.trn-cert-rule i:last-child{width:84px;height:1px;opacity:.5}
.trn-cert-rule.sm{margin:20px 0 6px}
.trn-cert-rule.sm i:first-child{width:110px}
.trn-cert-rule.sm i:last-child{width:54px}

/* التوقيع والختم — لا يظهران إلا حين يُضبطان بـ«بيانات الشركة» */
.trn-cert-sign{display:flex;gap:24px;align-items:flex-end;justify-content:space-between;
  flex-wrap:wrap;margin-top:18px;text-align:start}
.trn-cert-sg{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:190px}
.trn-cert-sg img.sg{max-height:48px;margin-bottom:2px}
.trn-cert-sg .ln{display:block;width:190px;border-top:1px solid #102A3F;margin-bottom:5px}
.trn-cert-sg b{font-size:12.5px;color:#102A3F}
.trn-cert-sg .ti{font-size:10.5px;color:#5E7488}
.trn-cert-st img{max-height:78px;opacity:.92}

.trn-cert-h{font-size:24px;font-weight:800;color:#1E6B8C;letter-spacing:1px;
  margin:4px 0}
.trn-cert-of{font-size:12.5px;color:#5E7488;margin-top:14px}
.trn-cert-name{font-size:28px;font-weight:800;color:#102A3F;margin:8px 0 2px;
  padding-bottom:8px;border-bottom:1px dashed #C3D2DE;display:inline-block;
  padding-inline:26px}
.trn-cert-job{font-size:11.5px;color:#5E7488;margin-top:6px}
.trn-cert-course{font-size:19px;font-weight:700;color:#1E6B8C;margin:8px 0 4px;line-height:1.6}
.trn-cert-meta{font-size:13px;color:#102A3F;margin-top:10px}
.trn-cert-note{font-size:11.5px;color:#5E7488;margin-top:12px;line-height:1.8}
.trn-cert-exp{display:inline-block;margin-top:12px;background:#FBE9E7;color:#B0413E;
  border-radius:99px;padding:4px 14px;font-size:12px;font-weight:700}
.trn-cert-foot{display:flex;gap:22px;align-items:flex-end;justify-content:space-between;
  margin-top:20px;padding-top:14px;border-top:1px solid #DFE7EE;text-align:start;flex-wrap:wrap}
.trn-cert-kv{display:flex;gap:22px;flex-wrap:wrap}
.trn-cert-kv>div{display:flex;flex-direction:column;gap:2px}
.trn-cert-kv span{font-size:10px;color:#5E7488}
.trn-cert-kv b{font-size:12px;color:#102A3F}
.trn-cert-qr{display:flex;flex-direction:column;align-items:center;gap:4px}
.trn-cert-qr img{width:78px;height:78px}
.trn-cert-qr span{font-size:9.5px;color:#5E7488;max-width:110px;text-align:center;line-height:1.4}

@media (max-width:640px){
  .trn-cert-brd{padding:24px 18px 20px}
  .trn-cert-name{font-size:21px;padding-inline:10px}
  .trn-cert-course{font-size:15px}
  .trn-cert-h{font-size:19px}
  .trn-cert-logo{max-height:62px}
  .trn-cert-rule i:first-child{width:120px}
  .trn-cert-sign{justify-content:center}
  .trn-cert-sg,.trn-cert-sg .ln{min-width:0;width:170px}
}

/* الشهادة وحدها تُطبع حين تُفتح — لا شريطٌ جانبي ولا تبويبات */
@media print{
  .trn-cert-sheet{padding:0}
  .trn-cert-brd{border-width:2px;box-shadow:none;max-width:none;
    break-inside:avoid;page-break-inside:avoid}
  .trn-play{grid-template-columns:1fr}
  .trn-rail,.trn-efoot,.trn-cgo{display:none}
  .trn-video{display:none}
  .trn-card{break-inside:avoid;page-break-inside:avoid}
}

/* الوضع الداكن يتبع متغيّرات النظام — والورقة تبقى بيضاء فهي ورقة */
@media (prefers-color-scheme:dark){
  .trn-cert-brd{background:#fff;color:#102A3F}
}
