/* ═══════════════ اركو قروب — نظام التصميم ═══════════════
   مأخوذ من موقع الشركة (ArcoWebsite) — انظر DESIGN.md
   تركوازي الشعار + الورقة الصفراء · مربعات مدوّرة وخطوط أحادية كالشعار
   · شبكة لوحة الرسم الهندسي في الخلفية · جوال أولاً */

:root {
    /* ألوان العلامة (مطابقة للموقع) */
    --teal: #58999e;           /* الشعار — للرسوم لا للنص */
    --teal-600: #3f7f84;
    --teal-700: #2e6a6f;       /* تركوازي آمن للنص */
    --teal-900: #123a3d;       /* الأزرار الأساسية والأسطح العميقة */
    --teal-950: #0b2628;
    --teal-200: #9fd0d3;       /* عناوين على الأسطح العميقة */
    --teal-100: #d3e6e7;
    --teal-50: #e9f2f2;
    --ink: #0f1f20;
    --ink-soft: #4a5e5f;
    --ink-mute: #627476;
    --paper: #f4f7f6;          /* جصّ بارد */
    --stone: #e6edeb;
    --stone-2: #eef3f2;
    --white: #ffffff;
    --note: #f4cf4e;           /* الورقة الصفراء */
    --rule: rgba(15, 31, 32, .12);
    --rule-strong: rgba(15, 31, 32, .22);

    /* حالات */
    --ok: #2c7350;
    --ok-soft: #e3f1ea;
    --warn: #8f6210;
    --warn-soft: #f8eed6;
    --bad: #b3261e;
    --bad-soft: #f9e4e1;

    /* خطوط */
    --font-display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
    --font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    --font-mono: "IBM Plex Mono", "IBM Plex Sans Arabic", ui-monospace, monospace;
    --font-note: "Aref Ruqaa", "Alexandria", serif;

    /* شكل وحركة */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow: 0 1px 2px rgba(15, 31, 32, .04);
    --shadow-float: 0 24px 48px -24px rgba(15, 31, 32, .45), 0 2px 6px rgba(15, 31, 32, .06);
    --ease-out: cubic-bezier(.2, .7, .1, 1);
    --topbar-h: 64px;
    --grid-line: rgba(46, 106, 111, .065);

    /* أسماء قديمة تستعملها القوالب */
    --brand: var(--teal);
    --brand-dark: var(--teal-700);
    --brand-soft: var(--teal-100);
    --brand-softer: var(--teal-50);
    --ink-2: var(--ink-soft);
    --ink-3: var(--ink-mute);
    --card: var(--white);
    --line: var(--rule);

    /* Bootstrap */
    --bs-body-font-family: var(--font-body);
    --bs-body-color: #0f1f20;
    --bs-body-color-rgb: 15, 31, 32;
    --bs-body-bg: #f4f7f6;
    --bs-emphasis-color: #0f1f20;
    --bs-secondary-color: #4a5e5f;
    --bs-secondary-rgb: 74, 94, 95;
    --bs-primary: #123a3d;
    --bs-primary-rgb: 18, 58, 61;
    --bs-success-rgb: 44, 115, 80;
    --bs-danger-rgb: 179, 38, 30;
    --bs-warning-rgb: 244, 207, 78;
    --bs-link-color: #2e6a6f;
    --bs-link-color-rgb: 46, 106, 111;
    --bs-link-hover-color: #123a3d;
    --bs-link-hover-color-rgb: 18, 58, 61;
    --bs-border-color: #dde5e3;
    --bs-border-radius: 12px;
    --bs-focus-ring-color: rgba(88, 153, 158, .3);
    --bs-heading-color: inherit;
}

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

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 84px; /* مساحة الشريط السفلي في الجوال */
}
@media (min-width: 992px) { body { padding-bottom: 0; } }

/* شبكة لوحة الرسم خلف أعلى الصفحة، تتلاشى نزولاً */
body::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 460px; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}

h1, h2, h3, h4, h5, h6, .h6 { font-family: var(--font-display); font-weight: 600; }
h1, h2 { text-wrap: balance; }
a { color: var(--teal-700); }
a:hover { color: var(--teal-900); }
::selection { background: var(--note); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 2px; }
.btn:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 2px; box-shadow: none; }
.text-secondary { color: var(--ink-soft) !important; }
hr { border-color: var(--rule); opacity: 1; }

/* ─── الشعار ─── */
.brand-logo { width: 40px; height: 40px; fill: currentColor; color: var(--teal); flex-shrink: 0; transition: transform .5s var(--ease-out); }
.brand { color: inherit; }
.brand:hover .brand-logo { transform: rotate(-6deg); }
.brand-text { display: grid; line-height: 1.25; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); }
.brand-sub { font-size: .72rem; color: var(--ink-soft); }

/* ─── الشريط العلوي ─── */
.topbar {
    background: rgba(244, 247, 246, .88);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    box-shadow: 0 1px 0 var(--rule);
}
.topbar-inner { display: flex; align-items: center; gap: .75rem; min-height: var(--topbar-h); }
.top-links { display: flex; align-items: center; gap: .15rem; margin-inline-start: auto; }
.top-links a {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--ink-soft); text-decoration: none; font-weight: 500;
    padding: .45rem .7rem; border-radius: var(--radius-sm); font-size: .92rem;
    transition: color .2s, background-color .2s;
}
.top-links a i { color: var(--ink-mute); font-size: .95rem; transition: color .2s; }
.top-links a:hover { color: var(--ink); background: rgba(15, 31, 32, .04); }
.top-links a.active { background: var(--stone); color: var(--teal-900); font-weight: 600; }
.top-links a.active i { color: var(--teal-700); }
.top-actions { display: flex; align-items: center; gap: .4rem; margin-inline-start: .5rem; }
.top-actions .btn-link { color: var(--ink-mute); }
.top-actions .btn-link:hover { color: var(--bad); }
@media (min-width: 992px) and (max-width: 1199.98px) {
    .top-links a { padding: .45rem .55rem; font-size: .88rem; }
    .top-links a:not(.icon-only) i { display: none; }
    .topbar .brand-sub { display: none; }
}

/* ─── الشريط السفلي (جوال) ─── */
.bottom-nav {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 1030;
    display: flex; justify-content: space-around; align-items: center;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    box-shadow: 0 -1px 0 var(--rule);
    padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom));
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: .15rem;
    color: var(--ink-mute); text-decoration: none; font-size: .7rem;
    font-weight: 500; padding: .25rem .6rem; border-radius: var(--radius-sm); flex: 1;
    max-width: 84px; transition: color .2s;
}
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--teal-900); font-weight: 700; }
.bottom-nav a.active i { color: var(--teal-700); }
/* زر الإضافة: مربع مدوّر كإطار الشعار */
.bottom-nav .nav-fab {
    width: 54px; height: 54px; border-radius: 17px; border: 0; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--teal-900); color: var(--paper); font-size: 1.45rem; margin-top: -28px;
    box-shadow: 0 0 0 5px var(--paper), 0 14px 26px -12px rgba(11, 38, 40, .8);
    transition: transform .3s var(--ease-out), background-color .2s;
}
.bottom-nav .nav-fab:active { transform: scale(.94); }

/* ─── البطاقات ─── */
.soft-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card, .soft-card.card { border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }

/* بطاقة إحصائية */
.stat-card {
    background: var(--white); border: 1px solid var(--rule);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: .95rem 1.05rem;
}
.stat-card .stat-label { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.stat-card .stat-value { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.stat-card .stat-value small, .kpi-value small { font-family: var(--font-body); font-size: .62em; font-weight: 500; letter-spacing: 0; }
.stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.tone-brand .stat-icon { background: var(--teal-50); color: var(--teal-700); }
.tone-ok .stat-icon { background: var(--ok-soft); color: var(--ok); }
.tone-warn .stat-icon { background: var(--warn-soft); color: var(--warn); }
.tone-bad .stat-icon { background: var(--bad-soft); color: var(--bad); }
.tone-ok .stat-value { color: var(--ok); }
.tone-warn .stat-value { color: var(--warn); }
.tone-bad .stat-value { color: var(--bad); }

/* ─── الأزرار ─── */
.btn {
    --bs-btn-border-width: 1.5px;
    --bs-btn-border-radius: 12px;
    --bs-btn-font-weight: 600;
    --bs-btn-padding-y: .5rem;
    --bs-btn-padding-x: 1rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    transition: background-color .2s, color .2s, border-color .2s, transform .25s var(--ease-out), box-shadow .2s;
}
.btn.d-none { display: none !important; }
.btn-sm { --bs-btn-border-radius: 10px; --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .85rem; }
.btn-lg { --bs-btn-border-radius: 14px; --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1.02rem; min-height: 52px; }
.btn-brand {
    --bs-btn-bg: var(--teal-900); --bs-btn-color: var(--paper); --bs-btn-border-color: var(--teal-900);
    --bs-btn-hover-bg: var(--teal-700); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--teal-700);
    --bs-btn-active-bg: var(--teal-950); --bs-btn-active-color: #fff; --bs-btn-active-border-color: var(--teal-950);
    --bs-btn-disabled-bg: var(--teal-900); --bs-btn-disabled-color: var(--paper); --bs-btn-disabled-border-color: var(--teal-900);
}
.btn-brand:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -14px rgba(18, 58, 61, .9); }
.btn-brand:active { transform: none; }
.btn-soft {
    --bs-btn-bg: var(--white); --bs-btn-color: var(--ink); --bs-btn-border-color: var(--rule-strong);
    --bs-btn-hover-bg: var(--white); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-bg: var(--stone); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--ink);
}
.btn-soft i { color: var(--teal-700); }
.btn-outline-secondary {
    --bs-btn-color: var(--ink-soft); --bs-btn-border-color: var(--rule-strong);
    --bs-btn-hover-bg: var(--stone); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--ink-soft);
    --bs-btn-active-bg: var(--stone); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--ink-soft);
}
.btn-outline-danger {
    --bs-btn-color: var(--bad); --bs-btn-border-color: rgba(179, 38, 30, .35);
    --bs-btn-hover-bg: var(--bad); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--bad);
    --bs-btn-active-bg: var(--bad); --bs-btn-active-border-color: var(--bad);
}
.btn-link { --bs-btn-color: var(--teal-700); --bs-btn-hover-color: var(--teal-900); text-decoration: none; }

/* ─── الجداول ─── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table {
    --bs-table-bg: transparent; --bs-table-color: var(--ink);
    --bs-table-hover-bg: var(--teal-50); --bs-table-hover-color: var(--ink);
    --bs-table-border-color: var(--rule);
    margin-bottom: 0;
}
.table thead th {
    background: var(--stone-2); color: var(--ink-soft); font-size: .78rem;
    font-weight: 600; border-bottom: 1px solid var(--rule);
    white-space: nowrap; padding: .7rem .8rem;
}
.table tbody td { padding: .7rem .8rem; vertical-align: middle; border-color: var(--rule); }
.table tfoot td { background: var(--stone-2); font-weight: 700; border-top: 1.5px solid var(--rule-strong); border-bottom: 0; }

/* ─── التبويبات: مفتاح مقسّم على مسار حجري ─── */
.pill-tabs {
    display: flex; gap: 3px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 4px; background: var(--stone); border-radius: 14px;
    scrollbar-width: none;
}
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tabs a {
    display: inline-flex; align-items: center; gap: .35rem;
    white-space: nowrap; text-decoration: none; color: var(--ink-soft);
    font-weight: 600; font-size: .88rem; padding: .48rem .95rem;
    border-radius: var(--radius-sm); transition: background-color .2s, color .2s; flex-shrink: 0;
}
.pill-tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.pill-tabs a.active { background: var(--teal-900); color: var(--paper); }
.pill-tabs a .badge { background: var(--white); color: var(--ink-soft); font-family: var(--font-mono); font-weight: 500; }
.pill-tabs a.active .badge { background: rgba(255, 255, 255, .16); color: var(--paper); }

/* ─── النماذج ─── */
.form-control, .form-select {
    border: 1.5px solid var(--rule-strong); border-radius: 12px;
    padding-top: .6rem; padding-bottom: .6rem; padding-right: .9rem; min-height: 46px;
    background-color: var(--white); color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
.form-control { padding-left: .9rem; }
.form-select { padding-left: 2.4rem; background-position: left .85rem center; }
.form-control:hover, .form-select:hover { border-color: rgba(15, 31, 32, .38); }
.form-control:focus, .form-select:focus {
    border-color: var(--teal-700); box-shadow: 0 0 0 4px rgba(88, 153, 158, .22);
}
.form-control::placeholder { color: #8a999a; }
.form-control-sm { min-height: 38px; border-radius: var(--radius-sm); padding-top: .3rem; padding-bottom: .3rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--bad); }
.invalid-feedback { color: var(--bad); }
.form-check-input { border: 1.5px solid var(--rule-strong); }
.form-check-input:checked { background-color: var(--teal-900); border-color: var(--teal-900); }
.form-check-input:focus { border-color: var(--teal-700); box-shadow: 0 0 0 4px rgba(88, 153, 158, .22); }
.form-label { font-weight: 600; font-size: .86rem; color: var(--ink); margin-bottom: .35rem; }
.form-text { color: var(--ink-mute); }
label.requiredField .asteriskField { color: var(--bad); margin-inline-start: 2px; }
.input-group > .btn { position: relative; z-index: 2; }

/* ─── منتقي التاريخ (flatpickr): يوم/شهر/سنة، تقويم من اليمين لليسار بألوان النظام ─── */
.date-field {
    cursor: pointer;
    padding-left: 2.4rem !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e6a6f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E") no-repeat left .85rem center / 17px;
}
.flatpickr-calendar {
    font-family: inherit; border: 1px solid var(--rule); border-radius: var(--radius);
    box-shadow: var(--shadow-float);
}
.flatpickr-calendar::before, .flatpickr-calendar::after { display: none; }
[dir=rtl] .flatpickr-calendar { direction: rtl; }  /* المكتبة تفرض ltr: السبت يميناً والشهر قبل السنة */
.flatpickr-months { padding-top: .3rem; }
.flatpickr-current-month { font-size: 1rem; font-family: var(--font-display); }
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { font-weight: 600; color: var(--ink); }
.flatpickr-current-month .numInputWrapper input.cur-year { direction: ltr; font-family: var(--font-mono); }
/* السابق يميناً والتالي يساراً كما يُقرأ التقويم العربي */
[dir=rtl] .flatpickr-months .flatpickr-prev-month { left: auto; right: 0; }
[dir=rtl] .flatpickr-months .flatpickr-next-month { right: auto; left: 0; }
[dir=rtl] .flatpickr-months .flatpickr-prev-month svg,
[dir=rtl] .flatpickr-months .flatpickr-next-month svg { transform: scaleX(-1); }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--teal-700); }
span.flatpickr-weekday { color: var(--ink-mute); font-weight: 600; font-size: .72rem; }
.flatpickr-day { color: var(--ink); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: .88rem; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--teal-50); border-color: var(--teal-50); }
.flatpickr-day.today { border-color: var(--teal); }
.flatpickr-day.today:hover, .flatpickr-day.today:focus { background: var(--teal-100); border-color: var(--teal); color: var(--ink); }
.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.selected:hover,
.flatpickr-calendar .flatpickr-day.selected:focus {
    background: var(--teal-900); border-color: var(--teal-900); color: var(--paper); font-weight: 600;
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: #a5b2b3; }
.fp-actions { display: flex; gap: .4rem; padding: .5rem; border-top: 1px solid var(--rule); }
.fp-actions button {
    flex: 1; border: 1.5px solid var(--rule-strong); border-radius: var(--radius-sm); padding: .4rem; font: inherit; font-weight: 600; font-size: .85rem;
    background: var(--white); color: var(--ink);
}
.fp-actions button:hover { border-color: var(--ink); }
.fp-actions [data-act=clear] { border-color: transparent; color: var(--ink-soft); }
.fp-actions [data-act=clear]:hover { background: var(--paper); border-color: transparent; }

/* ─── شارات ─── */
.badge { font-weight: 600; border-radius: 8px; padding: .32em .6em; font-size: .74em; }
.badge-soft-ok { background: var(--ok-soft); color: var(--ok); }
.badge-soft-warn { background: var(--warn-soft); color: var(--warn); }
.badge-soft-bad { background: var(--bad-soft); color: var(--bad); }
.badge-soft-brand { background: var(--teal-50); color: var(--teal-700); }
.badge-soft-muted { background: var(--stone); color: var(--ink-soft); }
.badge.bg-warning { color: var(--ink) !important; }

/* ─── التنبيهات ─── */
.alert { border-radius: 14px; font-weight: 500; }
.alert-success { --bs-alert-bg: var(--ok-soft); --bs-alert-color: var(--ok); --bs-alert-border-color: rgba(44, 115, 80, .25); }
.alert-danger { --bs-alert-bg: var(--bad-soft); --bs-alert-color: var(--bad); --bs-alert-border-color: rgba(179, 38, 30, .25); }
.alert-warning { --bs-alert-bg: var(--warn-soft); --bs-alert-color: var(--warn); --bs-alert-border-color: rgba(143, 98, 16, .25); }
.alert-info { --bs-alert-bg: var(--teal-50); --bs-alert-color: var(--teal-900); --bs-alert-border-color: rgba(46, 106, 111, .22); }
.alert.soft-card { background: var(--bs-alert-bg); border: 1px solid var(--bs-alert-border-color) !important; box-shadow: none; }

/* ─── القوائم المنسدلة ─── */
.dropdown-menu {
    --bs-dropdown-border-radius: 14px; --bs-dropdown-border-color: var(--rule);
    --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--teal-50); --bs-dropdown-link-hover-color: var(--ink);
    --bs-dropdown-link-active-bg: var(--teal-900); --bs-dropdown-link-active-color: var(--paper);
    --bs-dropdown-divider-bg: var(--rule);
    padding: .35rem; box-shadow: var(--shadow-float) !important; border: 1px solid var(--rule) !important;
}
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-weight: 500; display: flex; align-items: center; gap: .5rem; }
.dropdown-item i { color: var(--teal-700); }

/* ─── عناوين الصفحات ─── */
.page-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.15rem; }
.page-head h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.page-head .ms-auto-actions { margin-inline-start: auto; display: flex; gap: .5rem; }
h1.fs-4 { font-family: var(--font-display); font-weight: 600 !important; }
h2.fs-6, h2.h6 { font-family: var(--font-display); font-weight: 600 !important; }
h2.fs-6 > i, h2.h6 > i { color: var(--teal-700); }

/* ─── أرقام مالية ─── */
.money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; letter-spacing: -.01em; }
.fw-bold .money, .money.fw-bold { font-weight: 600; }
.money-in { color: var(--ok); }
.money-out { color: var(--bad); }

/* ─── حالة فارغة: الأيقونة داخل مربع مدوّر كإطار الشعار ─── */
.empty-state { text-align: center; padding: 2.75rem 1rem; color: var(--ink-mute); }
.empty-state > i {
    width: 60px; height: 60px; margin: 0 auto .9rem; display: grid; place-items: center;
    font-size: 1.6rem; color: var(--teal-700);
    border: 1.5px solid rgba(88, 153, 158, .5); border-radius: 18px; background: var(--teal-50);
}

/* ─── شريط تقدم ─── */
.progress { height: 8px; border-radius: 99px; background: var(--stone); }
.progress-bar { background: var(--teal); border-radius: 99px; }

/* ─── بطاقات قوائم قابلة للنقر ─── */
a.row-card { display: block; text-decoration: none; color: inherit; transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s; }
a.row-card:hover { transform: translateY(-2px); border-color: var(--rule-strong); box-shadow: 0 16px 30px -24px rgba(15, 31, 32, .5); color: inherit; }

/* ─── طباعة الفاتورة ─── */
@media print {
    .topbar, .bottom-nav, .no-print, .alert { display: none !important; }
    body { background: #fff; padding: 0; }
    body::before { display: none; }
    .app-main { padding: 0 !important; max-width: 100%; }
    .soft-card { box-shadow: none; border: none; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ─── Alpine ─── */
[x-cloak] { display: none !important; }

/* ─── مؤشرات تقدم متعددة الألوان ─── */
.progress-bar.bar-ok { background: var(--ok); }
.progress-bar.bar-warn { background: var(--warn); }
.progress-bar.bar-bad { background: var(--bad); }

/* ─── مخططات ─── */
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 200px; }

/* ─── عناصر مساعدة ─── */
.tile {
    background: var(--white); border: 1px solid var(--rule);
    border-radius: 12px; padding: .65rem .85rem;
}
.tile .tile-label { font-size: .74rem; color: var(--ink-soft); font-weight: 500; }
.tile .money { font-size: 1.02rem; font-weight: 600; }
.hbar { height: 6px; border-radius: 99px; background: var(--stone); overflow: hidden; }
.hbar > span { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.sticky-filters { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 5; }
.item-card { cursor: pointer; }
.item-card:hover { border-color: var(--rule-strong); }
.kind-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-inline-end: .35rem; flex-shrink: 0; }
.dot-in { background: var(--ok); } .dot-out { background: var(--bad); } .dot-transfer { background: #c99a1c; }
@media (max-width: 575px) { .stat-card .stat-value { font-size: 1.1rem; } }

/* ─── كشف الحساب (البنود) ─── */
.sheet { font-variant-numeric: tabular-nums; font-size: .9rem; }
.sheet th.num, .sheet td.num { text-align: end; white-space: nowrap; font-family: var(--font-mono); }
.sheet thead th.num { font-family: inherit; }
.sheet td, .sheet th { padding: .5rem .8rem; }
.sheet .sheet-name { min-width: 220px; }
.sheet tr.sh-section td { background: var(--stone); font-weight: 700; font-family: var(--font-display); border-top: 1px solid var(--rule-strong); }
.sheet tr.sh-section td.num { font-family: var(--font-mono); font-weight: 600; }
.sheet tr.sh-cat td { font-weight: 600; }
.sheet tr.sh-entry td { font-size: .8rem; color: var(--ink-soft); background: #fafcfb; border-bottom: 1px dashed var(--rule); }
.sheet tr.sh-entry td.num { font-weight: 400; }
.sheet td.pct { color: var(--ink-mute); font-size: .8rem; }
.sheet tbody.sheet-totals tr.sh-subtotal td { border-top: 1.5px solid var(--ink-soft); font-weight: 700; }
.sheet tbody.sheet-totals tr.sh-total td { border-top: 1px solid var(--ink-soft); border-bottom: 3px double var(--ink-soft); font-weight: 700; background: var(--stone-2); }
.sheet tbody.sheet-totals tr.sh-grand td { font-weight: 700; font-size: 1.02rem; background: var(--teal-900); color: var(--paper); border-color: var(--teal-900); }
.sheet tbody.sheet-totals tr.sh-grand td.pct { color: var(--teal-200); }
.sheet tbody.sheet-totals tr.sh-note td { color: var(--warn); font-style: italic; }
@media (max-width: 575px) { .sheet .sheet-name { min-width: 160px; } .sheet { font-size: .82rem; } }
.sheet-wrap { max-width: 1000px; }

/* ─── نافذة منبثقة بسيطة (Alpine) ─── */
.cat-modal-backdrop {
    position: fixed; inset: 0; z-index: 1050; background: rgba(11, 38, 40, .5);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.cat-modal { width: 100%; max-width: 440px; border-radius: var(--radius-lg); box-shadow: var(--shadow-float); }

/* ─── صفائح الإجراءات (جوال) ─── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(11, 38, 40, .45); }
.action-sheet {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 1045; background: var(--paper);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 1.4rem 1rem calc(1rem + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 40px -20px rgba(11, 38, 40, .5);
}
.action-sheet::before {
    content: ""; position: absolute; top: .55rem; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 4px; background: var(--rule-strong);
}
.action-sheet .sheet-title { font-family: var(--font-display); font-weight: 600; margin-bottom: .85rem; text-align: center; color: var(--ink); font-size: .95rem; }
.action-sheet .sheet-main {
    display: flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none;
    background: var(--teal-900); color: var(--paper); font-weight: 700; border-radius: 14px; padding: .95rem; margin-bottom: .6rem;
}
.action-sheet .sheet-main i { color: var(--note); }
.action-sheet .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.action-sheet .sheet-grid a {
    display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; text-align: center;
    color: var(--ink); background: var(--white); border: 1.5px solid var(--rule);
    border-radius: 14px; padding: .85rem .3rem; font-size: .8rem; font-weight: 600; line-height: 1.35;
}
.action-sheet .sheet-grid a:active { border-color: var(--ink); }
.action-sheet .sheet-grid a i { font-size: 1.3rem; color: var(--teal-700); }
.action-sheet .sheet-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── مكونات لوحة العمل اليومي ─── */
.min-w-0 { min-width: 0; }
.kpi {
    display: block; height: 100%; background: var(--white); border: 1px solid var(--rule);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: .95rem 1.05rem;
    text-decoration: none; color: inherit; position: relative; overflow: hidden;
    transition: border-color .2s, transform .25s var(--ease-out), box-shadow .25s;
}
.kpi-link:hover { border-color: var(--rule-strong); color: inherit; transform: translateY(-2px); box-shadow: 0 16px 30px -24px rgba(15, 31, 32, .5); }
.kpi-label { font-size: .8rem; color: var(--ink-soft); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.kpi-label i { color: var(--teal-700); }
.kpi-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; margin: .3rem 0 .15rem; letter-spacing: -.02em; line-height: 1.3; }
.kpi-sub { font-size: .72rem; color: var(--ink-mute); }
/* البطاقة الرئيسية: سطح تركوازي عميق بشبكة لوحة الرسم */
.kpi-main {
    background-color: var(--teal-900); border-color: var(--teal-900); color: var(--paper);
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 24px 24px;
}
.kpi-main .kpi-label, .kpi-main .kpi-label i { color: var(--teal-200); }
.kpi-main .kpi-sub { color: rgba(244, 247, 246, .7); }
.kpi-main.is-bad { background-color: #6e1d17; border-color: #6e1d17; }
.kpi-main.is-bad .kpi-label, .kpi-main.is-bad .kpi-label i { color: #f3c1ba; }
@media (max-width: 575px) { .kpi-value { font-size: 1.15rem; } .kpi { padding: .8rem .85rem; } }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.qa {
    display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .9rem .25rem .75rem;
    background: var(--white); border: 1.5px solid var(--rule); border-radius: var(--radius);
    text-decoration: none; color: var(--ink); font-weight: 600; font-size: .85rem; text-align: center;
    transition: border-color .2s, transform .25s var(--ease-out);
}
/* الأيقونة داخل مربع مدوّر بخط رفيع كإطار الشعار */
.qa i {
    width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.15rem;
    color: var(--teal-700); border: 1.5px solid rgba(88, 153, 158, .5); border-radius: 12px;
}
.qa:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.qa-main { background: var(--teal-900); border-color: var(--teal-900); color: var(--paper); }
.qa-main i { color: var(--note); border-color: rgba(244, 207, 78, .45); }
.qa-main:hover { color: #fff; background: var(--teal-700); border-color: var(--teal-700); }

.section-head {
    display: flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-weight: 600;
    font-size: .95rem; padding: .9rem 1rem .6rem;
}
.section-head i { color: var(--teal-700); }
.section-head a { font-family: var(--font-body); }
.section-title {
    display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display);
    font-weight: 600; font-size: 1rem; margin: .35rem 0 .65rem;
}
.section-title i { color: var(--teal-700); }
.section-title a { font-family: var(--font-body); font-weight: 600; }

.attn-row { display: flex; align-items: center; gap: .65rem; padding: .6rem 1rem; border-top: 1px solid var(--rule); font-size: .88rem; }
.attn-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; background: var(--ink-mute); }
.attn-warn .attn-dot { background: #c99a1c; }
.attn-bad .attn-dot { background: var(--bad); }
.attn-bad .money { color: var(--bad); }
.attn-warn .money { color: var(--warn); }

.feed-row { display: flex; align-items: center; gap: .65rem; padding: .6rem 1rem; border-top: 1px solid var(--rule); font-size: .87rem; }
a.feed-row:hover { background: var(--teal-50); }
.project-card { transition: border-color .2s, box-shadow .25s; }
.project-card:hover { border-color: var(--rule-strong); box-shadow: 0 16px 30px -24px rgba(15, 31, 32, .5); }
.project-card .stretched-link { font-family: var(--font-display); font-weight: 600 !important; }

/* ─── صفحة المشروع ─── */
.quick-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hero-value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.hero-value small { font-family: var(--font-body); font-size: .9rem; color: var(--ink-mute); font-weight: 500; }
.status-pill {
    display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: var(--radius-sm);
    font-size: .82rem; font-weight: 600; text-decoration: none; border: 1px solid transparent;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(143, 98, 16, .2); }
.pill-warn:hover { color: var(--warn); border-color: rgba(143, 98, 16, .45); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-muted { background: var(--stone); color: var(--ink-soft); }
.sticky-tabs { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20; box-shadow: 0 10px 24px -18px rgba(15, 31, 32, .45); }

/* ─── السجل اليومي للمصاريف ─── */
.day-head { display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; background: var(--stone-2); border-radius: var(--radius) var(--radius) 0 0; font-size: .88rem; font-weight: 600; }
.exp-row { display: flex; align-items: center; gap: .65rem; padding: .65rem .5rem .65rem 1rem; border-top: 1px solid var(--rule); }
.exp-row:hover { background: var(--teal-50); }
.exp-row .money { font-size: .95rem; }

/* لون التحذير الافتراضي في Bootstrap فاتح جداً على الأبيض */
.text-warning { color: var(--warn) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.group-head { display: flex; justify-content: space-between; padding: 1rem 1rem .5rem; font-family: var(--font-display); font-weight: 600; }

/* إجراءات المشروع: أزرار عريضة على الجوال، مدمجة على الشاشات الكبيرة */
@media (min-width: 992px) {
    .quick-grid.cols-3 { display: flex; gap: .5rem; }
    .quick-grid.cols-3 .qa { flex-direction: row; gap: .5rem; padding: .5rem 1.1rem .5rem .9rem; font-size: .9rem; border-radius: 12px; }
    .quick-grid.cols-3 .qa i { width: auto; height: auto; border: 0; font-size: 1.05rem; }
}

/* ─── ملخص حساب المشروع: «كتلة العنوان» كزاوية لوحة الرسم الهندسي ─── */
.acct-card { padding: 0; overflow: hidden; border: 1.5px solid var(--ink); box-shadow: none; }
.acct-title {
    display: flex; align-items: center; gap: .55rem;
    font-family: var(--font-display); font-size: .82rem; font-weight: 600; color: var(--ink);
    padding: .6rem 1rem; background: var(--stone);
}
.acct-title::before { content: ""; width: 9px; height: 9px; border: 2px solid var(--teal); border-radius: 3px; flex-shrink: 0; }
.acct-card > .acct-title[style] { border-top: 1.5px solid var(--ink) !important; }
.acct { display: flex; flex-direction: column; }
.acct-cell {
    position: relative; display: grid; grid-template-columns: 1fr auto;
    grid-template-areas: "label value" "sub value"; align-items: center; column-gap: .75rem;
    padding: .65rem 1rem; border-top: 1px solid var(--rule-strong); background: var(--white);
}
.acct-label { grid-area: label; font-size: .86rem; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: .45rem; }
.acct-value { grid-area: value; font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-value small { font-family: var(--font-body); font-size: .7rem; font-weight: 500; color: var(--ink-mute); }
.acct-value .money { font-weight: inherit; }
.acct-sub { grid-area: sub; font-size: .74rem; color: var(--ink-mute); }
.acct-action { color: var(--warn); font-weight: 600; text-decoration: none; }
.acct-action:hover { color: var(--warn); text-decoration: underline; }
/* علامة العملية (+ = −) قبل العنوان، في مربع مدوّر */
.acct-cell[data-op] .acct-label::before {
    content: attr(data-op); display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 6px; background: var(--stone); color: var(--ink);
    font-family: var(--font-mono); font-size: .8rem; font-weight: 600; flex-shrink: 0;
}
.acct-cell[data-op="+"] .acct-label::before { content: "+"; }
.acct-cell[data-op="="] .acct-label::before { content: "="; }
.acct-cell[data-op="−"] .acct-label::before { content: "−"; }
.acct-result { background: var(--teal-50); }
.acct-result .acct-label { color: var(--ink); }
.acct-result.is-warn { background: var(--warn-soft); }
.acct-result.is-warn .acct-value { color: var(--warn); }
.acct-result.is-ok { background: var(--ok-soft); }
.acct-result.is-ok .acct-value { color: var(--ok); }
.acct-result.is-bad { background: var(--bad-soft); }
.acct-result.is-bad .acct-value { color: var(--bad); }

/* الشاشات الكبيرة: صف واحد أفقي، والعلامة مربع مدوّر على الحد بين الخانات */
@media (min-width: 992px) {
    .acct { flex-direction: row; border-top: 1px solid var(--rule-strong); }
    .acct-cell {
        flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
        gap: .2rem; padding: .9rem 1.15rem; border-top: 0;
    }
    .acct-cell + .acct-cell { border-inline-start: 1px solid var(--rule-strong); }
    .acct-value { font-size: 1.35rem; }
    .acct-cell[data-op] .acct-label::before {
        position: absolute; inset-inline-start: -12px; top: 50%; transform: translateY(-50%);
        width: 23px; height: 23px; background: var(--white); border: 1.5px solid var(--ink); z-index: 1;
    }
}

/* الأرقام السالبة: الإشارة تظهر يسار الرقم داخل النص العربي */
span.money { direction: ltr; unicode-bidi: isolate; }
div.money, td.money { unicode-bidi: plaintext; }

/* ─── الجداول على الجوال: كل صف يصبح عنصراً من سطرين ─── */
@media (max-width: 575.98px) {
    .table.m-list thead { display: none; }
    .table.m-list, .table.m-list > tbody, .table.m-list > tfoot { display: block; width: 100%; }
    .table.m-list tr {
        display: flex; flex-wrap: wrap; align-items: center; column-gap: .6rem; row-gap: .15rem;
        padding: .65rem .9rem; border-top: 1px solid var(--rule);
    }
    .table.m-list > tbody > tr:first-child { border-top: 0; }
    .table.m-list tr::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
    .table.m-list td {
        display: block; padding: 0 !important; border: 0 !important;
        background: transparent !important; box-shadow: none !important;
    }
    .table.m-list td:empty, .table.m-list td.m-hide { display: none; }
    .table.m-list td.m-main { order: 1; flex: 1 1 0; min-width: 0; font-weight: 600; }
    .table.m-list td.m-amt { order: 2; flex: 0 0 auto; text-align: end; white-space: nowrap; }
    .table.m-list td.m-act { order: 3; flex: 0 0 auto; }
    .table.m-list td.m-sub { order: 5; flex: 0 1 auto; font-size: .76rem; color: var(--ink-mute); max-width: 100%; }
    .table.m-list td.m-sub[data-label]::before { content: attr(data-label) " "; }
    .table.m-list td.m-sub .badge { font-size: .68rem; }
    .table.m-list > tfoot > tr { background: var(--stone-2); font-weight: 700; }
    .table.m-list td[colspan]:not(.m-main):not(.m-amt):not(.text-center) { display: none; }
    .table.m-list td.text-center { flex-basis: 100%; }

    /* فلتر الفترة في المالية */
    .period-dates { width: 100%; }
    .period-dates input { flex: 1 1 0; min-width: 0; }
}

/* ─── تضييق المسافات على الجوال ─── */
@media (max-width: 575.98px) {
    :root { --topbar-h: 58px; }
    .quick-grid { gap: .45rem; }
    .qa { padding: .75rem .2rem .6rem; font-size: .78rem; }
    .qa i { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 11px; }
    .quick-grid.cols-3 .qa { flex-direction: row; justify-content: center; gap: .4rem; padding: .6rem .25rem; font-size: .8rem; }
    .quick-grid.cols-3 .qa i { width: auto; height: auto; border: 0; font-size: 1rem; }
    .acct-title { padding: .5rem .9rem; }
    .acct-cell { padding: .5rem .9rem; }
    .acct-value { font-size: 1.02rem; }
    .acct-label { font-size: .82rem; }
    .acct-sub { font-size: .7rem; }
    .acct-cell[data-op] .acct-label::before { width: 18px; height: 18px; font-size: .72rem; }
    .page-head h1, h1.fs-4 { font-size: 1.25rem !important; }
    .brand-logo { width: 34px; height: 34px; }
    .table.m-list td.m-main .small, .table.m-list td.m-main .text-secondary { font-weight: 400; }
}
@media (max-width: 359.98px) {
    .sheet .sheet-name { min-width: 0; }
    .sheet td, .sheet th { padding: .4rem .45rem; }
    .sheet { font-size: .78rem; }
    .kpi-value { font-size: 1rem; }
}

/* ─── من أضاف / عدّل ─── */
.audit-footer { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--rule-strong); font-size: .78rem; color: var(--ink-mute); line-height: 1.8; }
.audit-footer strong { color: var(--ink-soft); }
.by { color: var(--ink-mute); font-size: .74rem; white-space: nowrap; }
.by i { font-size: .7rem; }
.log-row { padding: .75rem 1rem; border-top: 1px solid var(--rule); font-size: .88rem; }
.log-row:first-child { border-top: 0; }
.log-badge { font-size: .7rem; font-weight: 700; padding: .2rem .5rem; border-radius: 7px; flex-shrink: 0; margin-top: .15rem; }
.log-create { background: var(--ok-soft); color: var(--ok); }
.log-update { background: var(--warn-soft); color: var(--warn); }
.log-delete { background: var(--bad-soft); color: var(--bad); }
.log-changes { margin: .5rem 0 0; padding: .55rem .8rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-sm); font-size: .8rem; line-height: 1.9; overflow-wrap: anywhere; }

/* ─── قائمة الأصناف القابلة للبحث ─── */
.combo-native { display: none !important; }
.combo { position: relative; }
.combo-toggle { text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.combo-panel {
    position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 1060;
    background: var(--white); border: 1px solid var(--rule); border-radius: 14px;
    box-shadow: var(--shadow-float); overflow: hidden;
}
.combo-search { position: relative; padding: .5rem; border-bottom: 1px solid var(--rule); }
.combo-search i { position: absolute; inset-inline-start: 1.15rem; top: 50%; transform: translateY(-50%); color: var(--ink-mute); }
.combo-search input { padding-inline-start: 2.1rem; min-height: 42px; font-size: 16px; }  /* 16px يمنع تكبير iOS */
.combo-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.combo-group { font-size: .72rem; font-weight: 700; color: var(--ink-mute); padding: .5rem .9rem .25rem; background: var(--stone-2); position: sticky; top: 0; }
.combo-group.is-other { color: var(--warn); }
.combo-opt { padding: .55rem .9rem; cursor: pointer; display: flex; align-items: center; gap: .35rem; font-size: .92rem; }
.combo-opt.is-active { background: var(--teal-50); }
.combo-opt.is-selected { font-weight: 700; color: var(--teal-900); }
.combo-opt.is-selected::after { content: "✓"; margin-inline-start: auto; color: var(--teal-700); }
.combo-clear { color: var(--ink-mute); border-bottom: 1px solid var(--rule); }
.combo-type { margin-inline-start: auto; font-size: .68rem; font-weight: 600; background: var(--warn-soft); color: var(--warn); padding: .1rem .45rem; border-radius: 6px; }
.combo-empty { padding: .9rem; text-align: center; color: var(--ink-mute); font-size: .85rem; }
.combo-new {
    display: flex; align-items: center; gap: .4rem; width: 100%; border: 0; border-top: 1px solid var(--rule);
    background: var(--teal-50); color: var(--teal-900); font-weight: 600; padding: .7rem .9rem; text-align: start;
}
.combo-new:hover { background: var(--teal-100); }
@media (max-width: 575.98px) { .combo-list { max-height: 45vh; } }
#div_id_category { margin-bottom: .35rem !important; }

/* ─── دفعات الزبون: مفتاح الاتجاه (+ دفعة / − سحب) ─── */
.kind-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; background: var(--stone); border-radius: 14px; }
.kind-opt {
    display: flex; align-items: center; justify-content: center; gap: .45rem; margin: 0;
    padding: .65rem .5rem; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: .9rem;
    color: var(--ink-soft); transition: background-color .2s, color .2s, box-shadow .2s; text-align: center;
}
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-sign {
    width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 600; background: var(--white); color: var(--ink-mute); flex-shrink: 0;
}
.kind-opt:has(input:checked) { background: var(--white); box-shadow: 0 1px 3px rgba(15, 31, 32, .1); }
.kind-in:has(input:checked) { color: var(--ok); }
.kind-in:has(input:checked) .kind-sign { background: var(--ok); color: #fff; }
.kind-out:has(input:checked) { color: var(--bad); }
.kind-out:has(input:checked) .kind-sign { background: var(--bad); color: #fff; }
.kind-opt:has(input:focus-visible) { outline: 2px solid var(--teal-700); outline-offset: 2px; }
/* لون القيمة يتبع الاتجاه */
form:has(.kind-in input:checked) #id_amount { color: var(--ok); font-weight: 700; }
form:has(.kind-out input:checked) #id_amount { color: var(--bad); font-weight: 700; }
#id_amount { font-family: var(--font-mono); }

.pay-sign { font-weight: 700; font-family: var(--font-mono); }
.pay-row-out td { background: #fdf5f4; }
.btn-withdraw { --bs-btn-color: var(--bad); --bs-btn-bg: #fdf4f2; --bs-btn-border-color: rgba(179, 38, 30, .25); --bs-btn-hover-color: var(--bad); --bs-btn-hover-bg: var(--bad-soft); --bs-btn-hover-border-color: var(--bad); }
.btn-withdraw i { color: var(--bad); }
@media (max-width: 575.98px) { .table.m-list tr.pay-row-out { background: #fdf5f4; } }

/* ─── رأس المستندات المطبوعة (فاتورة / إيصال): كتلة العنوان ─── */
.doc-head {
    display: grid; grid-template-columns: 1fr auto; border: 1.5px solid var(--ink);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem;
}
.doc-brand { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.25rem; }
.doc-brand .brand-logo { width: 54px; height: 54px; }
.doc-brand .brand-name { font-size: 1.35rem; }
.doc-brand .brand-latin { font-family: var(--font-mono); font-size: .78rem; font-weight: 500; color: var(--ink-mute); margin-inline-start: .4rem; }
.doc-meta { display: grid; align-content: center; gap: .1rem; padding: 1rem 1.25rem; background: var(--stone); border-inline-start: 1px solid var(--rule-strong); min-width: 210px; }
.doc-type { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.doc-meta .mono { font-family: var(--font-mono); font-weight: 600; }
@media (max-width: 575.98px) {
    .doc-head { grid-template-columns: 1fr; }
    .doc-meta { border-inline-start: 0; border-top: 1px solid var(--rule-strong); min-width: 0; }
}

/* ═══════════════ صفحة الدخول ═══════════════ */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-form-side { display: grid; place-items: center; padding: 2rem 1.25rem; position: relative; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { margin-bottom: 2.25rem; }
.auth-card .brand-logo { width: 46px; height: 46px; }
.auth-eyebrow {
    display: inline-flex; align-items: center; gap: .6rem; font-size: .85rem; font-weight: 600; color: var(--teal-700); margin-bottom: .5rem;
}
.auth-eyebrow::before { content: ""; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 3px; }
.auth-title { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.35; margin-bottom: .4rem; }
.auth-lead { color: var(--ink-soft); margin-bottom: 1.75rem; }
.auth-card .form-control { min-height: 50px; }
.auth-foot { margin-top: 2rem; font-size: .8rem; color: var(--ink-mute); }
.auth-foot .mono { font-family: var(--font-mono); }

.auth-art {
    position: relative; overflow: hidden; color: var(--paper);
    background-color: var(--teal-900);
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 32px 32px;
    display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 4vw, 3.5rem);
}
.auth-art-mark { position: absolute; width: 74%; aspect-ratio: 1; inset-inline-end: -16%; bottom: -14%; color: rgba(88, 153, 158, .18); fill: currentColor; }
.auth-art-frame { position: absolute; inset: clamp(1rem, 2vw, 1.5rem); border: 1.5px solid rgba(159, 208, 211, .2); border-radius: var(--radius-lg); pointer-events: none; }
.auth-art-top { position: relative; display: flex; align-items: center; gap: .75rem; }
.auth-art-top .brand-logo { color: var(--teal); width: 44px; height: 44px; }
.auth-art-top .brand-name { color: var(--paper); }
.auth-art-top .brand-sub { color: rgba(244, 247, 246, .6); }
.auth-art-body { position: relative; max-width: 30rem; }
.auth-art-body .auth-eyebrow { color: var(--teal-200); }
.auth-art-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.3; margin-bottom: 1rem; }
.auth-art-title span { color: var(--teal-200); }
.auth-art-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; color: rgba(244, 247, 246, .78); }
.auth-art-list li { display: flex; align-items: baseline; gap: .7rem; }
.auth-art-list li::before { content: ""; width: 9px; height: 9px; flex-shrink: 0; border: 2px solid var(--teal); border-radius: 3px; transform: translateY(-1px); }
.auth-note {
    position: absolute; inset-inline-start: clamp(2rem, 4vw, 3.5rem); top: 32%;
    width: 132px; aspect-ratio: 1; padding: 14px; display: grid; place-items: center; text-align: center;
    background: var(--note); color: var(--ink);
    font-family: var(--font-note); font-weight: 700; font-size: 1.55rem; line-height: 1.4;
    box-shadow: 0 22px 30px -20px rgba(0, 0, 0, .55), inset 0 -10px 18px -12px rgba(120, 90, 0, .25);
    transform: rotate(5deg);
    animation: note-in .9s cubic-bezier(.3, 1.4, .5, 1) .3s both;
}
@keyframes note-in { from { opacity: 0; transform: translateY(-24px) rotate(14deg) scale(.9); } }
@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-art { order: -1; padding: 1.25rem 1.25rem 1.5rem; min-height: 0; }
    .auth-art-body, .auth-note, .auth-art-frame { display: none; }
    .auth-art-mark { width: 220px; inset-inline-end: -50px; bottom: -90px; }
    .auth-form-side { align-items: start; padding-top: 2.25rem; }
    .auth-card .brand { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════ فاتورة شراء: تبويب التسجيل وصفوف البنود ═══════════════ */
.entry-tabs a { flex: 1 1 0; justify-content: center; }
.mono-input { font-family: var(--font-mono); }
.mono-cell { font-family: var(--font-mono); font-size: .85rem; }

/* شارة الفاتورة في جداول المصاريف: حدّ متساوٍ وصبغة خفيفة */
.inv-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .5rem; max-width: 100%;
    background: var(--teal-50); border: 1px solid rgba(46, 106, 111, .28); border-radius: 8px;
    color: var(--teal-900); font-size: .78rem; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background-color .2s, border-color .2s;
}
.inv-chip i { color: var(--teal-700); font-size: .8rem; }
.inv-chip span { font-family: var(--font-mono); font-weight: 600; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.inv-ref { font-family: var(--font-mono); font-weight: 500; unicode-bidi: plaintext; }
.inv-chip small { color: var(--ink-mute); font-weight: 500; font-size: .92em; }
.inv-chip:hover { background: var(--teal-100); border-color: var(--teal-700); color: var(--teal-900); }

.inv-head-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; padding: 1rem 1rem .75rem; }
.inv-grid-head, .inv-line {
    display: grid; align-items: center; column-gap: .4rem;
    grid-template-columns: 1.5rem 6.2rem minmax(10rem, 1.5fr) minmax(7rem, 1.2fr) 5rem 5.4rem 5.8rem 7rem 1.9rem;
}
.inv-grid-head {
    padding: .45rem 1rem; background: var(--stone-2); border-block: 1px solid var(--rule);
    font-size: .76rem; font-weight: 600; color: var(--ink-soft);
}
.inv-grid-head span:first-child { grid-column: 2; }
.inv-line { padding: .5rem 1rem; border-bottom: 1px solid var(--rule); }
.inv-line.has-error { background: var(--bad-soft); }
.inv-num { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-mute); text-align: center; }
.inv-label { display: none; font-size: .74rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .2rem; }
.inv-f { min-width: 0; }
.inv-line .form-control, .inv-line .form-select { min-height: 40px; padding-top: .35rem; padding-bottom: .35rem; font-size: .9rem; }
.inv-line .form-control { padding-inline: .55rem; }
.inv-line .form-select { padding-right: .55rem; padding-left: 1.8rem; background-position: left .5rem center; }
.inv-line .combo-panel { min-width: 300px; }
.inv-line .combo-search input { padding-inline-start: 2.1rem; padding-inline-end: .75rem; min-height: 42px; font-size: 16px; }
.inv-line .mono-input { text-align: end; direction: ltr; }
.inv-amount { font-weight: 600; }
.inv-remove {
    width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px;
    background: transparent; color: var(--ink-mute); transition: background-color .2s, color .2s;
}
.inv-remove:hover { background: var(--bad-soft); color: var(--bad); }
.inv-errors { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .75rem; color: var(--bad); font-size: .8rem; padding-top: .3rem; }
.inv-add-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; }
.inv-total {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
    padding: .85rem 1rem; background: var(--stone); border-top: 1px solid var(--rule-strong);
    border-radius: 0 0 var(--radius) var(--radius);
}
.inv-total-label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.inv-total-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.inv-total-value small { font-family: var(--font-body); font-size: .75rem; font-weight: 500; color: var(--ink-mute); }
.inv-total-value .money { font-weight: inherit; }
.inv-breakdown { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-soft); }
.inv-breakdown .badge { font-size: .8rem; }
.inv-meta-value { font-family: var(--font-body); font-size: 1rem !important; }

/* تحت الشاشات الكبيرة: كل بند بطاقة من صفوف */
@media (max-width: 1199.98px) {
    .inv-grid-head { display: none; }
    .inv-line {
        position: relative; column-gap: .5rem; row-gap: .5rem; padding: .85rem 1rem;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-areas: "type type cat cat cat cat" "details details details details details details" "qty qty unit unit price price" "amount amount amount amount amount amount";
    }
    .inv-label { display: block; }
    .inv-num { position: absolute; top: .3rem; inset-inline-start: .35rem; font-size: .68rem; }
    .inv-f-type { grid-area: type; } .inv-f-cat { grid-area: cat; } .inv-f-details { grid-area: details; }
    .inv-f-qty { grid-area: qty; } .inv-f-unit { grid-area: unit; } .inv-f-price { grid-area: price; } .inv-f-amount { grid-area: amount; }
    .inv-remove { position: absolute; top: .3rem; inset-inline-end: .4rem; }
    .inv-line .combo-panel { min-width: 0; }
    .inv-errors { grid-column: 1 / -1; }
    .inv-line .form-control, .inv-line .form-select { font-size: 16px; }  /* 16px يمنع تكبير iOS */
}
@media (min-width: 768px) and (max-width: 1199.98px) {
    .inv-line {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-areas:
            "type type cat cat cat cat cat details details details details details"
            "qty qty qty unit unit unit price price price amount amount amount";
    }
}

/* شاشة السماح بالوصول (OAuth) */
.consent { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.consent-card { width: 100%; max-width: 480px; padding: 1.75rem; border-radius: var(--radius-lg); }
.consent-title { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; margin-bottom: .5rem; }
.consent-box { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.consent-uri { direction: ltr; text-align: left; font-size: .8rem; white-space: normal; overflow-wrap: anywhere; }
.consent-list { list-style: none; padding: 0; display: grid; gap: .4rem; }
.consent-list li { display: flex; align-items: baseline; gap: .55rem; }
.consent-list i { color: var(--teal-700); flex-shrink: 0; }
.consent-no i { color: var(--ink-mute); }

/* ─── المستخدمون والأدوار والصلاحيات ─── */
/* صورة رمزية: مربع مدوّر كإطار الشعار، بالحرف الأول من الاسم */
.avatar {
    width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
    display: inline-grid; place-items: center;
    background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-100);
    font-family: var(--font-display); font-weight: 700; font-size: .95rem; line-height: 1;
}
.avatar-sm { width: 28px; height: 28px; border-radius: 9px; font-size: .8rem; }
.avatar.is-owner { background: var(--teal-900); color: var(--note); border-color: var(--teal-900); }
.avatar.is-off { background: var(--stone); color: var(--ink-mute); border-color: var(--rule); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--white); }
.avatar-stack .avatar + .avatar { margin-inline-start: -8px; }
.account-btn { padding: .15rem; text-decoration: none; }
.account-menu { min-width: 220px; }

.user-cell { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.user-cell .who { min-width: 0; }
.user-cell .handle { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-mute); direction: ltr; unicode-bidi: plaintext; }
.scope-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.scope-chip {
    display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 500;
    padding: .12rem .45rem; border-radius: 7px; background: var(--stone-2); border: 1px solid var(--rule); color: var(--ink-soft);
}
.scope-chip.is-all { background: var(--teal-50); border-color: var(--teal-100); color: var(--teal-700); }

/* بطاقات الأدوار */
.role-card { display: flex; flex-direction: column; height: 100%; padding: 1.1rem 1.15rem; }
.role-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 0; }
.role-lines { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .35rem; font-size: .84rem; }
.role-lines li { display: grid; grid-template-columns: 1.1rem 1fr; gap: .45rem; align-items: baseline; }
.role-lines i { color: var(--teal-700); }
.role-lines .area { font-weight: 600; }
.role-lines .acts { color: var(--ink-soft); }
.role-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .7rem; }
.role-tag {
    display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600;
    padding: .18rem .5rem; border-radius: 8px; background: var(--teal-50); color: var(--teal-700);
}
.role-tag.is-sensitive { background: var(--warn-soft); color: var(--warn); }
.role-card-foot { margin-top: auto; padding-top: .9rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.how-steps { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.how-step { display: flex; gap: .65rem; align-items: flex-start; }
.how-step .num {
    width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center;
    border: 1.5px solid var(--teal-700); color: var(--teal-700); font-family: var(--font-mono); font-weight: 600; font-size: .8rem;
}

/* اختيار الدور في نموذج المستخدم */
.role-options { display: grid; gap: .5rem; }
.role-option {
    display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; margin: 0;
    padding: .75rem .85rem; border: 1.5px solid var(--rule-strong); border-radius: 12px; background: var(--white);
    transition: border-color .15s, background-color .15s;
}
.role-option:hover { border-color: var(--ink-soft); }
.role-option:has(input:checked) { border-color: var(--teal-700); background: var(--teal-50); }
.role-option input { margin-top: .3rem; flex: 0 0 auto; }
.role-option .name { font-weight: 700; }
.role-option .desc { font-size: .8rem; color: var(--ink-soft); }

/* اختيار المشاريع */
.project-pick { max-height: 320px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 12px; }
.project-pick label {
    display: flex; align-items: center; gap: .6rem; margin: 0; padding: .55rem .75rem; cursor: pointer;
    border-bottom: 1px solid var(--rule);
}
.project-pick label:last-child { border-bottom: 0; }
.project-pick label:hover { background: var(--stone-2); }
.project-pick input { margin: 0; flex: 0 0 auto; }

/* ملخص «ماذا سيرى» */
.preview-card { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.preview-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .86rem; }
.preview-list li { display: grid; grid-template-columns: 1.1rem 1fr; gap: .5rem; align-items: baseline; }
.preview-list .yes { color: var(--ok); }
.preview-list .no { color: var(--ink-mute); }
.preview-list li.is-no { color: var(--ink-mute); }

/* مصفوفة الصلاحيات */
.perm-grid { display: grid; }
.perm-head, .perm-row {
    display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(4, minmax(0, 1fr)); gap: .5rem;
    align-items: center; padding: .7rem 1rem;
}
.perm-head {
    background: var(--stone); font-size: .78rem; font-weight: 700; color: var(--ink-soft);
    border-radius: 12px 12px 0 0;
}
.perm-head > div:not(:first-child), .perm-row .perm-cell { text-align: center; }
.perm-row { border-top: 1px solid var(--rule); }
.perm-area { display: flex; gap: .6rem; align-items: flex-start; min-width: 0; }
.perm-area > i { color: var(--teal-700); font-size: 1.05rem; margin-top: .1rem; }
.perm-area .name { font-weight: 700; }
.perm-area .hint { font-size: .76rem; color: var(--ink-mute); }
.perm-cell .cell-label { display: none; }
.perm-cell .na { color: var(--ink-mute); }

/* ثلاث حالات: لا / ما أضافه / الكل */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--stone); border-radius: 10px; }
.seg button {
    border: 0; background: transparent; color: var(--ink-soft); font-size: .74rem; font-weight: 600;
    padding: .25rem .5rem; border-radius: 7px; white-space: nowrap; line-height: 1.3;
}
.seg button:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.seg button.on { background: var(--teal-900); color: var(--paper); }
.seg button.on.own { background: var(--white); color: var(--teal-700); box-shadow: inset 0 0 0 1.5px var(--teal-700); }
.seg button.on.none { background: var(--white); color: var(--ink-soft); box-shadow: 0 1px 2px rgba(15, 31, 32, .12); }
@media (max-width: 991.98px) {
    .perm-head { display: none; }
    .perm-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: .6rem; }
    .perm-area { grid-column: 1 / -1; }
    .perm-row .perm-cell { text-align: start; display: flex; align-items: center; justify-content: space-between; gap: .4rem;
        background: var(--stone-2); border-radius: 10px; padding: .4rem .55rem; }
    .perm-cell .cell-label { display: inline; font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
    .perm-cell.is-na { display: none; }
}

.perm-special { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid var(--rule); margin: 0; cursor: pointer; }
.perm-special:first-child { border-top: 0; }
.perm-special > i { color: var(--teal-700); font-size: 1.05rem; margin-top: .1rem; }
.perm-special .body { flex: 1 1 auto; min-width: 0; }
.perm-special .name { font-weight: 700; }
.perm-special .hint { font-size: .78rem; color: var(--ink-mute); }
.perm-special .sw { margin-top: .15rem; }
.perm-tools { display: flex; flex-wrap: wrap; gap: .4rem; }

.save-bar {
    position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .75rem;
    margin-top: 1rem; padding: .75rem 1rem; background: rgba(255, 255, 255, .96); border: 1px solid var(--rule);
    border-radius: var(--radius); box-shadow: var(--shadow-float);
}
@media (max-width: 991.98px) { .save-bar { bottom: calc(64px + env(safe-area-inset-bottom)); } }

/* فريق المشروع */
.team-row { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-top: 1px solid var(--rule); margin: 0; cursor: pointer; }
.team-row:first-child { border-top: 0; }
.team-row.is-full { cursor: default; }


/* صفحات الرفض */
.deny { max-width: 520px; margin: 3rem auto; text-align: center; padding: 2.25rem 1.5rem; }
.deny > i {
    width: 64px; height: 64px; border-radius: 20px; display: inline-grid; place-items: center; font-size: 1.8rem;
    border: 1.5px solid var(--teal-700); color: var(--teal-700); margin-bottom: 1rem;
}
.deny h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.exp-row-spacer { width: 30px; flex: 0 0 auto; }
.scope-toggle .kind-opt:has(input:checked) { color: var(--teal-900); }
.scope-toggle .kind-opt i { color: var(--teal-700); }

/* مفتاح تشغيل: المقبض يمين (لا) ويسار (نعم) كما في Bootstrap RTL */
.form-check-input.sw {
    width: 2.5em; height: 1.4em; margin: 0; float: none; flex: 0 0 auto; cursor: pointer;
    border-radius: 2em; background-color: var(--stone); border: 1.5px solid var(--rule-strong);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23627476'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-size: contain; background-position: right center;
    transition: background-position .18s var(--ease-out), background-color .15s;
}
.form-check-input.sw:checked {
    background-color: var(--teal-900); border-color: var(--teal-900); background-position: left center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
}
@media (prefers-reduced-motion: reduce) { .form-check-input.sw { transition: none; } }

/* إجراء سريع واحد أو اثنان: بعرض السطر */
.quick-grid.cols-1 { grid-template-columns: 1fr; }
.quick-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.quick-grid.cols-1 .qa { flex-direction: row; justify-content: center; gap: .7rem; padding: .75rem 1rem; font-size: .95rem; }
.quick-grid.cols-1 .qa i { width: 34px; height: 34px; }
@media (min-width: 768px) { .quick-grid.cols-1 { grid-template-columns: minmax(0, 340px); } }
