/* ==========================================================================
   قاعدة البيانات الانتخابية — نادي الجزيرة
   تصميم عربي RTL، مع أنماط طباعة مخصصة
   ========================================================================== */

:root {
    --bg:            #f4f6f9;
    --surface:       #ffffff;
    --surface-2:     #fafbfd;
    --border:        #e2e7ee;
    --border-strong: #cbd3df;

    --ink:           #16202e;
    --ink-2:         #4a5768;
    --ink-3:         #7c8798;

    --brand:         #0d5c46;
    --brand-2:       #128063;
    --brand-soft:    #e6f3ef;
    --accent:        #b8860b;
    --accent-soft:   #fdf6e3;

    --danger:        #b3261e;
    --danger-soft:   #fdeceb;
    --ok:            #1c7c3f;
    --ok-soft:       #e8f5ec;
    --info:          #1a5fa8;
    --info-soft:     #e8f1fb;

    --radius:        10px;
    --radius-sm:     6px;
    --shadow:        0 1px 2px rgba(16, 24, 40, .05), 0 4px 12px rgba(16, 24, 40, .06);
    --shadow-sm:     0 1px 2px rgba(16, 24, 40, .06);

    --font: "SF Arabic", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", "Dubai",
            "Tahoma", "Arial", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    direction: rtl;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.35; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

/* ------------------------------------------------------------------ الهيكل */

.topbar {
    background: linear-gradient(180deg, var(--brand) 0%, #0a4c3a 100%);
    color: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-inner {
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 58px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.06rem;
    color: #fff;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,.16);
    display: grid; place-items: center;
    font-size: 15px;
}

.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-inline-start: auto; }
.nav a {
    color: rgba(255,255,255,.86);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: .93rem;
    white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }

/* قائمة المستخدم في الشريط العلوي */
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-menu .who {
    display: inline-flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.9);
    padding: 5px 10px; border-radius: var(--radius-sm);
    font-size: .88rem;
}
.user-menu .who:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.user-menu .avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: grid; place-items: center;
    font-weight: 700; font-size: .82rem;
}
.user-menu .badge.brand { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.user-menu .out {
    color: rgba(255,255,255,.8);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: var(--radius-sm);
    padding: 5px 11px; font-size: .85rem;
}
.user-menu .out:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }

.page { max-width: 1560px; margin: 0 auto; padding: 20px 18px 60px; }

/* ------------------------------------------------------------ تسجيل الدخول */

.auth-body {
    min-height: 100vh;
    display: grid; place-items: center;
    background:
        radial-gradient(1100px 520px at 80% -10%, rgba(255, 255, 255, .10) 0%, transparent 60%),
        linear-gradient(160deg, #0d5c46 0%, #0a4335 45%, #0f2e28 100%);
    padding: 24px;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 26px 24px 20px;
    box-shadow: 0 18px 44px rgba(4, 26, 20, .34);
}
.auth-card.wide { max-width: 460px; }
.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-head .brand-mark {
    width: 42px; height: 42px; flex: 0 0 auto;
    border-radius: 11px;
    background: var(--brand-soft); color: var(--brand);
    display: grid; place-items: center; font-size: 19px;
}
.auth-head h1 { font-size: 1.12rem; margin: 0; }
.auth-head p { margin: 0; font-size: .84rem; color: var(--ink-3); }
.auth-card .field { margin-bottom: 13px; }
.auth-card .field label { font-size: .84rem; margin-bottom: 3px; }
.auth-card input { padding: 9px 11px; font-size: .95rem; }
.auth-submit { width: 100%; justify-content: center; padding: 10px; font-size: .96rem; margin-top: 4px; }
.auth-note { font-size: .78rem; color: var(--ink-3); margin: 14px 0 0; line-height: 1.6; }

.page-head {
    display: flex; align-items: flex-end; gap: 16px;
    flex-wrap: wrap; margin-bottom: 16px;
}
.page-head .sub { color: var(--ink-3); font-size: .9rem; margin: 0; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ بطاقات */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .actions { margin-inline-start: auto; display: flex; gap: 6px; }
.card-body { padding: 16px; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1100px) { .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2,minmax(0,1fr)); } .grid.cols-3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 720px)  { .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: 1fr; } }

/* الإحصاءات */
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.stat .label { color: var(--ink-3); font-size: .82rem; }
.stat .value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.stat .hint  { font-size: .78rem; color: var(--ink-3); }
.stat.brand  { background: var(--brand-soft); border-color: #cbe5dc; }
.stat.brand .value { color: var(--brand); }

/* ------------------------------------------------------------------ الفلاتر */

.filters { padding: 14px 16px; }
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 10px 12px;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: .78rem; color: var(--ink-2); font-weight: 600; }

input[type=text], input[type=number], input[type=search], select, textarea {
    font-family: inherit;
    font-size: .92rem;
    padding: 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    width: 100%;
    min-width: 0;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(18,128,99,.25);
    border-color: var(--brand-2);
}

.checks { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--ink-2); cursor: pointer; }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: .9rem; font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: #fff; color: var(--ink);
    cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 4px 9px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------------ الجداول */

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
table.data th, table.data td {
    padding: 8px 10px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data thead th {
    background: var(--surface-2);
    font-size: .8rem;
    font-weight: 700;
    color: var(--ink-2);
    white-space: nowrap;
    /* الالتصاق نسبة إلى حاوية التمرير (.table-wrap) وليس النافذة،
       لذلك يجب أن يكون top = 0 وإلا غطى الصف الأول. */
    position: sticky; top: 0; z-index: 5;
    border-bottom: 1px solid var(--border-strong);
}
table.data tbody tr:hover { background: #f7fafc; }
table.data td.num { font-variant-numeric: tabular-nums; }
table.data .muted { color: var(--ink-3); }

.thumb {
    width: 42px; height: 52px;
    object-fit: cover;
    border-radius: 5px;
    background: #eef1f5;
    border: 1px solid var(--border);
    display: block;
}
.thumb.lg { width: 96px; height: 118px; }
.thumb.xl { width: 132px; height: 164px; }
.thumb-ph {
    display: grid; place-items: center;
    color: var(--ink-3); font-size: .7rem;
}

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--ink-2);
    white-space: nowrap;
}
.badge.ok     { background: var(--ok-soft);     border-color: #c6e6d1; color: var(--ok); }
.badge.warn   { background: var(--accent-soft); border-color: #efe0b8; color: #8a6508; }
.badge.danger { background: var(--danger-soft); border-color: #f3cfcd; color: var(--danger); }
.badge.info   { background: var(--info-soft);   border-color: #cbdff5; color: var(--info); }
.badge.brand  { background: var(--brand-soft);  border-color: #cbe5dc; color: var(--brand); }

.score {
    display: inline-block;
    min-width: 34px; text-align: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid #cbe5dc;
}
.score.t1 { background: #0d5c46; color: #fff; border-color: #0d5c46; }
.score.t2 { background: #2e8b6d; color: #fff; border-color: #2e8b6d; }
.score.t3 { background: #b9e2d5; color: #0d5c46; border-color: #a3d6c5; }

.rank-1 { color: var(--accent); font-weight: 700; }

/* ------------------------------------------------------------------ الترقيم */

.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; }
.pager .info { color: var(--ink-3); font-size: .86rem; }
.pager .links { margin-inline-start: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.pager .links a, .pager .links span {
    padding: 4px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: #fff; font-size: .85rem;
}
.pager .links .cur { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }

/* ------------------------------------------------------------------ البروفيل */

.profile-head {
    display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
}
.profile-head .photo { flex: 0 0 auto; }
.profile-head .info { flex: 1 1 320px; min-width: 0; }
.profile-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.profile-meta { color: var(--ink-3); font-size: .9rem; }

dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 10px 18px; margin: 0; }
dl.facts > div { min-width: 0; }
dl.facts dt { font-size: .75rem; color: var(--ink-3); font-weight: 600; }
dl.facts dd { margin: 0; font-size: .93rem; word-break: break-word; }

/* شجرة العلاقات */
.tree-group { margin-bottom: 18px; }
.tree-group > h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: .95rem; color: var(--ink-2);
    padding-bottom: 6px; margin-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}
.person {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: inherit;
}
.person:hover { border-color: var(--brand-2); background: var(--brand-soft); text-decoration: none; }
.person .nm { font-weight: 600; font-size: .88rem; line-height: 1.35; }
.person .mt { font-size: .74rem; color: var(--ink-3); }
.person.nonmember { background: var(--surface-2); border-style: dashed; }

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); }

/* ------------------------------------------------------------------ رسائل */

.alert {
    padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-2);
    font-size: .9rem; margin-bottom: 14px;
}
.alert.ok     { background: var(--ok-soft);     border-color: #c6e6d1; }
.alert.danger { background: var(--danger-soft); border-color: #f3cfcd; }
.alert.info   { background: var(--info-soft);   border-color: #cbdff5; }

.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }

.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-muted { color: var(--ink-3); }
.small { font-size: .82rem; }

/* شريط التحديد العائم */
.selbar {
    position: fixed; inset-inline: 0; bottom: 0;
    background: var(--ink); color: #fff;
    padding: 10px 18px;
    display: none; align-items: center; gap: 12px;
    box-shadow: 0 -2px 14px rgba(0,0,0,.18);
    z-index: 60;
}
.selbar.on { display: flex; }
.selbar .count { font-weight: 700; }
.selbar .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.24); color: #fff; }
.selbar .btn:hover { background: rgba(255,255,255,.24); }

/* ==========================================================================
   الطباعة
   ========================================================================== */

.print-toolbar {
    background: var(--ink); color: #fff;
    padding: 10px 18px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 20;
}
.print-toolbar .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.print-toolbar .spacer { margin-inline-start: auto; }

.sheet { background: #fff; margin: 0 auto; }

/* بروفيل كامل في صفحة */
.p-profile {
    padding: 12mm 10mm;
    border-bottom: 1px dashed #ccc;
    page-break-after: always;
    break-after: page;
}
.p-profile:last-child { page-break-after: auto; break-after: auto; border-bottom: 0; }

.p-head { display: flex; gap: 14px; align-items: flex-start; border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 10px; }
.p-head .ph img, .p-head .ph .thumb-ph { width: 30mm; height: 38mm; object-fit: cover; border: 1px solid #bbb; border-radius: 3px; }
.p-head .t { flex: 1; }
.p-head .t .nm { font-size: 16pt; font-weight: 700; }
.p-head .t .sub { font-size: 9pt; color: #555; }
.p-head .no { font-size: 12pt; font-weight: 700; color: var(--brand); text-align: left; }

.p-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; font-size: 9.5pt; }
.p-grid .k { color: #666; font-size: 8pt; }
.p-grid .v { font-weight: 600; }

.p-sec { margin-top: 8px; }
.p-sec > h4 { font-size: 10pt; margin: 0 0 4px; padding-bottom: 2px; border-bottom: 1px solid #ddd; color: var(--brand); }

.p-people { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.p-person { display: flex; gap: 6px; align-items: center; border: 1px solid #ddd; border-radius: 3px; padding: 4px; font-size: 8.5pt; }
.p-person img, .p-person .thumb-ph { width: 12mm; height: 15mm; object-fit: cover; border-radius: 2px; background: #eee; }

/* خمسة في الصفحة كصفوف */
.p-rows { padding: 10mm 8mm; }
.p-row {
    display: flex; gap: 10px; align-items: stretch;
    border: 1px solid #ccc; border-radius: 4px;
    padding: 6px 8px; margin-bottom: 6px;
    page-break-inside: avoid; break-inside: avoid;
    min-height: 34mm;
}
.p-row .ph img, .p-row .ph .thumb-ph { width: 24mm; height: 30mm; object-fit: cover; border: 1px solid #bbb; border-radius: 3px; background: #eee; }
.p-row .body { flex: 1; min-width: 0; }
.p-row .nm { font-size: 12pt; font-weight: 700; }
.p-row .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px 12px; font-size: 8.5pt; margin-top: 3px; }
.p-row .kv b { color: #555; font-weight: 600; }
.p-row .side { width: 30mm; border-inline-start: 1px solid #ddd; padding-inline-start: 8px; font-size: 8pt; }
.p-row .side .big { font-size: 15pt; font-weight: 700; color: var(--brand); line-height: 1; }

.p-pagebreak { page-break-after: always; break-after: page; }

.p-header-strip {
    display: flex; align-items: baseline; gap: 10px;
    border-bottom: 2px solid var(--brand); padding-bottom: 4px; margin-bottom: 8px;
    font-size: 9pt;
}
.p-header-strip .ttl { font-size: 12pt; font-weight: 700; color: var(--brand); }
.p-header-strip .sp { margin-inline-start: auto; color: #666; }

@page { size: A4; margin: 10mm; }

@media print {
    body { background: #fff; font-size: 10pt; }
    .topbar, .print-toolbar, .filters, .pager, .selbar, .no-print { display: none !important; }
    .page { padding: 0; max-width: none; }
    .card { border: 0; box-shadow: none; }
    a { color: inherit; text-decoration: none; }
    .p-profile { border-bottom: 0; padding: 0 0 6mm; }
    .p-rows { padding: 0; }
    .p-row { border-color: #999; }
    table.data thead th { position: static; }
}

/* ==================================================== تفسير الأرقام (تفاصيل) */

.numwrap { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.numwrap .num-val { font-variant-numeric: tabular-nums; }
.numwrap .num-unit { font-size: .78em; color: var(--ink-3); font-weight: 400; }

.why {
    appearance: none; border: 1px solid var(--border);
    background: transparent; color: var(--ink-3);
    font: inherit; font-size: .68rem; line-height: 1;
    padding: 3px 6px; border-radius: 999px;
    cursor: pointer; white-space: nowrap;
    transition: all .12s ease;
}
.why:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.why:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.stat .why { border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.85); }
.stat.brand .why:hover { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }

/* اللوح الجانبي */
.ex-backdrop {
    position: fixed; inset: 0; background: rgba(10, 30, 24, .38);
    opacity: 0; pointer-events: none; transition: opacity .16s ease; z-index: 60;
}
.ex-backdrop.on { opacity: 1; pointer-events: auto; }

.ex-panel {
    position: fixed; inset-block: 0; inset-inline-end: 0;
    width: min(560px, 94vw);
    background: var(--surface);
    box-shadow: -12px 0 40px rgba(6, 30, 22, .22);
    transform: translateX(-100%);
    transition: transform .2s cubic-bezier(.4, 0, .2, 1);
    z-index: 61; display: flex; flex-direction: column;
}
.ex-panel.on { transform: translateX(0); }

.ex-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    background: var(--surface-2); flex: 0 0 auto;
}
.ex-bar strong { font-size: .9rem; }
.ex-close {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    font-size: 1.25rem; line-height: 1; color: var(--ink-3); padding: 4px 8px; border-radius: 6px;
}
.ex-close:hover { background: var(--border); color: var(--ink); }

.ex-body { overflow-y: auto; padding: 16px; flex: 1 1 auto; }
.ex-loading, .ex-empty { padding: 30px; text-align: center; color: var(--ink-3); font-size: .9rem; }

.ex-head { margin-bottom: 14px; }
.ex-title { font-size: 1rem; font-weight: 700; }
.ex-sub { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.ex-value {
    font-size: 2rem; font-weight: 700; color: var(--brand);
    margin-top: 8px; font-variant-numeric: tabular-nums;
}
.ex-value .ex-unit { font-size: .9rem; font-weight: 500; color: var(--ink-3); }

.ex-label {
    display: block; font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--ink-3); margin-bottom: 5px;
}
.ex-formula {
    background: var(--brand-soft); border-inline-start: 3px solid var(--brand);
    padding: 10px 12px; border-radius: 8px; font-size: .85rem;
    line-height: 1.7; margin-bottom: 14px;
}

.ex-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.ex-fact {
    background: var(--surface-2); border-radius: 8px; padding: 8px 10px;
}
.ex-fact .k { display: block; font-size: .72rem; color: var(--ink-3); }
.ex-fact .v { display: block; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ex-fact .h { display: block; font-size: .68rem; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }

.ex-table-wrap { overflow-x: auto; margin-bottom: 14px; }
.ex-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ex-table th {
    text-align: start; font-size: .7rem; font-weight: 700; color: var(--ink-3);
    padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ex-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ex-table td.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-table td.dim { color: var(--ink-3); font-size: .78rem; }
.ex-table tr.strong td { font-weight: 700; border-top: 2px solid var(--border); background: var(--surface-2); }
.ex-detail { display: block; font-size: .72rem; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }

.ex-block { margin-bottom: 14px; }
.ex-block.warn .ex-list { border-inline-start-color: var(--accent); }
.ex-list {
    margin: 0; padding: 0 0 0 0; list-style: none;
    border-inline-start: 3px solid var(--border); padding-inline-start: 12px;
}
.ex-list li { font-size: .82rem; line-height: 1.7; color: var(--ink-2); margin-bottom: 6px; }
.ex-list li:last-child { margin-bottom: 0; }
.ex-links { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }

/* ============================================================ مساحة المرشح */

.subnav {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.subnav a {
    padding: 8px 14px; font-size: .88rem; color: var(--ink-2);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav a:hover { color: var(--brand); text-decoration: none; }
.subnav a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.tier { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.tier-rate { font-size: .68rem; opacity: .75; font-variant-numeric: tabular-nums; }
.tier-anchor    { background: #0d5c46; color: #fff; }
.tier-committed { background: #d8efe5; color: #0a4a38; }
.tier-leaning   { background: #fdf0d5; color: #7a5310; }
.tier-acq       { background: var(--surface-2); color: var(--ink-3); }

.tier-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tier-filter a {
    padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px;
    font-size: .85rem; color: var(--ink-2); background: var(--surface);
}
.tier-filter a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.tier-filter a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tier-filter a span { opacity: .7; font-size: .78rem; margin-inline-start: 3px; }

.tier-pick { margin: 0; }
.tier-pick select { width: 100%; min-width: 150px; font-size: .82rem; padding: 5px 8px; }
tr.is-marked { background: var(--brand-soft); }

.scenario-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    appearance: none; border: 1px solid var(--border); background: var(--surface);
    border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .78rem;
    cursor: pointer; color: var(--ink-2);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip span { font-weight: 700; font-variant-numeric: tabular-nums; }

.tier-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.tier-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.tier-card .tc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.tier-card .tc-name { font-weight: 700; font-size: .95rem; }
.tier-card .tc-rate { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tier-card p { font-size: .82rem; line-height: 1.7; color: var(--ink-2); margin: 0 0 10px; }
.tier-card .tc-foot { font-size: .74rem; color: var(--ink-3); border-top: 1px solid var(--border); padding-top: 8px; }
.tier-card.tier-anchor { border-color: #0d5c46; }
.tier-card.tier-anchor .tc-rate { color: #0d5c46; }
.tier-card.tier-committed .tc-rate { color: #0a6b4f; }
.tier-card.tier-leaning .tc-rate { color: #a0730f; }
.tier-card.tier-acq .tc-rate { color: var(--ink-3); }

/* التقرير */
.report-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; margin-bottom: 18px; background: var(--surface);
}
.report-head h2 { margin: 0; font-size: 1.15rem; }
.report-head .sub { font-size: .85rem; color: var(--ink-3); margin-top: 2px; }
.report-meta { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--ink-3); text-align: end; }

.rep-section { margin-bottom: 26px; }
.rep-section h3 {
    display: flex; align-items: center; gap: 9px;
    font-size: 1.02rem; margin: 0 0 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.rep-n {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 25px; height: 25px; border-radius: 50%;
    background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700;
}
.rep-text { font-size: .92rem; line-height: 1.9; color: var(--ink-2); margin: 0 0 12px; }
.rep-note {
    background: var(--surface-2); border-radius: 8px; padding: 11px 13px;
    font-size: .82rem; line-height: 1.8; color: var(--ink-2); margin-top: 12px;
}
tr.row-current { background: var(--brand-soft); }
tr.row-total td { font-weight: 700; border-top: 2px solid var(--border); background: var(--surface-2); }

.bar { display: inline-block; width: 54px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-inline-end: 5px; }
.bar span { display: block; height: 100%; background: var(--brand); }

@media print {
    .subnav, .why, .head-actions, .tier-filter { display: none !important; }
    .rep-section { break-inside: avoid; }
    .report-head { break-after: avoid; }
}

/* ------------------------------------------- شبكة اختيار المعارف بالصور */

.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 12px; padding: 14px 16px;
}

.pick-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); overflow: hidden;
    display: flex; flex-direction: column;
    transition: box-shadow .14s ease, border-color .14s ease;
}
.pick-card:hover { box-shadow: var(--shadow); }
.pick-card.picked { border-width: 2px; }
.pick-card.picked-anchor    { border-color: #0d5c46; }
.pick-card.picked-committed { border-color: #4aa383; }
.pick-card.picked-leaning   { border-color: #d9a63a; }
.pick-card.picked-acq       { border-color: var(--border-strong); }

.pick-photo { position: relative; display: block; background: var(--surface-2); }
.pick-photo:hover { text-decoration: none; }
.pick-img {
    width: 100%; height: 168px; object-fit: cover; object-position: center top;
    display: block; background: var(--surface-2);
}
.pick-img.thumb-ph {
    display: grid; place-items: center;
    color: var(--ink-3); font-size: .78rem; height: 168px;
}
.pick-flag {
    position: absolute; inset-block-start: 7px; inset-inline-start: 7px;
    background: rgba(13, 92, 70, .93); color: #fff;
    font-size: .68rem; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
}

.pick-body { padding: 9px 11px 6px; flex: 1 1 auto; }
.pick-name { font-weight: 600; font-size: .9rem; line-height: 1.4; display: block; color: var(--ink); }
.pick-name:hover { color: var(--brand-2); }
.pick-meta {
    display: flex; gap: 6px; flex-wrap: wrap;
    font-size: .72rem; color: var(--ink-3); margin-top: 3px;
}
.pick-meta span::after { content: "·"; margin-inline-start: 6px; opacity: .5; }
.pick-meta span:last-child::after { content: ""; }
.pick-meta .bad { color: var(--danger); font-weight: 600; }
.pick-stats {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: .72rem; color: var(--ink-2);
    margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border);
}
.pick-stats .numwrap { gap: 3px; }
.pick-stats .num-val { font-weight: 700; }
.pick-stats .why { font-size: .6rem; padding: 2px 5px; }

.pick-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--border); }
.pick-tiers:has(.tbtn-off) { grid-template-columns: repeat(4, 1fr) 34px; }

.tbtn {
    appearance: none; border: 0; border-inline-start: 1px solid var(--border);
    background: var(--surface); cursor: pointer;
    font: inherit; font-size: .68rem; font-weight: 600; color: var(--ink-3);
    padding: 7px 2px; line-height: 1.25;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    transition: background .12s ease, color .12s ease;
}
.tbtn:first-child { border-inline-start: 0; }
.tbtn em { font-style: normal; font-size: .6rem; opacity: .65; font-variant-numeric: tabular-nums; }
.tbtn:hover { background: var(--surface-2); color: var(--ink); }

.tbtn-anchor.on    { background: #0d5c46; color: #fff; }
.tbtn-committed.on { background: #d8efe5; color: #0a4a38; }
.tbtn-leaning.on   { background: #fdf0d5; color: #7a5310; }
.tbtn-acq.on       { background: var(--border); color: var(--ink); }
.tbtn.on em { opacity: .8; }
.tbtn-off { color: var(--danger); font-size: .8rem; }
.tbtn-off:hover { background: var(--danger-soft); }

@media (max-width: 560px) {
    .pick-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .pick-img, .pick-img.thumb-ph { height: 138px; }
}

/* -------------------------------------------------- الشجرة الموسعة */

.depth-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.db-item {
    display: flex; align-items: baseline; gap: 7px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 999px; padding: 5px 12px; font-size: .76rem;
}
.db-item .db-lvl { font-weight: 700; color: var(--brand); }
.db-item .db-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.db-item .db-v { color: var(--ink-2); }
.db-item .db-e { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.db-item .db-w { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.branch-root, .br-kids { list-style: none; margin: 0; padding: 0; }
.branch-root { padding-inline-start: 2px; }

.br-kids {
    padding-inline-start: 22px;
    margin-inline-start: 13px;
    border-inline-start: 2px solid var(--border);
}

.br { position: relative; padding: 3px 0; }

/* وصلة أفقية من خط الأب إلى العقدة */
.br-kids > .br::before {
    content: "";
    position: absolute;
    inset-inline-start: -22px;
    top: 26px;
    width: 20px; height: 2px;
    background: var(--border);
}

.br-node {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px 6px 6px;
    background: var(--surface);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.br-node:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.br-node.is-voter { border-inline-start: 3px solid var(--ok); }
.br-node.no-voter { border-inline-start: 3px solid var(--border-strong); opacity: .82; }

.br-photo { flex: 0 0 auto; line-height: 0; }
.br-img {
    width: 38px; height: 46px; object-fit: cover; object-position: center top;
    border-radius: 5px; background: var(--surface-2); display: block;
}
.br-img.thumb-ph {
    display: grid; place-items: center;
    font-size: .52rem; color: var(--ink-3); text-align: center; line-height: 1.1;
}

.br-body { min-width: 0; flex: 1 1 auto; }
.br-name { font-weight: 600; font-size: .88rem; color: var(--ink); display: block; }
.br-name:hover { color: var(--brand-2); }
.br-rel {
    font-size: .74rem; color: var(--brand); direction: rtl;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 460px;
}
.br-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; font-size: .7rem; color: var(--ink-3); margin-top: 2px; }
.br-meta .deg { background: var(--brand-soft); color: var(--brand); border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.br-meta .wt { font-variant-numeric: tabular-nums; }
.br-meta .rv { color: var(--ink-2); }
.br-meta .badge { font-size: .66rem; padding: 1px 6px; }

.br-count {
    flex: 0 0 auto; min-width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 999px; background: var(--brand-soft); color: var(--brand);
    font-size: .7rem; font-weight: 700;
}

@media print {
    .br-kids { page-break-inside: auto; }
    .br-node { break-inside: avoid; }
    .depth-bar { display: none; }
}

/* ------------------------------------------ حالات الاتصال وكشوف الزيارات */

.st { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.st-new         { background: var(--surface-2); color: var(--ink-3); }
.st-contacted   { background: var(--info-soft); color: var(--info); }
.st-promised    { background: var(--ok-soft); color: var(--ok); }
.st-undecided   { background: var(--accent-soft); color: #8a6407; }
.st-refused     { background: var(--danger-soft); color: var(--danger); }
.st-unreachable { background: var(--surface-2); color: var(--ink-3); border: 1px dashed var(--border-strong); }

.progress-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pg-item {
    flex: 1 1 130px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 12px;
}
.pg-item .k { font-size: .74rem; color: var(--ink-3); display: block; }
.pg-item .v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-item .h { font-size: .68rem; color: var(--ink-3); line-height: 1.4; display: block; }
.pg-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 6px; }
.pg-bar span { display: block; height: 100%; background: var(--brand); }

.outreach-form { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.outreach-form select { min-width: 128px; font-size: .8rem; padding: 4px 7px; }
.outreach-form input[type="date"] { font-size: .78rem; padding: 4px 6px; width: 132px; }

/* كشف الزيارات */
.sheet-body { background: var(--bg); }
.sheet-bar {
    position: sticky; top: 0; z-index: 10;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 18px;
}
.sheet-bar > div:last-child { display: flex; gap: 8px; }

.sheet { max-width: 1000px; margin: 16px auto; background: #fff; padding: 20px 22px; box-shadow: var(--shadow); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 12px; }
.sheet-head h1 { font-size: 1.25rem; margin: 0; }
.sheet-head .sub { font-size: .84rem; color: var(--ink-3); }
.sheet-meta { font-size: .78rem; color: var(--ink-2); text-align: end; line-height: 1.9; }

.sheet-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.sheet-table th {
    text-align: start; font-size: .72rem; font-weight: 700; color: var(--ink-2);
    background: var(--surface-2); border: 1px solid var(--border); padding: 5px 7px;
}
.sheet-table td { border: 1px solid var(--border); padding: 5px 7px; vertical-align: top; }
.sheet-img { width: 40px; height: 50px; object-fit: cover; object-position: center top; border-radius: 3px; background: var(--surface-2); display: block; }
.sheet-img.thumb-ph { display: grid; place-items: center; font-size: .5rem; color: var(--ink-3); text-align: center; }
.sh-name { font-weight: 700; font-size: .88rem; }
.sh-meta { font-size: .7rem; color: var(--ink-3); line-height: 1.5; }
.sh-boxes { display: flex; flex-direction: column; gap: 2px; font-size: .74rem; }
.sh-note { background: repeating-linear-gradient(transparent, transparent 17px, var(--border) 17px, var(--border) 18px); }
.sheet-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); font-size: .76rem; color: var(--ink-3); }

@media print {
    .sheet-bar { display: none !important; }
    .sheet { max-width: none; margin: 0; padding: 0; box-shadow: none; }
    .sheet-table { font-size: .74rem; }
    .sheet-table tr { break-inside: avoid; }
    .sheet-table thead { display: table-header-group; }
    @page { size: A4; margin: 10mm; }
}

/* ------------------------------------------------ مراجعة العضويات المكررة */

.dup-card { margin-bottom: 12px; }
.dup-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 820px) { .dup-body { grid-template-columns: 1fr; } }
.dup-side { padding: 12px 14px; }
.dup-side + .dup-side { border-inline-start: 1px solid var(--border); }
.dup-side.dup-dropped { background: var(--danger-soft); }
.dup-top { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 9px; }
.dup-img { width: 46px; height: 56px; object-fit: cover; object-position: center top; border-radius: 5px; background: var(--surface-2); display: block; }
.dup-img.thumb-ph { display: grid; place-items: center; font-size: .55rem; color: var(--ink-3); text-align: center; }
.dup-name { font-weight: 700; font-size: .94rem; color: var(--ink); }
.dup-name:hover { color: var(--brand-2); }
.dup-facts { font-size: .8rem; gap: 3px 10px; }
.dup-facts dt { font-size: .7rem; }
.dup-actions {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--border); padding: 10px 14px; background: var(--surface-2);
}
.dup-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ----------------------------------------------- مراجعة الأسماء الملتصقة */

/* بطاقة الاسم عمود واحد لا عمودان — الحالة شخص لا شخصان */
.dup-body:has(> .dup-side:only-child) { grid-template-columns: 1fr; }

.name-fix { margin: 10px 0 4px; display: grid; gap: 4px; }
.name-row {
    display: flex; align-items: baseline; gap: 8px;
    padding: 6px 9px; border-radius: 5px; background: var(--surface-2);
}
.name-row-new { background: var(--ok-soft, #e8f5ee); }
.name-row-warn { background: var(--accent-soft, #fdf6e0); }
.name-row-warn .name-val { font-weight: 500; color: var(--ink-2); font-size: .84rem; }
.name-form { display: flex; gap: 5px; align-items: center; }
.name-input {
    font: inherit; font-size: .86rem; padding: 5px 9px; min-width: 250px;
    border: 1px solid var(--border); border-radius: 5px; background: var(--surface);
    color: var(--ink);
}
.name-input:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
@media (max-width: 620px) { .name-input { min-width: 0; width: 100%; } .name-form { flex: 1 1 100%; } }
.name-lbl { font-size: .68rem; color: var(--ink-3); min-width: 58px; }
.name-val { font-size: .95rem; font-weight: 600; color: var(--ink); }
.name-row-new .name-val { color: var(--brand-2); }

/* ------------------------------------------------------- نطاق النظام */

.scope-bar { background: var(--accent-soft); border-bottom: 1px solid #e6d9a8; }
.scope-inner {
    max-width: 1560px; margin: 0 auto; padding: 8px 18px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.scope-tag {
    background: var(--accent); color: #fff; font-size: .74rem; font-weight: 700;
    padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.scope-hint { font-size: .76rem; color: #7a5a10; }
.scope-chip {
    background: var(--surface); border: 1px solid #e0cf95; border-radius: 999px;
    padding: 3px 6px 3px 11px; font-size: .78rem; display: inline-flex; align-items: center; gap: 6px;
}
.scope-chip b { font-weight: 600; color: var(--ink-3); }
.scope-chip a {
    color: var(--danger); font-weight: 700; line-height: 1;
    padding: 0 4px; border-radius: 50%;
}
.scope-chip a:hover { background: var(--danger-soft); text-decoration: none; }
.scope-clear {
    margin-inline-start: auto; font-size: .78rem; font-weight: 600;
    color: #7a5a10; border: 1px solid #d9c485; border-radius: var(--radius-sm); padding: 3px 11px;
}
.scope-clear:hover { background: var(--surface); text-decoration: none; }
.btn-scope { border-color: var(--accent); color: #7a5a10; }
.btn-scope:hover { background: var(--accent-soft); }

/* ------------------------------------------------ أزرار الاتصال والواتساب */

.cbtns { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.cb {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 3px 8px; font-size: .74rem; font-weight: 600;
    color: var(--ink-2); background: var(--surface); line-height: 1.2;
}
.cb:hover { text-decoration: none; }
.cb svg { flex: 0 0 auto; }
.cb-call { color: var(--info); border-color: #cfe0f4; }
.cb-call:hover { background: var(--info-soft); color: var(--info); }
.cb-wa { color: #128c4a; border-color: #bfe4cd; }
.cb-wa:hover { background: #e6f6ec; color: #0f7a40; }
.cb-none { color: var(--ink-3); border-style: dashed; padding: 3px 9px; }

@media print { .cbtns, .scope-bar { display: none !important; } }
.pick-contact { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.pick-contact .cb { padding: 2px 6px; font-size: .7rem; }

/* ------------------------------------------------- محطة الإرسال المتتابع */

.send-station { border-color: #bfe4cd; }
.st-person { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.st-img { width: 58px; height: 72px; object-fit: cover; object-position: center top; border-radius: 6px; background: var(--surface-2); display: block; }
.st-img.thumb-ph { display: grid; place-items: center; font-size: .6rem; color: var(--ink-3); text-align: center; }
.st-name { font-size: 1.06rem; font-weight: 700; color: var(--ink); }
.st-name:hover { color: var(--brand-2); }

.st-msg {
    background: #e6f6ec; border: 1px solid #bfe4cd; border-radius: 10px;
    padding: 12px 14px; font-size: .92rem; line-height: 1.8;
    white-space: pre-wrap; margin-bottom: 14px;
}

.st-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-lg { padding: 10px 20px; font-size: .98rem; }
#st-open.used { background: var(--surface-2); color: var(--ink-3); border-color: var(--border); }
#st-next.ready { background: var(--brand); color: #fff; border-color: var(--brand); }
#st-next:disabled { opacity: .6; cursor: not-allowed; }
.st-hint { font-size: .82rem; color: var(--ink-3); margin-top: 10px; line-height: 1.7; }

.ph-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip.ph { font-size: .74rem; }
.btn-wa { border-color: #bfe4cd; color: #128c4a; }
.btn-wa:hover { background: #e6f6ec; color: #0f7a40; }

/* --------------------------------------------- معاينة أثر فلتر السداد */
.elig-preview {
    margin-top: 8px; padding: 9px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface-2); font-size: .82rem;
}
.elig-preview.ok     { border-color: #bfe4cd; background: #eefaf2; }
.elig-preview.warn   { border-color: #e6d9a8; background: var(--accent-soft); }
.elig-preview.severe { border-color: #f0bdb9; background: var(--danger-soft); }
.elig-preview .ep-line { font-size: .9rem; }
.elig-preview .ep-line b { font-variant-numeric: tabular-nums; }
.elig-preview .ep-note { font-size: .74rem; color: var(--ink-3); margin-top: 3px; }
.elig-preview .ep-warn { font-size: .78rem; color: var(--danger); font-weight: 600; margin-top: 5px; }
.elig-preview .ep-load { color: var(--ink-3); }

/* ------------------------------------------------- لوحة اكتمال البيانات */
.cov { display: flex; align-items: center; gap: 8px; }
.cov-bar { flex: 1 1 auto; height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.cov-bar span { display: block; height: 100%; }
.cov-ok     { background: var(--ok); }
.cov-warn   { background: var(--accent); }
.cov-danger { background: var(--danger); }
.cov-pct { font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 42px; }
