/* أقساط الرافدين — GN Installments */

.gni-mount[hidden],
.gni-slot[hidden],
.gni-box [hidden] { display: none !important; }

.gni-mount,
.gni-slot { margin: 12px 0; clear: both; }

.gni-box {
    --gni-accent: #15803d;
    --gni-accent-soft: #f0fdf4;
    --gni-border: #e2e8f0;
    --gni-text: #0f172a;
    --gni-muted: #64748b;
    direction: rtl;
    text-align: right;
    display: grid;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gni-text);
    max-width: 480px;
    box-sizing: border-box;
}
.gni-box *,
.gni-box *::before,
.gni-box *::after { box-sizing: border-box; }

.gni-opt {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 10px 12px;
    border: 1.5px solid var(--gni-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
    font-weight: 400;
    width: 100%;
}
.gni-opt:hover { border-color: #cbd5e1; }

.gni-opt input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.gni-dot {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    transition: border-color .15s;
}
.gni-dot::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--gni-accent);
    transform: scale(0);
    transition: transform .15s;
}

.gni-opt input:checked + .gni-dot { border-color: var(--gni-accent); }
.gni-opt input:checked + .gni-dot::after { transform: scale(1); }
/* gni-on يضعه الـ JS على الحاوية (بديل :has للمتصفحات القديمة) */
:not(.gni-on) > .gni-box .gni-opt-cash,
.gni-on > .gni-box .gni-opt-inst {
    border-color: var(--gni-accent);
    background: var(--gni-accent-soft);
}
.gni-opt input:focus-visible + .gni-dot {
    outline: 2px solid var(--gni-accent);
    outline-offset: 2px;
}

.gni-opt-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.gni-opt-title { font-weight: 700; }
.gni-teaser {
    font-size: 12.5px;
    color: var(--gni-accent);
    font-weight: 600;
}

.gni-card {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
}
.gni-card img {
    width: 64px !important;
    height: auto !important;
    max-width: none !important;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    margin: 0 !important;
}

.gni-details {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--gni-accent-soft);
    border: 1px dashed #86efac;
    color: #14532d;
}
.gni-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 3px 0;
}
.gni-row > span { flex: 0 0 auto; }
.gni-row b { font-weight: 700; text-align: left; min-width: 0; }
.gni-row-total b { white-space: nowrap; }
.gni-row-total b { font-size: 15.5px; color: var(--gni-accent); }
.gni-note {
    margin: 6px 0 0 !important;
    padding: 0 !important;
    font-size: 12px;
    color: var(--gni-muted);
}

/* داخل صناديق الباني الداكنة */
.gni-slot .gni-box { max-width: none; }

@media (max-width: 420px) {
    .gni-opt { padding: 9px 10px; gap: 8px; }
    .gni-card img { width: 52px !important; }
    .gni-box { font-size: 13.5px; }
}

/* ── وضع المعلومة: صندوق واحد بلا أزرار اختيار ────────────────── */
.gni-box--info {
    gap: 0;
    border: 1.5px solid var(--gni-accent);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.gni-info-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--gni-accent-soft);
}
.gni-box--info .gni-details {
    border: 0;
    border-radius: 0;
    background: #fff;
    border-top: 1px dashed #86efac;
}
.gni-box--info .gni-opt-title { color: var(--gni-accent); }
.gni-cta   { color: #334155 !important; }
.gni-terms { color: var(--gni-muted); }

/* ── زر «أضف التقسيط إلى الفاتورة» في شريط أدوات الفاتورة ───────── */
.gni-inv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1.5px solid var(--gni-accent, #15803d);
    border-radius: 9px;
    background: #f0fdf4;
    color: #15803d;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.gni-inv-btn:hover { background: #dcfce7; }
.gni-inv-btn.is-on { background: #15803d; color: #fff; }

/* ── تبويب المصارف وجدول المدد ───────────────────────────────── */
.gni-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.gni-tab {
    font: 600 12px/1 inherit;
    color: var(--gni-muted);
    background: var(--gni-chip, #fff);
    border: 1.5px solid var(--gni-border);
    border-radius: 999px;
    padding: 6px 11px;
    cursor: pointer;
}
.gni-tab:hover { color: var(--gni-text); border-color: var(--gni-accent); }
.gni-tab.is-on {
    background: var(--gni-accent);
    border-color: var(--gni-accent);
    color: #fff;
}

.gni-table { display: grid; gap: 2px; }
.gni-row {
    display: grid;
    grid-template-columns: minmax(72px, .95fr) minmax(0, 1fr) minmax(0, 1.05fr);
    font-variant-numeric: tabular-nums;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 9px;
    background: #fff;
    border: 1.5px solid transparent;
    font-size: 13px;
    text-align: right;
    width: 100%;
    font-family: inherit;
    color: var(--gni-text);
}
.gni-row.gni-head {
    background: transparent;
    font-size: 11.5px;
    color: var(--gni-muted);
    padding-bottom: 2px;
    letter-spacing: .02em;
}
button.gni-row { cursor: pointer; }
button.gni-row:hover { border-color: var(--gni-accent); }
button.gni-row.is-on { border-color: var(--gni-accent); background: var(--gni-accent-soft); }
.gni-c1 { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gni-c2 { font-weight: 700; color: var(--gni-accent); white-space: nowrap; overflow-wrap: anywhere; }
.gni-c3 { font-weight: 800; text-align: left; white-space: nowrap; }
.gni-best {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
    border-radius: 999px;
    padding: 2px 7px;
}
.gni-box--info .gni-details > .gni-panel:first-child { margin-bottom: 8px; }

@media (max-width: 420px) {
    .gni-row { grid-template-columns: minmax(58px, .8fr) minmax(0, 1fr) minmax(0, 1.05fr); font-size: 12px; padding: 7px 6px; gap: 5px; }
    .gni-c1 { font-size: 12px; }
    .gni-tab { padding: 6px 10px; font-size: 12px; }
}
