/* [Access Keys السوفت] صفحة الجيم: الدفعات + QR + اختيار + PNG + اتطبع / لسه */
.gak { max-width: 1180px; padding-bottom: 80px; }
.gak-hero { display: flex; align-items: center; gap: 16px; padding: 22px 24px !important; background: radial-gradient(520px 180px at 100% 0, var(--gs-red-soft, rgba(213, 60, 65, .1)), transparent 70%), linear-gradient(180deg, var(--gs-surface, #fff), var(--gs-bg, #fafafb)) !important; }
[dir=rtl] .gak-hero { background: radial-gradient(520px 180px at 0 0, var(--gs-red-soft, rgba(213, 60, 65, .1)), transparent 70%), linear-gradient(180deg, var(--gs-surface, #fff), var(--gs-bg, #fafafb)) !important; }
.gak-ic { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, #2a2d33, #0b0b0c); box-shadow: 0 12px 26px rgba(0, 0, 0, .22); flex: 0 0 auto; }
.gak-hero-txt { min-width: 0; flex: 1; }
.gak-hero h3 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.gak-hero p { margin: 0; color: var(--gs-muted, #6b7280); font-size: 13.5px; line-height: 1.6; max-width: 620px; }
.gak-btn { height: 42px; padding: 0 18px; font-weight: 800; border-radius: 12px; flex: 0 0 auto; }

/* الدفعات */
.gak-batches { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 14px 0; }
.gak-batch { display: flex; flex-direction: column; gap: 8px; text-align: start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--gs-border, #eceef1); background: var(--gs-surface, #fff); box-shadow: var(--gs-shadow-sm, 0 1px 2px rgba(16, 24, 40, .04)); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; font: inherit; color: inherit; min-width: 0; }
.gak-batch:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 0, 0, .07); }
.gak-batch.is-on { border-color: #141414; box-shadow: 0 0 0 2px #141414 inset, 0 10px 24px rgba(0, 0, 0, .08); }
.gak-batch:focus-visible { outline: 2px solid #141414; outline-offset: 2px; }
.gak-batch.is-skel { min-height: 104px; cursor: default; background: linear-gradient(90deg, #f0f1f3 25%, #e6e8eb 37%, #f0f1f3 63%); background-size: 400% 100%; animation: gakSkel 1.2s ease infinite; border: 0; }
.gak-batch-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gak-batch-top b { font-size: 16px; font-weight: 800; }
.gak-batch-n { font-size: 12.5px; font-weight: 700; color: var(--gs-muted, #6b7280); }
.gak-bar { display: block; height: 7px; border-radius: 99px; background: #f0f1f3; overflow: hidden; }
.gak-bar i { display: block; height: 100%; background: linear-gradient(90deg, #141414, #4b5563); border-radius: 99px; }
.gak-batch.is-done .gak-bar i { background: linear-gradient(90deg, #16a34a, #22c55e); }
.gak-batch-st { font-size: 13px; font-weight: 700; }
.gak-batch-st b { color: #d97706; }
.gak-batch.is-done .gak-batch-st { color: #16a34a; }
.gak-batch-meta { font-size: 12px; color: var(--gs-muted, #8b9098); }
.gak-empty { grid-column: 1 / -1; }
.gak-empty small { display: block; margin-top: 6px; color: var(--gs-muted, #8b9098); font-size: 12.5px; }

/* الأكواد */
.gak-keys { padding: 18px !important; }
.gak-keys-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.gak-keys-title b { display: block; font-size: 17px; font-weight: 800; }
.gak-keys-title small { color: var(--gs-muted, #8b9098); font-size: 12.5px; }
#gakShow em { font-style: normal; font-size: 11.5px; font-weight: 800; background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 1px 7px; margin-inline-start: 4px; }
#gakShow button.is-on em { background: rgba(255, 255, 255, .2); }
.gak-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--gs-bg, #f7f8fa); margin-bottom: 14px; }
.gak-pick, .gak-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gak-range { display: inline-flex; align-items: center; gap: 6px; }
.gak-range label { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--gs-muted, #6b7280); white-space: nowrap; }
.gak-range .form-control { width: 76px; height: 32px; padding: 2px 8px; border-radius: 10px; font-size: 13px; }
.gak-opt { font-size: 12.5px; font-weight: 700; color: var(--gs-muted, #6b7280); }
.gak-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 700; cursor: pointer; }

.gak-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gak-qr { position: relative; background: #fff; border: 1px solid var(--gs-border, #eceef1); border-radius: 16px; padding: 14px 10px 10px; text-align: center; box-shadow: var(--gs-shadow-sm, 0 1px 2px rgba(16, 24, 40, .04)); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; animation: gakIn .25s ease both; min-width: 0; }
.gak-qr:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .08); }
.gak-qr.is-picked { border-color: #141414; box-shadow: 0 0 0 2px #141414 inset; }
.gak-qr.is-printed .gak-qr-code { opacity: .45; }
.gak-qr-code { display: flex; justify-content: center; min-height: 128px; cursor: pointer; direction: ltr; }
.gak-qr-code img, .gak-qr-code canvas { max-width: 100%; height: auto; }
.gak-qr-n { font-weight: 800; margin-top: 8px; font-size: 13.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.gak-qr-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin-top: 6px; min-height: 22px; }
.gak-qr-check { position: absolute; top: 8px; inset-inline-start: 8px; margin: 0; cursor: pointer; z-index: 1; }
.gak-qr-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gak-qr-check span { display: block; width: 24px; height: 24px; border-radius: 8px; border: 2px solid #d4d7dd; background: #fff; transition: all .15s ease; }
.gak-qr-check input:checked + span { background: #141414; border-color: #141414; }
.gak-qr-check input:checked + span::after { content: '\f00c'; font-family: FontAwesome; color: #fff; font-size: 12px; display: grid; place-items: center; height: 100%; }
.gak-qr-check input:focus-visible + span { outline: 2px solid #141414; outline-offset: 2px; }
.gak-qr-dl { position: absolute; top: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 10px; border: 0; background: #141414; color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.9); transition: opacity .15s ease, transform .15s ease; cursor: pointer; }
.gak-qr:hover .gak-qr-dl, .gak-qr-dl:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .gak-qr-dl { opacity: 1; transform: none; } }
.gak-qr.is-skel { animation: none; box-shadow: none; }
.gak-qr.is-skel .gak-qr-code span, .gak-skel { display: inline-block; background: linear-gradient(90deg, #f0f1f3 25%, #e6e8eb 37%, #f0f1f3 63%); background-size: 400% 100%; animation: gakSkel 1.2s ease infinite; border-radius: 10px; }
.gak-qr.is-skel .gak-qr-code span { width: 128px; height: 128px; }
.gak-skel { width: 50px; height: 14px; }

/* الترقيم */
.gak-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.gak-pager[hidden] { display: none; }
.gak-pager-pages { display: flex; gap: 4px; align-items: center; }
.gak-pg { min-width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--gs-border, #eceef1); background: #fff; font-weight: 700; cursor: pointer; }
.gak-pg.is-on { background: #141414; color: #fff; border-color: #141414; }
.gak-pg:disabled { opacity: .4; cursor: default; }
.gak-pg-gap { padding: 0 4px; color: #9aa0a8; }
.gak-pager-size select { border: 1px solid var(--gs-border, #eceef1); border-radius: 8px; padding: 3px 6px; margin-inline-start: 6px; }

/* شريط المختار */
.gak-selbar { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; margin-inline: auto; width: max-content; z-index: 1040; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 18px; background: #141414; color: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); max-width: calc(100vw - 24px); animation: gakUp .2s ease both; }
.gak-selbar .btn { white-space: nowrap; }
body.gak-has-sel .gs-content { padding-bottom: 110px; }
[dir=rtl] .gak-selbar { padding: 10px 18px 10px 12px; }
.gak-selbar[hidden] { display: none; }
.gak-sel-n { font-weight: 700; white-space: nowrap; }
.gak-sel-n b { font-size: 17px; }
.gak-sel-acts { display: flex; gap: 6px; }
.gak-selbar .btn-light { background: rgba(255, 255, 255, .12); color: #fff; border: 0; }
.gak-selbar .btn-light:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.gak-selbar .btn-primary, .gak-selbar .btn-primary:hover, .gak-selbar .btn-primary:focus { background: #fff !important; color: #141414 !important; border: 0 !important; font-weight: 800; }
.gak-selbar .btn:disabled { opacity: .4; }

/* التحضير */
.gak-busy { position: fixed; inset: 0; z-index: 2000; background: rgba(15, 16, 18, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.gak-busy[hidden] { display: none; }
.gak-busy-card { width: 100%; max-width: 340px; background: #fff; border-radius: 20px; padding: 26px 22px 18px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gak-busy-card > .fa { font-size: 34px; color: var(--gs-red, #d53c41); }
.gak-busy-card b { font-size: 16px; }
.gak-busy-card small { color: var(--gs-muted, #8b9098); font-variant-numeric: tabular-nums; min-height: 18px; }
.gak-prog { width: 100%; height: 8px; border-radius: 99px; background: #f0f1f3; overflow: hidden; }
.gak-prog span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gs-red, #d53c41), #ff7a59); border-radius: 99px; transition: width .2s ease; }

.gak-toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 2100; background: #141414; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); transition: opacity .3s ease; max-width: calc(100vw - 32px); }
.gak-toast .fa { color: #22c55e; margin-inline-end: 4px; }
.gak-toast.is-out { opacity: 0; }

@keyframes gakSkel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes gakIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes gakUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* [آيباد + موبايل] الشريط سطرين ، وشريط الصفحات اللي تحت بيختفي وانت بتختار (زي اختيار الصور في الموبايل) */
@media (max-width: 991.98px) {
    .gak-selbar, [dir=rtl] .gak-selbar { width: min(560px, calc(100vw - 24px)); flex-wrap: wrap; justify-content: space-between; gap: 10px 8px; padding: 10px 12px 12px; border-radius: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
    .gak-sel-acts { width: 100%; }
    .gak-sel-acts .btn { flex: 1 1 0; min-width: 0; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
    body.gak-has-sel .gs-bottom-nav { transform: translateY(110%); }
    body.gak-has-sel .gs-content { padding-bottom: 150px; }
}

@media (max-width: 767px) {
    .gak-hero { flex-wrap: wrap; padding: 18px !important; }
    .gak-hero .gak-btn { width: 100%; }
    .gak-batches { grid-template-columns: minmax(0, 1fr); }
    .gak-keys { padding: 14px !important; }
    .gak-keys-head .gs-seg { width: 100%; display: flex; overflow-x: auto; }
    .gak-keys-head .gs-seg button { flex: 1 0 auto; }
    .gak-tools { flex-direction: column; align-items: stretch; }
    .gak-pick .btn { flex: 1 1 auto; }
    .gak-tools > * { min-width: 0; width: 100%; }
    .gak-range { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
    .gak-range .form-control { width: 100%; min-width: 0; }
    .gak-range .btn { grid-column: 1 / -1; }
    .gak-opts .gs-seg { width: auto; min-width: 0; flex: 1 1 auto; display: flex; }
    .gak-opts .gs-seg button { flex: 1 1 0; min-width: 0; }
    .gak-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .gak-qr { padding: 12px 6px 8px; }
    .gak-pager { justify-content: center; }
    .gak-pager-info, .gak-pager-size { width: 100%; text-align: center; }
    .gak-sel-acts #gakUnmark { flex: 0 0 46px; }
    .gak-hide-xs { display: none; }
}

/* [الرصيد] مستخدم / اتطبع / متاح — شريط مقسوم + كارت الرصيد فوق */
.gak-stack { display: flex; height: 8px; border-radius: 99px; background: #f0f1f3; overflow: hidden; gap: 2px; }
.gak-stack.is-big { height: 12px; margin-top: 14px; }
.gak-stack i { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.gak-stack i:empty[style*="width:0%"] { display: none; }
.gak-stack .is-used, .gak-legend .is-used, .gak-bal-n.is-used .gak-bal-ic { background: #16a34a; }
.gak-stack .is-printed, .gak-legend .is-printed, .gak-bal-n.is-printed .gak-bal-ic { background: #94a3b8; }
.gak-stack .is-free, .gak-legend .is-free, .gak-bal-n.is-free .gak-bal-ic { background: var(--gs-red, #d53c41); }
.gak-batch-st b { color: var(--gs-red, #d53c41); }
.gak-batch.is-done .gak-batch-st { color: #16a34a; }
.gak-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; font-weight: 600; color: var(--gs-muted, #6b7280); }
.gak-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.gak-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.gak-bal { margin-top: 14px; padding: 18px 20px !important; }
.gak-bal[hidden] { display: none; }
.gak-bal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gak-bal-h h4 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.gak-bal-h p { margin: 0; font-size: 12.5px; color: var(--gs-muted, #6b7280); max-width: 640px; line-height: 1.6; }
.gak-bal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gak-bal-n { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--gs-bg, #f7f8fa); min-width: 0; }
.gak-bal-ic { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #141414; font-size: 16px; }
.gak-bal-n > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.gak-bal-n small { font-size: 12px; font-weight: 700; color: var(--gs-muted, #6b7280); line-height: 1.35; }
.gak-bal-n b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; }
.gak-bal-n em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--gs-muted, #8b9098); }
.gak-bal-n.is-free { background: var(--gs-red-soft, #fbeced); }
.gak-bal-n.is-free b { color: var(--gs-red-dark, #b52f34); }
.gak-bal-out { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff6ed; color: #b54708; font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; }
@media (max-width: 991.98px) { .gak-bal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .gak-bal { padding: 14px !important; } .gak-bal-h .gak-btn { width: 100%; justify-content: center; } .gak-bal-n { flex-direction: column; align-items: flex-start; padding: 10px 12px; gap: 8px; } .gak-bal-ic { width: 30px; height: 30px; border-radius: 10px; font-size: 13px; } .gak-bal-n b { font-size: 19px; } }

/* [بتصميم الجيم] المعاينة بنفس شكل الصورة اللي هتتنزل */
.gak-grid.is-brand { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.gak-grid.is-brand .gak-qr { padding-top: 12px; }
.gak-grid.is-brand .gak-qr-code { min-height: 0; padding: 0 6px; }
.gak-thumb { display: block; width: 100%; max-width: 190px; aspect-ratio: 4 / 5; border-radius: 12px; box-shadow: 0 10px 22px -12px rgba(16, 24, 40, .45); margin: 0 auto; object-fit: cover; }
.gak-thumb.is-skel { background: linear-gradient(90deg, #f0f1f3 25%, #e6e8eb 37%, #f0f1f3 63%); background-size: 400% 100%; animation: gakSkel 1.2s ease infinite; box-shadow: none; }
.gak-grid.is-brand .gak-qr.is-printed .gak-qr-code { opacity: .5; }
@media (max-width: 575.98px) {
    .gak-grid.is-brand { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .gak-grid.is-brand .gak-qr { padding: 10px 6px 8px; }
    .gak-grid.is-brand .gak-qr-code { padding: 0 2px; }
}
.gak-btn.is-off { opacity: .55; }
