/* ==========================================================================
   النظام المحاسبي — نظام تصميم احترافي (AhadCode) — فاتح رسمي، RTL، متجاوب
   الهوية: navy #102A43 · royal #2563EB · gold #F59E0B
   ========================================================================== */
:root {
    --navy: #0F2740;
    --navy-2: #17395C;
    --royal: #2563EB;
    --royal-d: #1D4ED8;
    --royal-l: #EAF1FE;
    --gold: #F59E0B;
    --green: #059669;
    --red: #DC2626;
    --violet: #7C3AED;

    --bg: #F5F7FB;
    --card: #FFFFFF;
    --line: #E9EDF4;
    --line-2: #F1F4F9;
    --text: #1E293B;
    --heading: #0F2740;
    --muted: #6B7A90;
    --muted-2: #94A3B8;

    --header-h: 66px;
    --sidebar-w: 262px;
    --sidebar-w-collapsed: 76px;

    --r-card: 16px;
    --r-ctl: 11px;
    --r-pill: 999px;

    --sh-sm: 0 1px 2px rgba(15,39,64,.05);
    --sh-md: 0 2px 8px rgba(15,39,64,.06), 0 1px 2px rgba(15,39,64,.04);
    --sh-lg: 0 12px 30px rgba(15,39,64,.10);
    --sh-pop: 0 18px 44px rgba(15,39,64,.18);

    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--royal); }
::selection { background: rgba(37,99,235,.16); }

/* شريط تمرير أنيق */
* { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: content-box; }

/* ==========================================================================
   الهيدر
   ========================================================================== */
.app-header {
    position: fixed; top: 0; inset-inline: 0; height: var(--header-h);
    background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff; display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; z-index: 1030;
    box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 4px 18px rgba(15,39,64,.18);
}
.header-start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-header .brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.12rem; color: #fff; text-decoration: none; }
.app-header .brand .mark {
    background: linear-gradient(135deg, var(--gold), #FBBF24); color: var(--navy);
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    font-weight: 800; font-family: 'IBM Plex Mono', monospace; font-size: 1rem;
    box-shadow: 0 4px 12px rgba(245,158,11,.35);
}
.app-header .brand .brand-txt { white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-btn {
    color: #cbd5e1; background: rgba(255,255,255,.06); border: 0; cursor: pointer;
    width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    font-size: 1.15rem; transition: background .15s, color .15s;
}
.header-btn:hover { color: #fff; background: rgba(255,255,255,.14); }
.user-chip { display: flex; align-items: center; gap: 9px; color: #e2e8f0; font-size: .9rem; padding-inline-start: 6px; }
.user-chip .avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: .95rem;
    background: linear-gradient(135deg, var(--royal), #3B82F6);
    box-shadow: 0 3px 10px rgba(37,99,235,.4);
}

/* ==========================================================================
   السايدبار (يمين — RTL)
   ========================================================================== */
.app-sidebar {
    position: fixed; top: var(--header-h); right: 0; left: auto;
    width: var(--sidebar-w); height: calc(100vh - var(--header-h));
    background: var(--card); border-left: 1px solid var(--line);
    overflow-y: auto; overflow-x: hidden; z-index: 1020;
    transition: transform .25s var(--ease), width .2s var(--ease);
    padding: 12px 12px 24px;
}
.sidebar-group {
    padding: 14px 12px 6px; color: var(--muted-2); font-size: .68rem; font-weight: 800;
    letter-spacing: .6px; text-transform: uppercase;
}
.sidebar-link {
    display: flex; align-items: center; gap: 12px; position: relative;
    padding: 10px 12px; margin-bottom: 2px; color: var(--text); text-decoration: none;
    border-radius: 11px; white-space: nowrap; font-size: .92rem; font-weight: 600;
    transition: background .15s, color .15s;
}
.sidebar-link i { font-size: 1.15rem; color: var(--muted); min-width: 22px; text-align: center; transition: color .15s; }
.sidebar-link:hover { background: var(--line-2); color: var(--royal); }
.sidebar-link:hover i { color: var(--royal); }
.sidebar-link.active { background: var(--royal-l); color: var(--royal-d); font-weight: 700; }
.sidebar-link.active i { color: var(--royal-d); }
.sidebar-link.active::before {
    content: ""; position: absolute; inset-inline-end: -12px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; border-radius: 4px 0 0 4px; background: var(--royal);
}
.sidebar-link.soon { opacity: .6; cursor: default; }
.sidebar-link .soon-badge {
    font-size: .6rem; font-weight: 700; background: var(--line); color: var(--muted);
    padding: 1px 7px; border-radius: 999px; margin-inline-start: auto;
}

/* الخلفية المعتمة للجوال */
.sidebar-backdrop {
    position: fixed; inset: 0; top: var(--header-h); background: rgba(15,39,64,.45);
    z-index: 1015; opacity: 0; visibility: hidden; transition: opacity .25s;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }

/* ==========================================================================
   المحتوى
   ========================================================================== */
.app-main {
    margin-top: var(--header-h);
    margin-right: var(--sidebar-w);
    padding: 26px 30px 40px;
    min-height: calc(100vh - var(--header-h));
    transition: margin .25s var(--ease);
}
.content-wrap { width: 100%; }

/* الطي على سطح المكتب */
body.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .app-sidebar .sidebar-link { justify-content: center; }
body.sidebar-collapsed .app-sidebar .sidebar-link span,
body.sidebar-collapsed .app-sidebar .sidebar-group { display: none; }
body.sidebar-collapsed .app-main { margin-right: var(--sidebar-w-collapsed); }

/* ==========================================================================
   رأس الصفحة
   ========================================================================== */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head h1 { font-size: 1.5rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 11px; color: var(--heading); }
.page-head h1 i { color: var(--royal); font-size: 1.35rem; }
.page-head .subtitle { color: var(--muted); font-size: .88rem; margin-top: 5px; }

/* ==========================================================================
   البطاقات
   ========================================================================== */
.data-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-card); padding: 22px;
    box-shadow: var(--sh-md);
}
.data-card + .data-card { margin-top: 20px; }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--heading); margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.card-title i { color: var(--royal); }

/* ==========================================================================
   شريط الترحيب (لوحة التحكم)
   ========================================================================== */
.welcome-bar {
    background: linear-gradient(110deg, var(--navy) 0%, var(--navy-2) 60%, #1E4A73 100%);
    border-radius: var(--r-card); padding: 26px 28px; color: #fff; margin-bottom: 22px;
    position: relative; overflow: hidden; box-shadow: var(--sh-lg);
}
.welcome-bar::after {
    content: ""; position: absolute; inset-inline-start: -40px; top: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,.22), transparent 70%);
}
.welcome-bar h2 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 800; position: relative; }
.welcome-bar p { margin: 0; color: #C7D6EA; font-size: .9rem; position: relative; }
.welcome-bar .wb-date {
    position: relative; margin-top: 14px; display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.1); padding: 7px 14px; border-radius: 999px; font-size: .82rem; color: #E2E8F0;
}

/* ==========================================================================
   بطاقات الإحصاء
   ========================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px;
    display: flex; align-items: center; gap: 16px; box-shadow: var(--sh-sm);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease);
    position: relative; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 100%; height: 3px; background: var(--royal); opacity: .9; }
.stat-card.s-blue::before { background: var(--royal); }
.stat-card.s-green::before { background: var(--green); }
.stat-card.s-gold::before { background: var(--gold); }
.stat-card.s-navy::before { background: var(--navy); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.stat-card .ic { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-card .ic.blue { background: #E8F0FE; color: var(--royal); }
.stat-card .ic.green { background: #E4F7EF; color: var(--green); }
.stat-card .ic.gold { background: #FEF3E0; color: #D97706; }
.stat-card .ic.navy { background: #E7ECF3; color: var(--navy); }
.stat-card .val { font-size: 1.75rem; font-weight: 800; color: var(--heading); line-height: 1; font-feature-settings: "tnum"; }
.stat-card .lbl { color: var(--muted); font-size: .84rem; margin-top: 6px; }

/* ==========================================================================
   توزيع الحسابات (أشرطة)
   ========================================================================== */
.dist-row { display: grid; grid-template-columns: 120px 1fr 52px; align-items: center; gap: 12px; margin-bottom: 14px; }
.dist-row:last-child { margin-bottom: 0; }
.dist-label { font-size: .86rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; }
.dist-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dist-track { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 999px; transition: width .6s var(--ease); }
.dist-val { font-size: .85rem; font-weight: 700; color: var(--heading); text-align: start; font-feature-settings: "tnum"; }
.c-asset { background: var(--royal); }
.c-liability { background: var(--gold); }
.c-equity { background: var(--violet); }
.c-revenue { background: var(--green); }
.c-expense { background: var(--red); }

/* ==========================================================================
   روابط سريعة
   ========================================================================== */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.quick-card {
    display: flex; align-items: center; gap: 13px; padding: 16px; border-radius: 13px;
    border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--text);
    transition: all .18s var(--ease);
}
.quick-card:hover { border-color: var(--royal); box-shadow: var(--sh-md); transform: translateY(-2px); color: var(--royal-d); }
.quick-card .qic { width: 42px; height: 42px; border-radius: 11px; background: var(--royal-l); color: var(--royal); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.quick-card .qt { font-weight: 700; font-size: .92rem; }
.quick-card .qs { font-size: .76rem; color: var(--muted); margin-top: 2px; }

/* ==========================================================================
   الجداول
   ========================================================================== */
.table-responsive { overflow-x: auto; border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table thead th {
    background: #F8FAFD; color: var(--heading); font-weight: 700; font-size: .8rem;
    padding: 13px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap;
    position: sticky; top: 0;
}
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: .88rem; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #FAFCFF; }
.table tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: plaintext; font-size: .86rem; }

/* شجرة الحسابات */
.acc-name { display: inline-flex; align-items: center; gap: 8px; }
.acc-name i { color: var(--muted-2); font-size: .95rem; }
.acc-name .bi-folder2 { color: var(--gold); }
.lvl-1 { font-weight: 800; color: var(--heading); }
.lvl-2 { font-weight: 700; }
.lvl-3 { font-weight: 600; }

/* ==========================================================================
   الشارات
   ========================================================================== */
.st-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: var(--r-pill); font-size: .73rem; font-weight: 700; white-space: nowrap; }
.st-badge.ok { background: #E4F7EF; color: #047857; }
.st-badge.off { background: #FEE9E7; color: #B91C1C; }
.st-badge.info { background: #E8F0FE; color: var(--royal-d); }
.st-badge.gold { background: #FEF3E0; color: #B45309; }
.st-badge.muted { background: #EEF1F6; color: var(--muted); }
.st-badge.debit { background: #E8F0FE; color: var(--royal-d); }
.st-badge.credit { background: #FEF3E0; color: #B45309; }

/* ==========================================================================
   أزرار الإجراءات
   ========================================================================== */
.act-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); text-decoration: none; transition: all .15s; font-size: .95rem; }
.act-btn:hover { color: #fff; transform: translateY(-1px); }
.act-btn.edit:hover { background: var(--royal); border-color: var(--royal); }
.act-btn.del:hover { background: var(--red); border-color: var(--red); }
.act-btn.view:hover { background: var(--navy); border-color: var(--navy); }
.act-btn.add:hover { background: var(--green); border-color: var(--green); }

/* ==========================================================================
   الأزرار العامة
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: inherit; font-size: .9rem; font-weight: 700; line-height: 1.4;
    padding: 10px 20px; border-radius: var(--r-ctl); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; transition: all .16s var(--ease); white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.28); }
.btn-royal { background: var(--royal); border-color: var(--royal); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.btn-royal:hover { background: var(--royal-d); border-color: var(--royal-d); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.32); transform: translateY(-1px); }
.btn-outline-secondary { background: #fff; border-color: var(--line); color: var(--muted); }
.btn-outline-secondary:hover { background: #F1F5F9; color: var(--navy); border-color: #D5DCE6; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; }

/* ==========================================================================
   حالة الفراغ
   ========================================================================== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 3.2rem; color: #CBD5E1; display: block; margin-bottom: 14px; }
.empty-state h3 { color: var(--heading); font-size: 1.1rem; margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ==========================================================================
   النماذج
   ========================================================================== */
.form-label { font-weight: 700; font-size: .84rem; color: var(--heading); margin-bottom: 6px; display: block; }
.form-control, .form-select {
    width: 100%; border-radius: var(--r-ctl); border: 1px solid var(--line); background: #fff;
    padding: 10px 13px; font-size: .9rem; font-family: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control::placeholder { color: var(--muted-2); }
.form-select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236B7A90' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 13px center; background-size: 15px; padding-inline-start: 34px; }
.form-hint { color: var(--muted); font-size: .78rem; margin-top: 5px; }
textarea.form-control { resize: vertical; min-height: 62px; }

/* مجموعة إدخال */
.input-group { display: flex; align-items: stretch; }
.input-group > .form-control, .input-group > .form-select { flex: 1 1 auto; }
.input-group-text { display: flex; align-items: center; padding: 10px 13px; background: #F4F7FB; border: 1px solid var(--line); color: var(--muted); }
.input-group > :first-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.input-group > :last-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.input-group > :not(:first-child) { border-inline-start: 0; }
.input-group:focus-within .input-group-text { border-color: var(--royal); color: var(--royal); }

/* form-check / switch */
.form-check { display: flex; align-items: center; gap: 9px; }
.form-check-input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--royal); }
.form-switch { align-items: flex-start; }
.form-switch .form-check-input {
    width: 42px; height: 23px; border-radius: 999px; -webkit-appearance: none; appearance: none;
    background: #CBD5E1; position: relative; transition: background .18s; cursor: pointer; flex-shrink: 0;
}
.form-switch .form-check-input::before { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.form-switch .form-check-input:checked { background: var(--royal); }
.form-switch .form-check-input:checked::before { transform: translateX(-19px); }
.form-check-label { cursor: pointer; font-size: .88rem; font-weight: 600; }

/* ==========================================================================
   تسجيل الدخول
   ========================================================================== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: radial-gradient(1200px 600px at 80% -10%, #1E4A73 0%, transparent 60%), linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); }
.login-card { background: #fff; border-radius: 22px; padding: 40px 36px; width: 100%; max-width: 410px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.login-card .brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-card .brand .mark { background: linear-gradient(135deg, var(--gold), #FBBF24); color: var(--navy); width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; font-family: 'IBM Plex Mono', monospace; box-shadow: 0 8px 20px rgba(245,158,11,.4); }
.login-card .brand h2 { font-size: 1.3rem; color: var(--heading); margin: 0; font-weight: 800; }
.login-card .brand p { color: var(--muted); font-size: .84rem; margin: 0; }

/* ==========================================================================
   التنبيهات (Toast) والنوافذ (Modal)
   ========================================================================== */
.toast-wrap { position: fixed; top: calc(var(--header-h) + 14px); inset-inline-start: 20px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast-item { display: flex; align-items: center; gap: 11px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 13px; padding: 13px 17px; min-width: 260px; max-width: 380px; box-shadow: var(--sh-pop); font-size: .9rem; font-weight: 600; opacity: 0; transform: translateY(-10px); transition: opacity .25s, transform .25s; border-inline-start: 4px solid var(--muted); }
.toast-item.show { opacity: 1; transform: translateY(0); }
.toast-item i { font-size: 1.25rem; }
.toast-success { border-inline-start-color: var(--green); }
.toast-success i { color: var(--green); }
.toast-error { border-inline-start-color: var(--red); }
.toast-error i { color: var(--red); }

.modal-overlay { position: fixed; inset: 0; background: rgba(15,39,64,.55); backdrop-filter: blur(2px); z-index: 1200; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .2s; }
.modal-overlay.show { opacity: 1; }
.modal-box { background: #fff; border-radius: 18px; padding: 30px; width: 100%; max-width: 410px; text-align: center; box-shadow: var(--sh-pop); transform: scale(.94); transition: transform .2s var(--ease); }
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-icon { width: 64px; height: 64px; border-radius: 50%; background: #FEE9E7; color: var(--red); display: grid; place-items: center; font-size: 1.9rem; margin: 0 auto 16px; }
.modal-title { font-size: 1.18rem; font-weight: 800; color: var(--heading); margin-bottom: 9px; }
.modal-text { color: var(--muted); font-size: .9rem; margin-bottom: 24px; line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ==========================================================================
   أدوات (Utilities)
   ========================================================================== */
.row { display: flex; flex-wrap: wrap; margin: -8px; }
.row > [class*="col-"] { padding: 8px; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-4, .col-md-6, .col-md-8 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
}
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.w-100 { width: 100%; }
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.me-1 { margin-inline-end: .25rem; }
.ms-1 { margin-inline-start: .25rem; }
.small { font-size: .82rem; }
.fw-bold { font-weight: 700; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--red); }
.text-primary { color: var(--royal); }
.text-warning { color: var(--gold); }
.text-white { color: #fff; }
.text-decoration-none { text-decoration: none; }

/* ==========================================================================
   التجاوب (Responsive)
   ========================================================================== */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(100%); box-shadow: var(--sh-pop); }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    .app-main { margin-right: 0; }
    body.sidebar-collapsed .app-main { margin-right: 0; }
    .app-main { padding: 20px 18px 34px; }
    .header-desktop-toggle { display: none; }
}
@media (min-width: 992px) {
    .header-mobile-toggle { display: none; }
    .sidebar-backdrop { display: none; }
}
@media (max-width: 575.98px) {
    :root { --header-h: 60px; }
    .app-header { padding: 0 14px; }
    .app-header .brand .brand-txt { display: none; }
    .user-chip span { display: none; }
    .app-main { padding: 16px 14px 30px; }
    .page-head h1 { font-size: 1.25rem; }
    .page-head { margin-bottom: 18px; }
    .data-card { padding: 16px; border-radius: 14px; }
    .welcome-bar { padding: 20px; }
    .welcome-bar h2 { font-size: 1.2rem; }
    .stat-card { padding: 16px; }
    .dist-row { grid-template-columns: 96px 1fr 42px; gap: 9px; }
    .btn { padding: 9px 15px; }
    .modal-actions { flex-direction: column; }
    .modal-actions .btn { width: 100%; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
    .d-none.d-md-inline { display: none; }
}
@media print {
    .app-header, .app-sidebar, .sidebar-backdrop, .page-head .btn { display: none !important; }
    .app-main { margin: 0; padding: 0; }
}

/* ==== أيقونات SVG مضمّنة (بلا خط خارجي) ==== */
.bi{display:inline-block;width:1em;height:1em;vertical-align:-.125em;background-color:currentColor;-webkit-mask:var(--bi) center/contain no-repeat;mask:var(--bi) center/contain no-repeat;--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%3E%3C%2Fsvg%3E");}
.bi-list{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%204h12M2%208h12M2%2012h12%27%2F%3E%3C%2Fsvg%3E");}
.bi-box-arrow-right{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M6%202H3v12h3%27%2F%3E%3Cpath%20d%3D%27M10%205l3%203-3%203%27%2F%3E%3Cpath%20d%3D%27M13%208H6%27%2F%3E%3C%2Fsvg%3E");}
.bi-box-arrow-in-left{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M10%202h3v12h-3%27%2F%3E%3Cpath%20d%3D%27M6%205%203%208l3%203%27%2F%3E%3Cpath%20d%3D%27M3%208h7%27%2F%3E%3C%2Fsvg%3E");}
.bi-speedometer2{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%2012a6%206%200%201%201%2012%200%27%2F%3E%3Cpath%20d%3D%27M8%2012l3-3%27%2F%3E%3Ccircle%20cx%3D%278%27%20cy%3D%2712%27%20r%3D%27.5%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E");}
.bi-diagram-3{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%276%27%20y%3D%272%27%20width%3D%274%27%20height%3D%273%27%20rx%3D%27.5%27%2F%3E%3Crect%20x%3D%271.5%27%20y%3D%2711%27%20width%3D%274%27%20height%3D%273%27%20rx%3D%27.5%27%2F%3E%3Crect%20x%3D%2710.5%27%20y%3D%2711%27%20width%3D%274%27%20height%3D%273%27%20rx%3D%27.5%27%2F%3E%3Cpath%20d%3D%27M8%205v3M8%208H3.5v3M8%208h4.5v3%27%2F%3E%3C%2Fsvg%3E");}
.bi-pie-chart{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%208V2a6%206%200%201%200%206%206z%27%2F%3E%3C%2Fsvg%3E");}
.bi-journal-text{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%272%27%20width%3D%2710%27%20height%3D%2712%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M5.5%205h5M5.5%208h5M5.5%2011h3%27%2F%3E%3C%2Fsvg%3E");}
.bi-calendar-range{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%272%27%20y%3D%273%27%20width%3D%2712%27%20height%3D%2711%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M2%206.5h12M5%202v2M11%202v2%27%2F%3E%3C%2Fsvg%3E");}
.bi-calendar-check{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%272%27%20y%3D%273%27%20width%3D%2712%27%20height%3D%2711%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M2%206.5h12M5%202v2M11%202v2%27%2F%3E%3Cpath%20d%3D%27M5.5%2010l1.5%201.5L10.5%208%27%2F%3E%3C%2Fsvg%3E");}
.bi-book{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%204C8%203%207%202%205%202H2v10h3c2%200%203%201%203%202%200-1%201-2%203-2h3V2h-3c-2%200-3%201-3%202z%27%2F%3E%3C%2Fsvg%3E");}
.bi-list-columns-reverse{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M9%204.5h5M9%208h5M9%2011.5h5%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%273.5%27%20width%3D%273.5%27%20height%3D%273%27%20rx%3D%27.4%27%20fill%3D%27black%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%279.5%27%20width%3D%273.5%27%20height%3D%273%27%20rx%3D%27.4%27%20fill%3D%27black%27%2F%3E%3C%2Fsvg%3E");}
.bi-file-earmark-bar-graph{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%202h5l3%203v9H4z%27%2F%3E%3Cpath%20d%3D%27M9%202v3h3%27%2F%3E%3Cpath%20d%3D%27M6%2011.5v-1M8%2011.5v-2.5M10%2011.5v-4%27%2F%3E%3C%2Fsvg%3E");}
.bi-people{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%276%27%20cy%3D%276%27%20r%3D%272%27%2F%3E%3Cpath%20d%3D%27M2.5%2013c0-2%201.8-3%203.5-3s3.5%201%203.5%203%27%2F%3E%3Cpath%20d%3D%27M11%204.5a2%202%200%200%201%200%204M12%2010c1.3.3%202%201.3%202%203%27%2F%3E%3C%2Fsvg%3E");}
.bi-shield-lock{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%202l5%202v4c0%203-2%205-5%206-3-1-5-3-5-6V4z%27%2F%3E%3Crect%20x%3D%276.3%27%20y%3D%277.5%27%20width%3D%273.4%27%20height%3D%273%27%20rx%3D%27.4%27%2F%3E%3Cpath%20d%3D%27M8%207.5v-1%27%2F%3E%3C%2Fsvg%3E");}
.bi-building-gear{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%2014V3h7v11%27%2F%3E%3Cpath%20d%3D%27M5%205.5h1M8%205.5h1M5%208h1M8%208h1M5%2010.5h1%27%2F%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2711.5%27%20r%3D%271.6%27%2F%3E%3C%2Fsvg%3E");}
.bi-dot{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%278%27%20cy%3D%278%27%20r%3D%271.5%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E");}
.bi-plus-lg{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%203v10M3%208h10%27%2F%3E%3C%2Fsvg%3E");}
.bi-plus-circle{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%278%27%20cy%3D%278%27%20r%3D%276%27%2F%3E%3Cpath%20d%3D%27M8%205.5v5M5.5%208h5%27%2F%3E%3C%2Fsvg%3E");}
.bi-pencil-square{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M11%203H4a1%201%200%200%200-1%201v8a1%201%200%200%200%201%201h8a1%201%200%200%200%201-1V6.5%27%2F%3E%3Cpath%20d%3D%27M10.5%202.2l3.3%203.3-6%206H4.5v-3.3z%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E");}
.bi-trash{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%204.2h10M6%204.2V3h4v1.2M4.8%204.2l.8%209.3h4.8l.8-9.3%27%2F%3E%3C%2Fsvg%3E");}
.bi-search{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%277%27%20cy%3D%277%27%20r%3D%274%27%2F%3E%3Cpath%20d%3D%27M10%2010l4%204%27%2F%3E%3C%2Fsvg%3E");}
.bi-check-lg{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%208.5l3.2%203.8L13%204.5%27%2F%3E%3C%2Fsvg%3E");}
.bi-check2-square{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M13%203.5V12a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1h6.5%27%2F%3E%3Cpath%20d%3D%27M6%208l2%202%205-5%27%2F%3E%3C%2Fsvg%3E");}
.bi-folder2{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%205a1%201%200%200%201%201-1h3l1.5%202H13a1%201%200%200%201%201%201v5a1%201%200%200%201-1%201H3a1%201%200%200%201-1-1z%27%2F%3E%3C%2Fsvg%3E");}
.bi-signpost-2{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%202v12%27%2F%3E%3Cpath%20d%3D%27M4%204.5h7l2%201.4-2%201.6H4z%27%2F%3E%3Cpath%20d%3D%27M12%209.5H5l-2%201.4%202%201.6h7z%27%2F%3E%3C%2Fsvg%3E");}
.bi-arrow-right{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%208h10%27%2F%3E%3Cpath%20d%3D%27M9%204l4%204-4%204%27%2F%3E%3C%2Fsvg%3E");}
.bi-house{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%208l6-5%206%205%27%2F%3E%3Cpath%20d%3D%27M4%207v6.5h8V7%27%2F%3E%3C%2Fsvg%3E");}
.bi-exclamation-triangle{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%202.2l6%2011H2z%27%2F%3E%3Cpath%20d%3D%27M8%206.5v3%27%2F%3E%3Ccircle%20cx%3D%278%27%20cy%3D%2711.4%27%20r%3D%27.55%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E");}
.bi-person{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%278%27%20cy%3D%275%27%20r%3D%272.5%27%2F%3E%3Cpath%20d%3D%27M3%2014c0-3%202.5-4.5%205-4.5s5%201.5%205%204.5%27%2F%3E%3C%2Fsvg%3E");}
.bi-lock{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273.5%27%20y%3D%277%27%20width%3D%279%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M5.5%207V5a2.5%202.5%200%200%201%205%200v2%27%2F%3E%3C%2Fsvg%3E");}

/* أيقونة تأكيد إيجابية (ترحيل/عكس) */
.modal-icon.ok { background: #E4F7EF; color: var(--green); }

/* ==== أعمدة المبالغ (محاذاة محاسبية) ==== */
.table th.num { text-align: right; white-space: nowrap; width: 150px; color: var(--heading); padding-inline-end: 22px; }
.table td.num {
    text-align: right; white-space: nowrap; width: 150px; padding-inline-end: 22px;
    font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: plaintext;
}
.table th.col-acc, .table td.col-acc { width: 1%; white-space: nowrap; }
.table tfoot .jtotals th { background: #F8FAFD; font-weight: 800; border-top: 2px solid var(--line); }
.table tfoot .jtotals th.num { color: var(--heading); font-size: .95rem; }
.num-input { text-align: end; font-family: 'IBM Plex Mono', monospace; direction: ltr; }

/* جدول أطراف القيد: يتماسك بحجم محتواه بدل التمدد */
.lines-table { width: auto; min-width: 640px; }
.lines-table th, .lines-table td { padding-inline: 18px; }
@media (max-width: 640px) { .lines-table { width: 100%; min-width: 560px; } }

/* ==== القوائم المالية ==== */
.fs-tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.fs-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 10px; text-decoration: none;
    color: var(--muted); font-weight: 700; font-size: .9rem; border: 1px solid transparent; }
.fs-tab:hover { background: var(--line-2); color: var(--royal); }
.fs-tab.active { background: var(--royal-l); color: var(--royal-d); }
.fs-sheet { max-width: 820px; }
.fs-head { text-align: center; padding-bottom: 18px; margin-bottom: 10px; border-bottom: 2px solid var(--navy); }
.fs-company { font-size: 1.15rem; font-weight: 800; color: var(--heading); }
.fs-title { font-size: 1rem; font-weight: 700; color: var(--royal-d); margin-top: 3px; }
.fs-period { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.fs-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 6px; }
.fs-amt { font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: plaintext; white-space: nowrap; min-width: 130px; text-align: left; }
.fs-section { font-weight: 800; color: var(--navy); background: #F8FAFD; border-radius: 8px; margin-top: 8px; }
.fs-item { padding-inline-start: 22px; border-bottom: 1px dashed var(--line-2); }
.fs-item .fs-code { font-size: .72rem; color: var(--muted-2); margin-inline-start: 6px; }
.fs-subtotal { font-weight: 700; border-top: 1px solid var(--line); margin-top: 4px; }
.fs-subtotal.strong { color: var(--heading); background: #F4F7FB; border-radius: 8px; }
.fs-total { font-weight: 800; color: #fff; background: linear-gradient(100deg, var(--navy), var(--navy-2)); border-radius: 10px; margin-top: 8px; padding: 12px 14px; }
.fs-total .fs-amt { color: #fff; }
.fs-spacer { height: 14px; }
@media print {
    .fs-tabs, .page-head .btn, form { display: none !important; }
    .fs-sheet { max-width: 100%; box-shadow: none; border: none; }
}

/* أيقونات إضافية */
.bi-grid{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%272%27%20y%3D%272%27%20width%3D%275%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%272%27%20width%3D%275%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%279%27%20width%3D%275%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%279%27%20width%3D%275%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3C%2Fsvg%3E");}
.bi-printer{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4.5%206V2.5h7V6%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%276%27%20width%3D%2712%27%20height%3D%275.5%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M4.5%2010h7v3.5h-7z%27%2F%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%278.2%27%20r%3D%27.5%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E");}
.bi-graph-up-arrow{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2.5%2013.5V2.5M2.5%2013.5h11%27%2F%3E%3Cpath%20d%3D%27M4.5%2010.5l3-3%202%202%204-4.5%27%2F%3E%3Cpath%20d%3D%27M10.5%205h3v3%27%2F%3E%3C%2Fsvg%3E");}
.bi-bank{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%206.2%208%203l6%203.2%27%2F%3E%3Cpath%20d%3D%27M2.6%206.2h10.8%27%2F%3E%3Cpath%20d%3D%27M4%207v4.5M7%207v4.5M9%207v4.5M12%207v4.5%27%2F%3E%3Cpath%20d%3D%27M2.4%2013.4h11.2%27%2F%3E%3C%2Fsvg%3E");}
.bi-cash-coin{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%276.2%27%20cy%3D%277%27%20r%3D%274.2%27%2F%3E%3Cpath%20d%3D%27M6.2%204.9v4.2M5.2%206.1h1.7a.9.9%200%200%201%200%201.8H5.6a.9.9%200%200%200%200%201.8h1.7%27%2F%3E%3Cpath%20d%3D%27M10.4%203.3a4.7%204.7%200%200%201%202.6%208.2%27%2F%3E%3C%2Fsvg%3E");}

.bi-cash-coin{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%278%27%20cy%3D%278%27%20r%3D%275%27%2F%3E%3Cpath%20d%3D%27M8%204.6v6.8%27%2F%3E%3Cpath%20d%3D%27M9.6%206.2a1.6%201.6%200%200%200%20-1.6%20-1%201.4%201.4%200%200%200%200%202.8%201.4%201.4%200%200%201%200%202.8%201.6%201.6%200%200%201%20-1.6%20-1%27%2F%3E%3C%2Fsvg%3E");}

.bi-unlock{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273.5%27%20y%3D%277%27%20width%3D%279%27%20height%3D%277%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M5.5%207V5a2.5%202.5%200%200%201%204.9%20-.6%27%2F%3E%3C%2Fsvg%3E");}

.bi-geo-alt{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%2014s5-4.2%205-8A5%205%200%200%200%203%206c0%203.8%205%208%205%208z%27%2F%3E%3Ccircle%20cx%3D%278%27%20cy%3D%276%27%20r%3D%271.8%27%2F%3E%3C%2Fsvg%3E");}
.bi-palette{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%202a6%206%200%200%200%200%2012c1%200%201.6-.8%201.6-1.6%200-.5-.2-.8-.5-1.1-.3-.3-.5-.6-.5-1%200-.6.5-1%201.1-1H11a3%203%200%200%200%203-3A5.5%205.5%200%200%200%208%202z%27%2F%3E%3Ccircle%20cx%3D%275.5%27%20cy%3D%277%27%20r%3D%27.7%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%278%27%20cy%3D%275.2%27%20r%3D%27.7%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%2710.5%27%20cy%3D%277%27%20r%3D%27.7%27%20fill%3D%27black%27%20stroke%3D%27none%27%2F%3E%3C%2Fsvg%3E");}

/* شعار المنشأة في الهيدر */
.app-header .brand-logo { height: 42px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 9px; padding: 4px 6px; }

.bi-plugin{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M6%202v2M10%202v2%27%2F%3E%3Crect%20x%3D%274.5%27%20y%3D%274%27%20width%3D%277%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M8%209v3a2%202%200%200%200%202%202h1%27%2F%3E%3C%2Fsvg%3E");}
.bi-upload{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M8%2011V3.5%27/%3E%3Cpath%20d%3D%27M5%206l3-3%203%203%27/%3E%3Cpath%20d%3D%27M2.5%2010.5v2a1%201%200%200%200%201%201h9a1%201%200%200%200%201-1v-2%27/%3E%3C/svg%3E");}
.bi-file-arrow-down{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%201.5h5l3%203V14a.5.5%200%200%201-.5.5h-7A.5.5%200%200%201%204%2014z%27/%3E%3Cpath%20d%3D%27M9%201.5V4.5h3%27/%3E%3Cpath%20d%3D%27M8%207v4M6.3%209.3%208%2011l1.7-1.7%27/%3E%3C/svg%3E");}
.bi-check-circle{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%278%27%20cy%3D%278%27%20r%3D%276.5%27/%3E%3Cpath%20d%3D%27M5.3%208.2%207.2%2010l3.5-3.8%27/%3E%3C/svg%3E");}
.bi-x-circle{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%278%27%20cy%3D%278%27%20r%3D%276.5%27/%3E%3Cpath%20d%3D%27M6%206l4%204M10%206l-4%204%27/%3E%3C/svg%3E");}
.bi-info-circle{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%278%27%20cy%3D%278%27%20r%3D%276.5%27/%3E%3Cpath%20d%3D%27M8%207.2v3.6%27/%3E%3Ccircle%20cx%3D%278%27%20cy%3D%275%27%20r%3D%27.35%27%20fill%3D%27black%27%20stroke%3D%27none%27/%3E%3C/svg%3E");}
.bi-arrow-left-short{--bi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M10%204%206%208l4%204%27/%3E%3C/svg%3E");}
