/* ============ GFTest brand layer over Minia ============ */
:root {
    /* ألوان هوية GFTest الجديدة: أحمر الشعار + رمادي فحمي (2026-12-02). الاسم brand = أحمر الأزرار والتعبئة */
    --gf-brand: #D8232A;
    --gf-brand-dark: #B81B21;
    --gf-brand-soft: rgba(216, 35, 42, .09);
    /* أحمر النصوص والروابط والأيقونات والحدود. أغمق شوي من أحمر التعبئة لوضوح أعلى على الأبيض، وأفتح في الداكن (آخر الملف) */
    --gf-ink: #C81E25;
    --gf-red: #D7312C;
    --gf-red-soft: rgba(215, 49, 44, .09);
    --gf-charcoal: #3A3C40;
    --gf-charcoal-dark: #26282B;
    /* لون سلسلة الرسوم البيانية الأولى (الرمادي الفحمي) */
    --gf-chart: #3A3C40;
    --gf-green: #1E9E5A;
    --bs-link-color: #C81E25;
    --bs-link-hover-color: #B81B21;
    --bs-sidebar-menu-item-hover-color: #C81E25;
    --bs-sidebar-menu-item-active-color: #C81E25;
    --bs-sidebar-menu-sub-item-hover-color: #C81E25;
    --bs-sidebar-menu-sub-item-active-color: #C81E25;
    --bs-topnav-item-color-active: #C81E25;
}

body, h1, h2, h3, h4, h5, h6, .btn, .form-control, .form-select, .table, .badge, .dropdown-menu {
    font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif !important;
}
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.font-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace !important; }

/* primary → أحمر الشعار */
.btn-primary { background-color: var(--gf-brand); border-color: var(--gf-brand); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background-color: var(--gf-brand-dark) !important; border-color: var(--gf-brand-dark) !important; }
.btn-outline-primary { color: var(--gf-ink); border-color: var(--gf-ink); }
.btn-outline-primary:hover { background-color: var(--gf-brand); border-color: var(--gf-brand); color: #fff; }
.btn-soft-primary { background-color: var(--gf-brand-soft); color: var(--gf-ink); border-color: transparent; }
.btn-soft-primary:hover { background-color: var(--gf-brand); color: #fff; }
.bg-primary { background-color: var(--gf-brand) !important; }
.text-primary { color: var(--gf-ink) !important; }
.badge-soft-primary, .bg-soft-primary { background-color: var(--gf-brand-soft) !important; color: var(--gf-ink) !important; }
.border-primary { border-color: var(--gf-ink) !important; }
.form-control:focus, .form-select:focus { border-color: var(--gf-ink); box-shadow: 0 0 0 .15rem var(--gf-brand-soft); }
.form-check-input:checked { background-color: var(--gf-brand); border-color: var(--gf-brand); }
.nav-pills .nav-link.active { background-color: var(--gf-brand); }
.nav-tabs-custom .nav-item .nav-link.active { color: var(--gf-ink); }
.nav-tabs-custom .nav-item .nav-link::after { background: var(--gf-ink); }
.page-item.active .page-link { background-color: var(--gf-brand); border-color: var(--gf-brand); }
a { color: var(--gf-ink); }

/* brand accents */
.text-gf-red { color: var(--gf-red) !important; }
.bg-gf-red { background-color: var(--gf-red) !important; color: #fff; }
.gf-accent-bar { width: 42px; height: 3px; background: var(--gf-red); border-radius: 2px; }

/* sidebar */
.navbar-brand-box { padding: 0 1.25rem; }
.navbar-brand-box .logo-lg img { height: 30px; }
.navbar-brand-box .brand-txt { font-weight: 700; font-size: 18px; color: var(--gf-charcoal); letter-spacing: .5px; vertical-align: middle; }
body[data-layout-mode=dark] .navbar-brand-box .brand-txt { color: #e9e9ef; }
#sidebar-menu ul li a { font-size: 14px; }
#sidebar-menu ul li.mm-active > a { background: var(--gf-brand-soft); border-radius: 6px; margin: 0 10px; }
#sidebar-menu ul li.mm-active > a i { color: var(--gf-ink) !important; }
#sidebar-menu ul li a.active, #sidebar-menu ul li.mm-active > a, #sidebar-menu ul li.mm-active > a span { color: var(--gf-ink) !important; }
#sidebar-menu .menu-title { font-size: 11px; }

/* page header */
.page-title-box h4 { font-size: 18px !important; }

/* KPI cards */
.kpi-card .kpi-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 700; line-height: 1.1; }

/* workflow stepper */
.gf-steps { display: flex; gap: 0; counter-reset: s; }
.gf-steps .st { flex: 1; text-align: center; position: relative; font-size: 12.5px; color: #74788d; }
.gf-steps .st::before { counter-increment: s; content: counter(s); display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; width: 30px; height: 30px; border-radius: 50%; background: #eff0f2; font-weight: 700; position: relative; z-index: 1; }
.gf-steps .st::after { content: ""; position: absolute; top: 15px; inset-inline-end: 50%; width: 100%; height: 2px; background: #eff0f2; }
.gf-steps .st:first-child::after { display: none; }
.gf-steps .st.done { color: var(--gf-green); }
.gf-steps .st.done::before { content: "✓"; background: var(--gf-green); color: #fff; }
.gf-steps .st.done::after, .gf-steps .st.current::after { background: var(--gf-green); }
.gf-steps .st.current { color: var(--gf-ink); font-weight: 600; }
.gf-steps .st.current::before { background: var(--gf-brand); color: #fff; box-shadow: 0 0 0 4px var(--gf-brand-soft); }

/* OTP inputs */
.otp-inputs { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.otp-inputs input { width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 700; border: 1px solid #ced4da; border-radius: 8px; }
.otp-inputs input:focus { outline: none; border-color: var(--gf-ink); box-shadow: 0 0 0 .15rem var(--gf-brand-soft); }

/* verified badge */
.gf-verified { display: inline-flex; align-items: center; gap: 6px; color: var(--gf-green); font-weight: 800; letter-spacing: .5px; }
.gf-verified .mdi { font-size: 1.2em; }

/* sticker */
.gf-sticker { background: #fff; border: 1px solid #9a9ca3; border-radius: 3px; color: #1d1d1f; direction: ltr; font-family: "IBM Plex Sans", Calibri, sans-serif; overflow: hidden; display: inline-flex; flex-direction: column; box-sizing: border-box; }
.gf-sticker .sk-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #c9ccd4; }
.gf-sticker .sk-head img { display: block; object-fit: contain; }
.gf-sticker .sk-isos { display: flex; align-items: center; gap: .6mm; flex: none; }
/* الصور فيها فراغ أبيض على الجنبين، فتنقص مربع والشعار في النص */
.gf-sticker .sk-head .sk-iso { aspect-ratio: 1 / 1; width: auto; object-fit: cover; }
.gf-sticker .sk-title { font-weight: 800; color: var(--gf-brand); text-align: center; flex: 1; white-space: nowrap; }
.gf-sticker .sk-body { display: flex; align-items: center; flex: 1; min-height: 0; }
.gf-sticker .sk-qr { flex: none; }
.gf-sticker .sk-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gf-sticker .sk-row { display: flex; align-items: baseline; border-bottom: 1px solid #e6e7ec; }
.gf-sticker .sk-row:last-child { border-bottom: 0; }
.gf-sticker .sk-label { background: #e9eaee; font-weight: 700; color: #333; flex: none; }
.gf-sticker .sk-val { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
/* القيمة الطويلة بعد ما يصغر خطها لأقل حد (السكربت في partials/sticker): سطرين بدل ما تنقص */
.gf-sticker .sk-val.sk-wrap { white-space: normal; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.1; }
.gf-sticker .sk-number .sk-val { color: #000; font-weight: 800; letter-spacing: .02em; }
.gf-sticker.lg .sk-number .sk-val { font-size: 8.5pt; }
.gf-sticker.sm .sk-number .sk-val { font-size: 5.4pt; }
.gf-sticker .sk-green { color: #1E9E5A; }
.gf-sticker .sk-red { color: var(--gf-red); }
.gf-sticker .sk-foot { background: #e9eaee; color: #222; text-align: center; font-weight: 700; }

/* 3 × 2 inch = 76.2 × 50.8 mm */
.gf-sticker.lg { width: 76.2mm; height: 50.8mm; }
.gf-sticker.lg .sk-head { padding: 1mm 2mm; height: 9mm; }
.gf-sticker.lg .sk-iso { height: 7mm; }
.gf-sticker.lg .sk-logo { height: 7mm; }
.gf-sticker.lg .sk-title { font-size: 8pt; }
.gf-sticker.lg .sk-body { padding: 1.2mm 2mm; gap: 2mm; }
.gf-sticker.lg .sk-qr { width: 26mm; height: 26mm; }
.gf-sticker.lg .sk-row { font-size: 6pt; line-height: 1.25; }
.gf-sticker.lg .sk-label { width: 17.5mm; padding: .5mm 1mm; margin-right: 1.2mm; }
.gf-sticker.lg .sk-foot { font-size: 5.5pt; padding: .7mm; }

/* 2 × 1 inch = 50.8 × 25.4 mm */
.gf-sticker.sm { width: 50.8mm; height: 25.4mm; }
.gf-sticker.sm .sk-head { padding: .5mm 1.2mm; height: 5mm; }
.gf-sticker.sm .sk-iso { height: 4mm; }
.gf-sticker.sm .sk-logo { height: 4mm; }
.gf-sticker.sm .sk-title { font-size: 5pt; }
.gf-sticker.sm .sk-body { padding: .6mm 1.2mm; gap: 1.2mm; }
.gf-sticker.sm .sk-qr { width: 15mm; height: 15mm; }
.gf-sticker.sm .sk-row { font-size: 4.2pt; line-height: 1.2; }
.gf-sticker.sm .sk-label { width: 10.5mm; padding: .3mm .6mm; margin-right: .8mm; }
.gf-sticker.sm .sk-foot { font-size: 4pt; padding: .3mm; }
.sk-qr canvas, .sk-qr img { width: 100% !important; height: 100% !important; }

/* certificate (A4) */
.cert-sheet { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #1d1d1f; padding: 14mm 15mm 12mm; position: relative; direction: ltr; font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif; box-shadow: 0 4px 30px rgba(0,0,0,.12); }
.cert-sheet .ar { direction: rtl; font-family: "IBM Plex Sans Arabic", sans-serif; }
.cert-sheet .c-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--gf-brand); padding-bottom: 6mm; }
.cert-sheet .c-ref { font-size: 9pt; text-align: right; color: #444; }
.cert-sheet .c-ref b { color: #111; }
/* معاينة النموذج: خانة تتعبّى من أمر العمل */
.cert-sheet .c-ph { color: #9aa0ad; font-style: italic; font-weight: 400; font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 8pt; }
.cert-sheet .c-title { text-align: center; margin: 7mm 0 5mm; }
.cert-sheet .c-title h2 { font-size: 19pt; font-weight: 800; color: var(--gf-brand); margin: 0; letter-spacing: 1px; }
.cert-sheet .c-title .ar { font-size: 13pt; color: var(--gf-charcoal); font-weight: 600; }
.cert-sheet table.c-info { width: 100%; font-size: 9.5pt; border-collapse: collapse; margin-bottom: 5mm; }
.cert-sheet table.c-info td { padding: 2mm 2.5mm; border: 1px solid #d5d7de; }
.cert-sheet table.c-info td.k { background: #f4f5f9; color: #444; width: 22%; font-weight: 600; }
.cert-sheet h6.c-sec { font-size: 10.5pt; font-weight: 800; color: var(--gf-brand); border-right: none; border-left: 3px solid var(--gf-red); padding-left: 2.5mm; margin: 5mm 0 2.5mm; }
.cert-sheet table.c-res { width: 100%; font-size: 9pt; border-collapse: collapse; text-align: center; }
.cert-sheet table.c-res th { background: var(--gf-brand); color: #fff; padding: 2mm; font-weight: 600; }
.cert-sheet table.c-res td { border: 1px solid #d5d7de; padding: 1.6mm; }
.cert-sheet .c-statement { font-size: 9.5pt; background: #f4f5f9; border-radius: 4px; padding: 3mm 4mm; margin-top: 5mm; }
.cert-sheet .c-sign { display: flex; gap: 6mm; margin-top: 8mm; }
.cert-sheet .c-sign > div { flex: 1; border: 1px solid #d5d7de; border-radius: 4px; padding: 3mm; font-size: 8.5pt; min-height: 36mm; }
.cert-sheet .c-sign .sig { height: 14mm; display: flex; align-items: center; justify-content: center; font-family: "Brush Script MT", cursive; font-size: 20pt; color: var(--gf-brand); }
.cert-sheet .c-sign .pending { color: #b0b3bd; font-family: inherit; font-size: 9pt; border: 1.5px dashed #c9ccd4; border-radius: 4px; width: 100%; }
.cert-sheet .c-foot { position: absolute; bottom: 10mm; left: 15mm; right: 15mm; display: flex; justify-content: space-between; align-items: flex-end; font-size: 7.5pt; color: #666; border-top: 1px solid #d5d7de; padding-top: 3mm; }
.cert-sheet .c-qr { width: 26mm; height: 26mm; }
.cert-sheet .c-qr canvas, .cert-sheet .c-qr img { width: 100% !important; height: 100% !important; display: block; }
.cert-sheet .watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-size: 70pt; font-weight: 900; color: rgba(215,49,44,.08); transform: rotate(-30deg); }

/* auth pages */
.gf-auth { min-height: 100vh; display: flex; background: #f4f5f9; }
.gf-auth .side { flex: 1; background: linear-gradient(160deg, var(--gf-charcoal) 0%, var(--gf-charcoal-dark) 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.gf-auth .side::after { content: ""; position: absolute; width: 420px; height: 420px; border: 50px solid rgba(216,35,42,.35); border-radius: 50%; left: -140px; bottom: -160px; }
.gf-auth .side h1 { color: #fff; font-weight: 800; font-size: 30px; }
.gf-auth .form-side { width: 480px; max-width: 100%; display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: #fff; }
.gf-auth .form-side .inner { width: 100%; max-width: 360px; }
@media (max-width: 991px) { .gf-auth .side { display: none; } .gf-auth .form-side { width: 100%; } }

/* public pages (verify / portal) */
.gf-public { background: #f4f5f9; min-height: 100vh; }
.gf-public .topbar { background: #fff; border-bottom: 3px solid var(--gf-red); padding: 12px 0; }
.gf-public .topbar img { height: 44px; max-width: 100%; width: auto; }

.table > :not(caption) > * > * { vertical-align: middle; }
.avatar-title.rounded-circle { font-weight: 600; }
.demo-banner { position: fixed; bottom: 14px; left: 14px; z-index: 2000; background: #fff7e6; border: 1px solid #f3d27a; color: #7a5200; font-size: 12px; padding: 5px 12px; border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

@media print {
    body { background: #fff !important; }
    .no-print, .vertical-menu, #page-topbar, .footer, .demo-banner, .page-title-box { display: none !important; }
    .main-content { margin: 0 !important; }
    .page-content { padding: 0 !important; }
    .cert-sheet { box-shadow: none; margin: 0; }
    body.gf-cert-print { padding: 0 !important; }
    .cert-sheet { min-height: 0; height: 296mm; overflow: hidden; page-break-after: avoid; }
}
@page { size: A4; margin: 0; }

/* ===== مؤشر التحميل (المثلث أعلى الزاوية) بألوان GFTest ===== */
.pace .pace-progress { background: linear-gradient(to right, #3A3C40 0%, #3A3C40 60%, #D8232A 100%) !important; }
.pace .pace-activity { background: #D8232A !important; }

/* ختم المعايرة تحت التوقيع (شكل مؤقت لين توصل صورة الختم الحقيقية) */
.cert-sheet .c-sig-row { display: flex; align-items: flex-end; gap: 3mm; }
.cert-sheet .c-sig-main { flex: 1; min-width: 0; }
.cert-sheet .c-stamp { width: 20mm; height: 20mm; border-radius: 50%; border: 1.6px solid var(--gf-brand); box-shadow: inset 0 0 0 1.2mm #fff, inset 0 0 0 1.5mm var(--gf-brand); color: var(--gf-brand); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 6pt; line-height: 1.15; transform: rotate(-12deg); opacity: .85; flex: none; }
.cert-sheet .c-stamp b { font-size: 6.5pt; }
.cert-sheet .c-stamp.empty { border-style: dashed; border-color: #c9ccd4; box-shadow: none; color: #b0b3bd; transform: none; }
.cert-sheet .c-ref { text-align: left; }

/* نموذج شهادة GFTest (Sample Certificate) */
.cert-sheet table.c-info { margin-bottom: 2mm; font-size: 8.5pt; }
.cert-sheet table.c-info td { padding: 1.2mm 2mm; }
.cert-sheet table.c-info td.k { width: 24%; }
.cert-sheet h6.c-sec { margin: 3mm 0 1.6mm; font-size: 9.5pt; }
.cert-sheet .c-title { margin: 4mm 0 3mm; }
.cert-sheet .c-head { padding-bottom: 3mm; }
.cert-sheet .c-two { display: flex; gap: 4mm; }
.cert-sheet .c-two > div { flex: 1; }
.cert-sheet .c-two table.c-info td.k { width: 40%; }
.cert-sheet .c-note { font-size: 8pt; color: #555; font-style: italic; text-align: center; margin: 1mm 0 0; }
.cert-sheet table.c-res { font-size: 8.5pt; }
.cert-sheet table.c-res th { padding: 1.4mm; line-height: 1.25; }
.cert-sheet table.c-res td { padding: 1.1mm; }
.cert-sheet .c-statement { font-size: 8pt; padding: 2.5mm 3.5mm; margin-top: 3mm; }
.cert-sheet .c-remarks { margin: 1mm 0 1.5mm; padding-left: 4.5mm; }
.cert-sheet .c-remarks li { margin-bottom: .4mm; }
.cert-sheet .c-free { border-top: 1px dashed #c9ccd4; padding-top: 1.5mm; }
.cert-sheet .c-sign { margin-top: 4mm; }
.cert-sheet .c-sign > div { min-height: 30mm; }
.cert-sheet .c-foot { position: static; margin-top: 4mm; padding-top: 2.5mm; }
.cert-sheet .c-qr { width: 22mm; height: 22mm; }
.cert-sheet .c-end { text-align: center; font-size: 8pt; color: #666; margin-top: 2mm; letter-spacing: .5px; }
.cert-sheet table.c-info td { padding: 1mm 2mm; }
.cert-sheet table.c-res td { padding: .8mm; }
.cert-sheet .c-sign > div { min-height: 0; padding: 2.5mm 3mm; }
.cert-sheet .c-sign .sig { height: 11mm; font-size: 18pt; }
.cert-sheet .c-stamp { width: 17mm; height: 17mm; font-size: 5.5pt; }

/* ===== الشهادة: إطار فاخر + عنوان + علامات مائية (2026-11-25) ===== */
.cert-sheet { overflow: hidden; }
.cert-sheet .cert-frame { position: absolute; inset: 6mm; border: 1.1pt solid var(--gf-brand); pointer-events: none; z-index: 0; }
.cert-sheet .cert-frame::after { content: ""; position: absolute; inset: 1.3mm; border: .5pt solid rgba(58,60,64,.45); }
.cert-sheet .cert-frame i { position: absolute; width: 9mm; height: 9mm; border-color: var(--gf-red); border-style: solid; border-width: 0; }
.cert-sheet .cert-frame .tl { top: -1.1pt; left: -1.1pt; border-top-width: 2.2pt; border-left-width: 2.2pt; }
.cert-sheet .cert-frame .tr { top: -1.1pt; right: -1.1pt; border-top-width: 2.2pt; border-right-width: 2.2pt; }
.cert-sheet .cert-frame .bl { bottom: -1.1pt; left: -1.1pt; border-bottom-width: 2.2pt; border-left-width: 2.2pt; }
.cert-sheet .cert-frame .br { bottom: -1.1pt; right: -1.1pt; border-bottom-width: 2.2pt; border-right-width: 2.2pt; }
.cert-sheet > *:not(.cert-frame):not(.watermark) { position: relative; z-index: 1; }
.cert-sheet .c-title h2 { font-family: "Cinzel", "Times New Roman", serif; font-weight: 700; font-size: 20pt; letter-spacing: 2.5px; text-transform: uppercase; }
.cert-sheet .c-orn { display: flex; align-items: center; justify-content: center; gap: 2.5mm; margin-top: 1.5mm; }
.cert-sheet .c-orn span { width: 22mm; height: .6pt; background: linear-gradient(90deg, transparent, var(--gf-brand)); }
.cert-sheet .c-orn span:last-child { background: linear-gradient(90deg, var(--gf-brand), transparent); }
.cert-sheet .c-orn i { width: 2mm; height: 2mm; background: var(--gf-red); transform: rotate(45deg); }
.cert-sheet .watermark { z-index: 2; letter-spacing: 6px; }
.cert-sheet .watermark.verified { color: rgba(30,158,90,.07); }
/* شارة VERIFIED في التذييل: ختم أخضر بعلامة صح (الاجتماع 2) */
.gf-verified-seal { display: inline-flex; align-items: center; gap: 2mm; color: var(--gf-green); font-weight: 800; font-size: 12pt; letter-spacing: .6px; margin-bottom: 1mm; }
.gf-verified-seal .gf-seal-img { height: 14mm; width: auto; flex-shrink: 0; }
/* صفحة الشهادة المستقلة ما تحمّل Bootstrap: بدون هذا يصير العرض 210mm + الهوامش وينقص الطرف عند الطباعة */
.cert-sheet, .cert-sheet *, .cert-sheet *::before, .cert-sheet *::after { box-sizing: border-box; }
/* ضغط تخطيط الشهادة لتطلع كاملة في صفحة A4 وحدة بعرض المحتوى الصحيح (180mm) */
.cert-sheet { padding: 11mm 13mm 10mm; }
.cert-sheet .c-head { padding-bottom: 2mm; }
.cert-sheet .c-head img { height: 15mm !important; }
.cert-sheet .c-ref { font-size: 8.5pt; line-height: 1.45; }
.cert-sheet .c-title { margin: 3mm 0 2.5mm; }
.cert-sheet .c-title h2 { font-size: 17pt; }
.cert-sheet .c-orn { margin-top: 1mm; }
.cert-sheet h6.c-sec { margin: 2.4mm 0 1.2mm; font-size: 9pt; }
.cert-sheet table.c-info { font-size: 7.9pt; margin-bottom: 1.5mm; }
.cert-sheet table.c-info td { padding: .75mm 1.8mm; line-height: 1.3; }
.cert-sheet table.c-info td.k { width: 26%; white-space: nowrap; }
.cert-sheet .c-two table.c-info td.k { width: 42%; }
.cert-sheet table.c-res { font-size: 8pt; }
.cert-sheet table.c-res th { padding: 1.1mm; }
.cert-sheet table.c-res td { padding: .55mm; }
.cert-sheet .c-note { font-size: 7.5pt; margin-top: .8mm; }
.cert-sheet .c-statement { font-size: 7.5pt; padding: 2mm 3mm; margin-top: 2.4mm; line-height: 1.35; }
.cert-sheet .c-remarks { margin: .6mm 0 1mm; }
.cert-sheet .c-remarks li { margin-bottom: .2mm; }
.cert-sheet .c-sign { margin-top: 2.8mm; gap: 5mm; }
.cert-sheet .c-sign > div { padding: 2mm 3mm; font-size: 8pt; }
.cert-sheet .c-sign .sig { height: 11mm; font-size: 18pt; } /* نفس حجم التوقيع الأصلي — لا تغيّره */
.cert-sheet .c-stamp { width: 15mm; height: 15mm; font-size: 5pt; }
.cert-sheet .c-stamp b { font-size: 6pt; }
.cert-sheet .c-foot { margin-top: 2.5mm; padding-top: 2mm; font-size: 7pt; gap: 6mm; }
.cert-sheet .c-qr { width: 19mm; height: 19mm; flex: none; }
/* التذييل في أسفل الإطار دائماً، وبدون إزاحة القاعدة القديمة (left/right: 15mm) */
.cert-sheet { display: flex; flex-direction: column; }
.cert-sheet .c-foot { left: auto; right: auto; margin-top: auto; }
.cert-sheet .c-sign { margin-bottom: 3mm; }
.cert-sheet table.c-info td { padding: 1mm 1.8mm; }
.cert-sheet table.c-res td { padding: .75mm; }
.cert-sheet .c-title { margin: 4mm 0 3mm; }
/* ما ينضغط أي قسم (كان يسبب تداخل التذييل مع التواقيع) + End of Report في آخر الإطار */
.cert-sheet > * { flex-shrink: 0; }
.cert-sheet { padding-bottom: 8mm; }
.cert-sheet .c-sign { margin-bottom: 2mm; }
.cert-sheet .c-end { margin-top: 1.5mm; font-size: 7.5pt; color: #777; letter-spacing: 1px; }
.cert-sheet h6.c-sec { margin: 2mm 0 1.1mm; }
/* الشعار الجديد عريض (≈ 5:1) */
.cert-sheet .c-head img { height: 12mm !important; margin-top: 1mm; }
.gf-public .topbar img { height: 48px; max-width: 80%; }
.gf-sticker.lg .sk-logo { height: 4.2mm; }
.gf-sticker.sm .sk-logo { height: 2.8mm; }
/* الشعار الجديد في رأس القائمة */
.navbar-brand-box .logo-lg img { height: 38px !important; width: auto; }
.navbar-brand-box .logo-sm img { height: 30px !important; width: auto; }
/* خط التوقيع المعتمد: Brush Script MT (خط النظام). لا تغيّره ولا تقدّم عليه خط ثاني.
   Yellowtail احتياطي فقط للأجهزة اللي ما فيها الخط، وشكله مختلف. */
@font-face { font-family: "GF Signature"; src: url("../fonts/Yellowtail-Regular.ttf") format("truetype"); font-display: block; }
.cert-sheet .c-sign .sig { font-family: "Brush Script MT", "GF Signature", cursive; }
/* القاعدة العامة (h1..h6 → IBM Plex !important) كانت تلغي خط العنوان */
.cert-sheet .c-title h2 { font-family: "Cinzel", "Times New Roman", serif !important; }

/* ===== محتوى الشهادة الحقيقي (2026-11-26): جدول Excel، الأسئلة، الرسم، النصوص ===== */
/* الشهادة الطويلة (جدول كبير) تكمل في صفحة ثانية بدل ما تنقص */
.cert-sheet.cert-flow { overflow: visible; }
/* التذييل كان ينزاح 10mm لفوق (bottom من القاعدة القديمة مع position: relative) فيغطي التواقيع لما الصفحة مليانة */
.cert-sheet.cert-flow .c-foot { bottom: auto; }
@media print { .cert-sheet.cert-flow { height: auto; min-height: 296mm; overflow: visible; page-break-after: auto; } }
.cert-sheet table.c-xl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 7.6pt; text-align: center; }
.cert-sheet table.c-xl td { border: 1px solid #c9ccd4; padding: .6mm .8mm; line-height: 1.25; white-space: pre-line; overflow-wrap: anywhere; vertical-align: middle; }
.cert-sheet table.c-xl td.b { font-weight: 700; background: #f4f5f9; color: var(--gf-brand); }
/* خلية خالية (اختيار المدير في النموذج): ما لها إطار ولا خلفية */
.cert-sheet table.c-xl td.x { border: none; background: transparent; }
.cert-sheet table.c-q { width: 100%; border-collapse: collapse; font-size: 7.9pt; margin-bottom: 1.5mm; }
.cert-sheet table.c-q td { border: 1px solid #d5d7de; padding: .75mm 1.8mm; }
.cert-sheet table.c-q td.a { width: 16mm; text-align: center; font-weight: 700; }
.cert-sheet table.c-q td.a.yes { color: #1E9E5A; }
.cert-sheet table.c-q td.a.no { color: var(--gf-red); }
.cert-sheet .c-chart { margin-top: 2mm; text-align: center; }
.cert-sheet .c-chart .t { font-size: 8.5pt; font-weight: 700; color: var(--gf-brand); }
.cert-sheet .c-chart svg { width: 100%; max-width: 150mm; height: auto; display: block; margin: 0 auto; }
.cert-sheet .c-text { font-size: 7.6pt; line-height: 1.35; margin-top: 1.6mm; white-space: pre-line; }
.cert-sheet .c-text b { color: var(--gf-brand); }
.cert-sheet .c-sign.three > div { font-size: 7.6pt; }
/* نفس جدول Excel في صفحة المعاينة داخل اللوحة */
.gf-xl-preview { overflow-x: auto; }
.gf-xl-preview table { border-collapse: collapse; font-size: 12px; direction: ltr; }
.gf-xl-preview td { border: 1px solid #d5d7de; padding: 3px 6px; text-align: center; white-space: pre-line; min-width: 48px; }
.gf-xl-preview td.b { font-weight: 700; background: #f4f5f9; }
.gf-xl-preview td[title] { cursor: help; text-decoration: underline dotted #9aa0b4; }

/* ===== اتجاه الكتابة في الحقول (2026-11-26) =====
   قالب Minia فيه [dir=rtl] input { text-align: end } فيعكس المحاذاة: الإنجليزي يمين والعربي يسار.
   المحاذاة تتبع اتجاه النص نفسه، والاتجاه يحدده assets/js/gftest-dir.js من أول حرف. */
[dir=rtl] input:not([type=checkbox]):not([type=radio]):not([type=range]), [dir=rtl] textarea { text-align: start; }
.otp-inputs input { text-align: center !important; } /* أقوى من قاعدة الاتجاه فوق */

/* ===== جدول ملف النموذج في صفحة "نماذج الشهادات" ===== */
.gf-grid { overflow: auto; max-height: 560px; border: 1px solid #e3e5eb; border-radius: 6px; direction: ltr; }
.gf-grid table { border-collapse: collapse; font-size: 11px; }
.gf-grid th { position: sticky; background: #f4f5f9; color: #74788d; font-weight: 600; text-align: center; padding: 2px 6px; border: 1px solid #e3e5eb; z-index: 2; }
.gf-grid thead th { top: 0; }
.gf-grid tbody th { left: 0; z-index: 1; }
.gf-grid td { border: 1px solid #eef0f4; padding: 2px 5px; white-space: pre-line; max-width: 220px; overflow: hidden; cursor: pointer; vertical-align: middle; }
.gf-grid td:hover { outline: 2px solid var(--gf-ink); outline-offset: -2px; }
.gf-grid td.b { font-weight: 700; }
.gf-grid td.m-table { background: #f1f2f5; }
.gf-grid td.m-formula { color: #1f4fd1; font-style: italic; }
.gf-grid td.m-override { background: #ffe8cc; color: #8a4b00; font-style: italic; }
.gf-grid td.m-input { background: #d9f5e6; font-style: normal; }
.gf-grid td.m-chart { box-shadow: inset 0 -2px 0 var(--gf-ink); }
.gf-grid td.m-selected { outline: 2px solid #f1734f; outline-offset: -2px; }
/* فاضية: ما يطلع فيها شي في الشهادة */
.gf-grid td.m-blank { background: repeating-linear-gradient(135deg, #fff, #fff 4px, #eef0f4 4px, #eef0f4 8px); color: transparent; }
/* محذوف من الجدول (صف أو عمود) */
.gf-grid td.m-hidden { background: #f6f6f8; color: #b4b8c3; text-decoration: line-through; }
.gf-grid th.m-in { cursor: pointer; color: var(--gf-ink); }
.gf-grid th.m-in:hover { background: #fde4dc; color: #c0392b; }
.gf-grid th.m-hidden { background: #fde4dc; color: #c0392b; text-decoration: line-through; }
.gf-grid th.m-hidden:hover { background: #dff3ea; color: #1e8a5e; text-decoration: none; }
/* لوحة الخلية: اختيار وضع الخلية */
.gf-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gf-modes label { display: flex; align-items: flex-start; gap: 6px; border: 1px solid #e3e5eb; border-radius: 6px; padding: 6px 8px; cursor: pointer; background: #fff; margin: 0; }
.gf-modes label:hover { border-color: var(--gf-ink); }
.gf-modes label:has(input:checked) { border-color: var(--gf-ink); box-shadow: 0 0 0 1px var(--gf-ink); background: #fdf3f3; }
.gf-modes input { margin-top: 3px; }
.gf-modes .gf-dot { flex: none; margin-top: 2px; }
.gf-modes b { display: block; font-size: 13px; }
.gf-modes small { display: block; color: #74788d; font-size: 11.5px; line-height: 1.35; }
@media (max-width: 576px) { .gf-modes { grid-template-columns: 1fr; } }
.gf-legend span { display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 12px; font-size: 12px; }
.gf-legend i, .gf-dot { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid #d5d7de; vertical-align: -2px; }
.gf-legend i.m-table, .gf-dot.m-table { background: #f1f2f5; }
.gf-legend i.m-input, .gf-dot.m-input { background: #d9f5e6; }
.gf-legend i.m-formula { background: #fff; border-color: #1f4fd1; }
.gf-legend i.m-override, .gf-dot.m-override { background: #ffe8cc; }
.gf-dot.m-formula { background: #fff; border-color: #1f4fd1; }
.gf-legend i.m-blank, .gf-dot.m-blank { background: repeating-linear-gradient(135deg, #fff, #fff 3px, #d5d7de 3px, #d5d7de 5px); }
.gf-legend i.m-hidden, .gf-dot.m-hidden { background: #fde4dc; border-color: #e8a798; }
.gf-legend i.m-chart { background: #fff; box-shadow: inset 0 -2px 0 var(--gf-ink); }
.gf-cell-panel { border: 1px solid #e3e5eb; border-radius: 6px; background: #fafbfd; padding: 10px 12px; margin-bottom: 10px; position: sticky; top: 80px; z-index: 6; box-shadow: 0 6px 18px rgba(20, 30, 60, .12); }
/* صفحة النموذج: القسم المفتوح، وجزؤه في الشهادة */
.gf-sec-card [data-sec-head] { cursor: pointer; }
/* اللوحة داخل قسم الجدول (تبويب شكل الشهادة): جزء من القسم، مو عائمة */
.gf-cell-panel.in-section { position: static; box-shadow: none; margin-bottom: 0; }
/* الوضع المتقدم: عائمة أسفل الشاشة فوق جدول Excel، عشان ما تدفعه لتحت */
.gf-cell-panel.floating { position: fixed; top: auto; bottom: 16px; z-index: 1030; margin: 0; max-height: 45vh; overflow-y: auto; box-shadow: 0 -4px 24px rgba(20, 30, 60, .18); }
.gf-sec-card.gf-sec-active { box-shadow: 0 0 0 2px var(--gf-ink); }
.gf-sec-card.gf-sec-active [data-sec-head] { background: #fdf3f3; }
#preview [data-sec] { cursor: pointer; border-radius: 3px; transition: box-shadow .15s; }
#preview [data-sec]:hover { box-shadow: 0 0 0 1px #9aacf3; }
#preview [data-sec].gf-sec-on { box-shadow: 0 0 0 2px var(--gf-ink); }
/* مسميات الشهادة في المعاينة: الضغط يفتح خانتها في "مسميات الشهادة" */
#preview [data-label] { cursor: text; border-radius: 2px; }
#preview [data-label]:hover, #preview[data-active=labels] [data-label] { background: rgba(216, 35, 42, .1); box-shadow: 0 1px 0 var(--gf-brand); }
/* جدول الشهادة لما قسم الجدول مفتوح: الخلايا تنضغط وتتلوّن زي جدول Excel */
#preview[data-active=table] .c-xl td[data-ref] { cursor: pointer; }
#preview[data-active=table] .c-xl td[data-ref]:hover { outline: 2px solid var(--gf-ink); outline-offset: -2px; }
#preview[data-active=table] .c-xl td.m-input { background: #d9f5e6; }
/* خانة فني لها قائمة خيارات (Pass / Fail...): سهم صغير في طرفها */
#preview[data-active=table] .c-xl td.m-list, .gf-grid td.m-list { position: relative; }
#preview[data-active=table] .c-xl td.m-list::after, .gf-grid td.m-list::after { content: "▾"; position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%); font-size: 9px; color: #1E9E5A; }
#preview[data-active=table] .c-xl td.m-override { background: #ffe8cc; color: #8a4b00; }
#preview[data-active=table] .c-xl td.m-formula { color: #1f4fd1; }
#preview[data-active=table] .c-xl td.m-blank { background: repeating-linear-gradient(135deg, #fff, #fff 4px, #eef0f4 4px, #eef0f4 8px); outline: 1px dashed #c9ccd4; outline-offset: -1px; }
#preview[data-active=table] .c-xl td.m-selected { outline: 2px solid #f1734f; outline-offset: -2px; }
.gf-save-status { font-weight: 600; }
.gf-save-status.saved { color: #1e8a5e; }
.gf-save-status.saving { color: #74788d; }
.gf-save-status.dirty { color: #b7791f; }
.gf-save-status.failed { color: #c0392b; }
@media (min-width: 1200px) { .gf-template-side { position: sticky; top: 80px; } }
/* جدول إدخال القراءات في صفحة الشهادة: نفس شكل جدول الشهادة، والخانات حقول */
.gf-entry { overflow-x: auto; direction: ltr; }
.gf-entry table.c-xl { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; font-size: 12px; text-align: center; }
.gf-entry td { border: 1px solid #dfe2e8; padding: 2px 4px; overflow-wrap: break-word; vertical-align: middle; } /* break-word: الرقم ما ينقسم سطرين (347.59 / 5) */
.gf-entry td span { white-space: pre-line; }
.gf-entry td.b { font-weight: 700; background: #f4f5f9; color: var(--gf-ink); }
.gf-entry td.in { background: #fff; padding: 1px; }
.gf-entry td.in input { min-width: 64px; border-color: #b8e6cc; text-align: center; padding: 2px 4px; font-size: 12px; }
.gf-entry td.in input:focus { border-color: var(--gf-ink); }
.gf-entry td.fx { color: #1f4fd1; }
.gf-entry td.x { border: none; background: transparent; }

/* الفلترة التلقائية: زر الفلترة يظهر بس لو JavaScript ما اشتغل (layouts/admin) */
.gf-js [data-filter-submit] { display: none !important; }

/* التقويم (flatpickr): لون GFTest بدل لون الثيم، وألوان تتبع الوضع الداكن عبر متغيرات الثيم */
.flatpickr-calendar { background: var(--bs-dropdown-bg); box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.flatpickr-months, .flatpickr-weekdays, .flatpickr-months .flatpickr-month, span.flatpickr-weekday { background-color: var(--gf-brand) !important; }
.flatpickr-months .flatpickr-prev-month svg, .flatpickr-months .flatpickr-next-month svg { fill: #fff; }
.flatpickr-current-month, .flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-current-month input.cur-year { color: #fff; }
.flatpickr-current-month .flatpickr-monthDropdown-months option { color: #1d1d1f; }
.flatpickr-day { color: var(--bs-body-color) !important; }
.flatpickr-day.today { border-color: var(--gf-ink) !important; background-color: var(--gf-brand-soft); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background-color: var(--gf-brand) !important; border-color: var(--gf-brand) !important; color: #fff !important; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { opacity: .35; }
body[data-layout-mode=dark] .flatpickr-day:hover, body[data-layout-mode=dark] .flatpickr-day:focus { background-color: rgba(255,255,255,.08) !important; }
.flatpickr-input[readonly] { cursor: pointer; }

/* ===== الوضع الداكن (2026-11-29) =====
   الأحمر الغامق على الخلفية الداكنة (#313533) ما يبان بوضوح، والرمادي الفحمي يختفي.
   - --gf-ink (النصوص والروابط والأيقونات): أحمر فاتح (وردي) من نفس اللون، تباين أكثر من 5:1 على الخلفية.
   - --gf-brand (تعبئة الأزرار وخلفها نص أبيض): أحمر معتدل، والأبيض عليه 4.8:1.
   - الألوان الفاتحة الثابتة (لوحة الخلية، جدول Excel، جدول القراءات...) لها نسخة داكنة.
   - الشهادة والملصق "ورق" يطبع: يبقون بالرمادي الفحمي مع لمسات حمراء حتى في الوضع الداكن. */
body[data-layout-mode=dark] {
    --gf-brand: #D93A40;
    --gf-brand-dark: #C42F35;
    --gf-brand-soft: rgba(255, 138, 142, .12);
    --gf-ink: #FF8A8E;
    --gf-chart: #C9CCD4;
    --bs-link-color: #FF8A8E;
    --bs-link-hover-color: #FFB0B3;
}
.cert-sheet, .gf-sticker {
    --gf-brand: #3A3C40;
    --gf-brand-dark: #26282B;
    --gf-brand-soft: rgba(58, 60, 64, .09);
    --gf-ink: #3A3C40;
    --gf-chart: #3A3C40;
}
/* الخطوات */
body[data-layout-mode=dark] .gf-steps .st::before, body[data-layout-mode=dark] .gf-steps .st::after { background: #3b403d; }
body[data-layout-mode=dark] .gf-steps .st.done::before { background: var(--gf-green); }
body[data-layout-mode=dark] .gf-steps .st.current::before { background: var(--gf-brand); }
body[data-layout-mode=dark] .gf-steps .st.done::after, body[data-layout-mode=dark] .gf-steps .st.current::after { background: var(--gf-green); }
body[data-layout-mode=dark] .otp-inputs input { border-color: #454b47; }
/* جدول ملف النموذج ولوحة الخلية */
body[data-layout-mode=dark] .gf-grid { border-color: #3b403d; }
body[data-layout-mode=dark] .gf-grid th { background: #373c39; color: #adb5bd; border-color: #3b403d; }
body[data-layout-mode=dark] .gf-grid td { border-color: #3b403d; }
body[data-layout-mode=dark] .gf-grid td.m-table { background: rgba(201, 204, 212, .07); }
body[data-layout-mode=dark] .gf-grid td.m-formula { color: var(--gf-ink); }
body[data-layout-mode=dark] .gf-grid td.m-override { background: rgba(241, 180, 76, .18); color: #f6c67a; }
body[data-layout-mode=dark] .gf-grid td.m-input { background: rgba(52, 195, 143, .2); }
body[data-layout-mode=dark] .gf-grid td.m-chart { box-shadow: inset 0 -2px 0 var(--gf-ink); }
body[data-layout-mode=dark] .gf-legend i, body[data-layout-mode=dark] .gf-dot { border-color: #454b47; }
body[data-layout-mode=dark] .gf-legend i.m-table, body[data-layout-mode=dark] .gf-dot.m-table { background: rgba(201, 204, 212, .07); }
body[data-layout-mode=dark] .gf-legend i.m-input, body[data-layout-mode=dark] .gf-dot.m-input { background: rgba(52, 195, 143, .2); }
body[data-layout-mode=dark] .gf-legend i.m-formula { background: transparent; border-color: var(--gf-ink); }
body[data-layout-mode=dark] .gf-legend i.m-override, body[data-layout-mode=dark] .gf-dot.m-override { background: rgba(241, 180, 76, .18); }
body[data-layout-mode=dark] .gf-legend i.m-chart { background: transparent; box-shadow: inset 0 -2px 0 var(--gf-ink); }
body[data-layout-mode=dark] .gf-cell-panel { background: #373c39; border-color: #3b403d; }
body[data-layout-mode=dark] .gf-sec-card.gf-sec-active { box-shadow: 0 0 0 2px var(--gf-ink); }
body[data-layout-mode=dark] .gf-sec-card.gf-sec-active [data-sec-head] { background: rgba(201, 204, 212, .08); }
body[data-layout-mode=dark] .gf-grid td.m-blank { background: repeating-linear-gradient(135deg, transparent, transparent 4px, rgba(255,255,255,.06) 4px, rgba(255,255,255,.06) 8px); }
body[data-layout-mode=dark] .gf-grid td.m-hidden { background: rgba(255,255,255,.03); color: #6c757d; }
body[data-layout-mode=dark] .gf-grid th.m-in { color: var(--gf-ink); }
body[data-layout-mode=dark] .gf-grid th.m-hidden, body[data-layout-mode=dark] .gf-grid th.m-in:hover { background: rgba(244, 106, 106, .18); color: #f8a5a5; }
body[data-layout-mode=dark] .gf-modes label { background: #313533; border-color: #454b47; }
body[data-layout-mode=dark] .gf-modes label:has(input:checked) { background: rgba(255, 138, 142, .12); border-color: var(--gf-ink); box-shadow: 0 0 0 1px var(--gf-ink); }
/* جدول إدخال القراءات في صفحة الشهادة */
body[data-layout-mode=dark] .gf-entry td { border-color: #3b403d; }
body[data-layout-mode=dark] .gf-entry td.b { background: #373c39; }
body[data-layout-mode=dark] .gf-entry td.in { background: transparent; }
body[data-layout-mode=dark] .gf-entry td.in input { border-color: rgba(52, 195, 143, .45); }
body[data-layout-mode=dark] .gf-entry td.fx { color: var(--gf-ink); }

/* ---------- أوامر العمل (الاجتماع 2) ---------- */
/* قائمة بحث بطريقة دفترة: تكتب جزء من الاسم فتطلع الخيارات، وفي آخرها "إضافة جديد" */
.gf-combo { position: relative; }
.gf-combo-menu { position: absolute; z-index: 1060; inset-inline: 0; top: calc(100% + 2px); background: #fff; border: 1px solid #d5d8e0; border-radius: 6px; box-shadow: 0 8px 24px rgba(20, 24, 40, .12); max-height: 280px; overflow-y: auto; display: none; min-width: 240px; }
.gf-combo.open .gf-combo-menu { display: block; }
.gf-combo.up .gf-combo-menu { top: auto; bottom: calc(100% + 2px); box-shadow: 0 -8px 24px rgba(20, 24, 40, .12); }
.gf-combo-item { padding: 7px 12px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.gf-combo-item small { display: block; color: #74788d; font-size: 11.5px; }
.gf-combo-item.active, .gf-combo-item:hover { background: var(--gf-brand); color: #fff; }
.gf-combo-item.active small, .gf-combo-item:hover small { color: rgba(255, 255, 255, .8); }
.gf-combo-empty { padding: 8px 12px; color: #74788d; font-size: 12.5px; }
.gf-combo-add { position: sticky; bottom: 0; display: block; width: 100%; text-align: start; padding: 8px 12px; border: 0; border-top: 1px solid #e4e6ec; background: #f6f7fa; color: var(--gf-ink); font-size: 13px; font-weight: 600; }
.gf-combo-add:hover { background: var(--gf-brand-soft); }

/* جدول أسطر الطلب */
.gf-lines { margin-bottom: 0; }
.gf-lines th { font-size: 12.5px; white-space: nowrap; background: #f6f7fa; }
.gf-lines td { vertical-align: top; padding: 6px; }
.gf-lines .ln-no { width: 34px; text-align: center; color: #74788d; font-weight: 600; padding-top: 12px; }
.gf-lines .ln-drag { width: 24px; cursor: grab; color: #adb5bd; padding-top: 12px; text-align: center; }
.gf-lines tr.dragging { opacity: .45; }
.gf-lines .ln-hint { font-size: 11.5px; margin-top: 3px; color: #74788d; }
.gf-lines .ln-hint.match { color: var(--gf-green); }
.gf-lines .ln-hint.warn { color: #c98a12; }
.gf-lines .ln-del { width: 36px; text-align: center; }
.gf-lines-add { border-top: 1px dashed #d5d8e0; }

/* الخط الزمني للطلب: فتح الطلب ← الملصقات ← القراءات ← توقيع الفني ← المراجعة ← الإصدار */
.gf-flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.gf-flow .fl { flex: 1; min-width: 120px; position: relative; text-align: center; padding: 10px 8px 8px; border-radius: 8px; background: #f3f4f8; color: #74788d; font-size: 12.5px; }
.gf-flow .fl + .fl { margin-inline-start: 22px; }
.gf-flow .fl + .fl::before { content: "\F0054"; font-family: "Material Design Icons"; position: absolute; inset-inline-start: -19px; top: 50%; transform: translateY(-50%); color: #adb5bd; font-size: 16px; }
[dir=rtl] .gf-flow .fl + .fl::before { content: "\F004D"; }
.gf-flow .fl .mdi { display: block; font-size: 22px; margin-bottom: 2px; }
.gf-flow .fl b { display: block; font-size: 15px; color: inherit; }
.gf-flow .fl.done { background: rgba(30, 158, 90, .1); color: var(--gf-green); }
.gf-flow .fl.current { background: var(--gf-brand); color: #fff; box-shadow: 0 0 0 4px var(--gf-brand-soft); }

/* سجل الأحداث */
.gf-log { list-style: none; padding: 0; margin: 0; }
.gf-log li { position: relative; padding: 0 0 14px; padding-inline-start: 22px; font-size: 13px; }
.gf-log li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gf-brand); }
.gf-log li::after { content: ""; position: absolute; inset-inline-start: 8.5px; top: 16px; bottom: 0; width: 1px; background: #e4e6ec; }
.gf-log li:last-child::after { display: none; }
.gf-log li.rejected::before, .gf-log li.voided::before, .gf-log li.cancelled::before, .gf-log li.revoked::before { background: var(--gf-red); }
.gf-log li.issued::before, .gf-log li.approved::before, .gf-log li.reviewed::before { background: var(--gf-green); }
.gf-log li.review_reopened::before { background: #f1a33c; }
.gf-log .meta { color: #74788d; font-size: 11.5px; }

body[data-layout-mode=dark] .gf-combo-menu { background: #2c302e; border-color: #3b403d; }
body[data-layout-mode=dark] .gf-combo-add { background: #313533; border-color: #3b403d; }
body[data-layout-mode=dark] .gf-lines th { background: #313533; }
body[data-layout-mode=dark] .gf-flow .fl { background: #313533; }
body[data-layout-mode=dark] .gf-log li::after { background: #3b403d; }

/* زر من الصفحة في منتصف الشريط العلوي (حفظ النموذج) */
#page-topbar .gf-topbar-center { display: flex; align-items: center; justify-content: center; flex: 1; }

/* الرسم البياني في صفحة النموذج: .row فيها display:flex تغلب hidden */
[data-chart-box] [hidden] { display: none !important; }

/* قفل خانة الرأس في النموذج: الفني يعدّلها أو ثابتة */
.gf-lock { white-space: nowrap; min-width: 8.5rem; }
.gf-lock .gf-lock-on, .btn-check:checked + .gf-lock .gf-lock-off { display: none; }
.btn-check:checked + .gf-lock .gf-lock-on { display: inline; }

/* قائمة إنجليزية في صفحة عربية (جواب السؤال): السهم أقصى اليمين والنص يسار */
.form-select.gf-select-ltr { direction: ltr; text-align: left; background-position: right .6rem center; padding-left: .6rem; padding-right: 2rem; }

/* خيار معطّل في قائمة البحث (نوع مرتبط بنموذج آخر) */
.gf-combo-item.disabled, .gf-combo-item.disabled:hover { background: none; color: #adb5bd; cursor: not-allowed; }
.gf-combo-item.disabled small, .gf-combo-item.disabled:hover small { color: #adb5bd; }

/* معاينة النموذج: خلية فاضية في الجدول (شَرطة باهتة) */
.cert-sheet table.c-xl .c-dash { color: #b5b9c4; }

/* صورة الختم المرفوعة في الشهادة (بدل الختم المرسوم) */
.cert-sheet .c-stamp-img { width: 20mm; height: 20mm; object-fit: contain; flex-shrink: 0; }

/* ===== مراجعة الوضع الداكن (2026-12-01) =====
   ألوان القالب الأصلية مكتوبة للوضع الفاتح، فبعضها يختفي على الخلفية الداكنة:
   - badge-soft-dark (ملغى/ملغاة) نصه #343a40 على خلفية داكنة = ما يبان.
   - badge-soft-secondary ونص الجداول (#858d98) باهتين ويتعبون العين.
   - btn-light و alert-light/dark و bg-light text-dark: خلفيات بيضاء صارخة أو نص غامق.
   - رقم "الإجمالي" في وسط الدائرة (ApexCharts) غامق.
   الهدف: نص أساسي ~#d9dce1، ثانوي ~#a6adb7 (تباين ≥ 5:1)، بدون أبيض صافي يلمع. */
body[data-layout-mode=dark] {
    --bs-body-color: #d9dce1;
    --bs-text-muted: #a0a7b1;
    --bs-table-color: #c9cdd3;
    --bs-heading-color: #eef0f3;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body[data-layout-mode=dark] .text-muted { color: #a0a7b1 !important; }
body[data-layout-mode=dark] .table { --bs-table-color: #c9cdd3; color: #c9cdd3; }
body[data-layout-mode=dark] .table-light { --bs-table-color: #e2e5e9; color: #e2e5e9; }

/* الشارات الناعمة: نص أفتح وخلفية أوضح شوي */
body[data-layout-mode=dark] .badge-soft-dark { color: #dfe2e7; background-color: rgba(223, 226, 231, .14); }
body[data-layout-mode=dark] .badge-soft-secondary { color: #c3c8d0; background-color: rgba(195, 200, 208, .14); }
body[data-layout-mode=dark] .badge-soft-success { color: #4fd6a3; background-color: rgba(52, 195, 143, .16); }
body[data-layout-mode=dark] .badge-soft-warning { color: #f6c46e; background-color: rgba(241, 180, 76, .16); }
body[data-layout-mode=dark] .badge-soft-danger { color: #f69191; background-color: rgba(244, 106, 106, .16); }
body[data-layout-mode=dark] .badge-soft-info { color: #6fd3f0; background-color: rgba(80, 165, 241, .16); }
body[data-layout-mode=dark] .badge.bg-light { background-color: #3f4542 !important; }
body[data-layout-mode=dark] .badge.bg-light.text-dark, body[data-layout-mode=dark] .bg-light .text-dark { color: #dfe2e7 !important; }

/* الأزرار الفاتحة: رمادي داكن بدل الأبيض */
body[data-layout-mode=dark] .btn-light { color: #dfe2e7; background-color: #3b403d; border-color: #464c49; box-shadow: none; }
body[data-layout-mode=dark] .btn-light:hover, body[data-layout-mode=dark] .btn-light:focus, body[data-layout-mode=dark] .btn-light:active { color: #fff; background-color: #454b47; border-color: #525955; }

/* التنبيهات والصناديق الفاتحة */
body[data-layout-mode=dark] .alert-light { color: #c9cdd3; background-color: #373c39; border-color: #454b47; }
body[data-layout-mode=dark] .alert-dark { color: #e2e5e9; background-color: #3f4542; border-color: #4c524f; }
body[data-layout-mode=dark] .bg-light { background-color: #373c39 !important; }

/* الرسوم: نصوص الدائرة والمحاور */
body[data-layout-mode=dark] .apexcharts-datalabel-label, body[data-layout-mode=dark] .apexcharts-datalabel-value { fill: #e2e5e9 !important; }
body[data-layout-mode=dark] .apexcharts-text, body[data-layout-mode=dark] .apexcharts-legend-text { fill: #a6adb7; color: #c9cdd3 !important; }
/* التنبيهات الملونة: خلفية شفافة هادئة بدل الألوان الفاتحة الصارخة */
body[data-layout-mode=dark] .alert-success { color: #7fe0b9; background-color: rgba(52, 195, 143, .12); border-color: rgba(52, 195, 143, .3); }
body[data-layout-mode=dark] .alert-warning { color: #f6cf8a; background-color: rgba(241, 180, 76, .12); border-color: rgba(241, 180, 76, .3); }
body[data-layout-mode=dark] .alert-danger { color: #f8a5a5; background-color: rgba(244, 106, 106, .12); border-color: rgba(244, 106, 106, .3); }
body[data-layout-mode=dark] .alert-info { color: #8fdcf3; background-color: rgba(80, 165, 241, .12); border-color: rgba(80, 165, 241, .3); }
body[data-layout-mode=dark] .alert-primary { color: var(--gf-ink); background-color: var(--gf-brand-soft); border-color: rgba(255, 138, 142, .3); }
body[data-layout-mode=dark] .alert .alert-link { color: inherit; }

/* ===== بقايا ألوان قالب Minia (البنفسجي #5156be) بدّلناها بأحمر الشعار (2026-12-02) ===== */
:root { --bs-sidebar-menu-item-hover-effact-color: rgba(216, 35, 42, .2); }
.avatar-title { background-color: var(--gf-brand); }
.form-check-primary .form-check-input:checked, .form-radio-primary .form-check-input:checked { background-color: var(--gf-brand); border-color: var(--gf-brand); }
.form-radio-primary .form-check-input:checked:after { background-color: var(--gf-brand); }
input[switch]:checked + label, input[switch=primary]:checked + label { background-color: var(--gf-brand); }
.choices__list--multiple .choices__item, .choices__list--multiple .choices__item.is-highlighted { background-color: var(--gf-brand); border-color: var(--gf-brand); }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before { background-color: var(--gf-brand); }
.card-radio-input:checked + .card-radio { border-color: var(--gf-brand) !important; }
.swal2-loader { border-color: var(--gf-brand) transparent var(--gf-brand) transparent; }
.waves-effect.waves-primary .waves-ripple { background-color: rgba(216, 35, 42, .4); }

/* أسماء سلاسل الرسوم (ApexCharts) في العربي: العلامة كانت تغطي أول الكلمة */
[dir=rtl] .apexcharts-legend-series { display: inline-flex !important; align-items: center; gap: 6px; }
[dir=rtl] .apexcharts-legend-marker { margin: 0 !important; }
