/* =======================================================
   Glass UI Theme (Refined) — RTL, Performance-Tuned
   - Consistent components (cards, inputs, buttons, tables)
   - Lighter blur, graceful fallback when backdrop-filter unsupported
   - Fixed <select> colors (bg/text), focus rings, and spacing scale
   - Works with classes used in project: .form-grid .cols-*, .span-*
   ======================================================= */

/* -------- Theme Variables -------- */
:root {

    --site-bg-image: url('/assets/images/bg.png');
    --site-bg-image: url('/assets/images/bg.jpg');
    --site-bg-overlay: rgba(6, 10, 18, .60);
    /* شدّة التعتيم فوق الصورة */
    /* Palette */
    --color-primary: #0ea5e9;
    /* Light teal/sky */
    --color-secondary: #0f7883;
    /* Teal-2 (kept for compatibility) */
    --color-accent: #f4c542;
    --color-warning: #b08d5b;
    --color-ok: #22c55e;
    --color-warn: #f59e0b;
    --color-danger: #ef4444;

    --teal: #0d6771;
    --teal-2: #0f7883;
    --gold: #f5c242;

    /* Surfaces */
    --bg: #0b0e12;
    /* page background */
    --text: #f4f6fb;
    --muted: #c7cfdd;
    --line: rgba(255, 255, 255, .25);

    /* Glass Tokens */
    --glass-bg: rgba(255, 255, 255, .10);
    --glass-border: rgba(255, 255, 255, .35);
    --glass-shadow: rgba(0, 0, 0, .35);
    --glass-blur: 12px;

    /* Layout */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --h-field: 42px;
    --h-field-sm: 34px;

    /* Elevation */
    --shadow-1: 0 6px 18px rgba(0, 0, 0, .22);
    --shadow-2: 0 10px 28px rgba(0, 0, 0, .28);
}



* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    padding: 0;
    direction: rtl;
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

    /* ترتيب الطبقات من الأعلى إلى الأسفل */
    background:
        linear-gradient(0deg, var(--site-bg-overlay), var(--site-bg-overlay)),
        /* تغميق */
        radial-gradient(1200px 800px at 100% -200px, rgba(14, 165, 233, .15), transparent 60%),
        /* تدرّجك 1 */
        radial-gradient(1400px 900px at -10% 120%, rgba(245, 194, 66, .07), transparent 65%),
        /* تدرّجك 2 */
        var(--site-bg-image) center/cover no-repeat,
        /* الصورة */
        var(--bg);
    /* لون احتياطي */
    /* لا نستخدم fixed لتجنّب مشاكل الموبايل */
}

/* Links */
a {
    color: inherit;
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

/* Containers */
.container {
    width: min(1100px, 94vw);
    margin-inline: auto;
    padding: 16px
}

/* Topbar / Navbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-1);
}

.topbar .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px
}

.brand {
    font-weight: 800;
    letter-spacing: .2px;
    color: var(--color-primary)
}

/* Cards */
.card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 16px;
    margin: 10px 0;
}

.card .title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px
}

/* Forms */
label {
    display: block;
    margin: 0 0 6px 6px;
    font-size: .95rem;
    color: var(--muted)
}

input,
select,
textarea {
    width: 100%;
    height: var(--h-field);
    padding: 0 12px;
    background: rgba(17, 20, 26, .40);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    outline: none;
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) * .4));
    backdrop-filter: blur(calc(var(--glass-blur) * .4));
}

select {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .00));
    color: var(--text);
}

textarea {
    min-height: 110px;
    padding: 10px 12px;
    resize: vertical
}

input::placeholder,
textarea::placeholder {
    color: #cbd3e1
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(14, 165, 233, .65);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .25);
}

/* Form grid */
.form-grid {
    display: grid;
    gap: 12px
}

.form-grid.cols-4 {
    grid-template-columns: 2fr 1fr 1fr 1fr
}

.form-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr
}

.form-grid.cols-2 {
    grid-template-columns: 1fr 1fr
}

.span-2 {
    grid-column: span 2
}

.span-3 {
    grid-column: span 3
}

@media (max-width: 992px) {

    .form-grid.cols-4,
    .form-grid.cols-3 {
        grid-template-columns: 1fr 1fr
    }

    .span-3 {
        grid-column: 1/-1
    }
}

@media (max-width: 640px) {

    .form-grid.cols-4,
    .form-grid.cols-3,
    .form-grid.cols-2 {
        grid-template-columns: 1fr
    }

    .span-2 {
        grid-column: 1/-1
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--h-field);
    padding: 0 14px;
    gap: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02));
    color: var(--text);
    transition: transform .06s, filter .15s, box-shadow .15s;
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) * .5));
    backdrop-filter: blur(calc(var(--glass-blur) * .5));
}

.btn:hover {
    filter: brightness(1.08)
}

.btn:active {
    transform: translateY(1px)
}

.btn-sm {
    height: var(--h-field-sm);
    padding: 0 10px;
    border-radius: 10px;
    font-size: .9rem
}

.btn-primary {
    background: linear-gradient(180deg, rgba(14, 165, 233, .95), rgba(2, 132, 199, .92));
    border-color: rgba(14, 165, 233, .85);
    color: #04131a;
    box-shadow: 0 8px 20px rgba(14, 165, 233, .25);
}

.btn-primary:hover {
    filter: brightness(1.03)
}

.btn-danger {
    background: linear-gradient(180deg, rgba(239, 68, 68, .95), rgba(185, 28, 28, .92));
    border-color: rgba(239, 68, 68, .85);
    box-shadow: 0 8px 20px rgba(239, 68, 68, .22);
}

.btn-ghost {
    background: transparent;
    border-color: transparent
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .07)
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 12px
}

.breadcrumbs {
    color: var(--muted);
    font-size: .95rem
}

/* Tables */
.table-container {
    position: relative;
    overflow: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 700px
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: right;
    padding: 12px 12px;
    color: var(--muted);
    background: rgba(17, 20, 26, .60);
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) * .5));
    backdrop-filter: blur(calc(var(--glass-blur) * .5));
    border-bottom: 1px solid var(--glass-border);
}

/* زوايا رأس الجدول (RTL/LTR) */
html[dir="rtl"] .table-container thead th:first-child {
    border-top-right-radius: var(--radius-lg);
}

html[dir="rtl"] .table-container thead th:last-child {
    border-top-left-radius: var(--radius-lg);
}

html[dir="ltr"] .table-container thead th:first-child {
    border-top-left-radius: var(--radius-lg);
}

html[dir="ltr"] .table-container thead th:last-child {
    border-top-right-radius: var(--radius-lg);
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: rgba(17, 20, 26, .30)
}

tbody tr:nth-child(odd) td {
    background: rgba(17, 20, 26, .24)
}

tbody tr:hover td {
    background: rgba(17, 20, 26, .36)
}

.num {
    text-align: left
}

.th-actions {
    width: 160px
}

td.actions .btn-group {
    display: flex;
    gap: 8px;
    white-space: nowrap
}

td.actions form {
    display: contents
}

.td-name {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    font-size: .82rem;
    line-height: 1;
    color: #eaf2ff;
}

.badge-ok {
    background: rgba(34, 197, 94, .16);
    border-color: rgba(34, 197, 94, .35);
    color: #d1fae5
}

.badge-warn {
    background: rgba(245, 158, 11, .16);
    border-color: rgba(245, 158, 11, .35);
    color: #fde68a
}

.badge-danger {
    background: rgba(239, 68, 68, .16);
    border-color: rgba(239, 68, 68, .35);
    color: #fecaca
}

/* Meter (progress in name cell) — BEM, لا تضارب */
.meter {
    position: relative;
    /* يمنع الهروب/التكدس */
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    overflow: hidden;
    margin-top: 6px;
}

.meter__bar {
    position: relative;
    /* يلغى أي absolute من .bar عامة */
    display: block;
    height: 100%;
    width: var(--w, 0%);
    background: linear-gradient(90deg, #f59e0b, #22c55e);
}

.meter--danger .meter__bar {
    background: var(--color-danger);
}

.meter--warn .meter__bar {
    background: var(--color-warn);
}

/* حماية إضافية لو بقي CSS عام لـ .bar في المشروع */
.meter>.bar {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    height: 100% !important;
    width: var(--w, 0%) !important;
}

/* Pagination (Laravel) */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    list-style: none;
    padding: 8px;
    margin: 10px 0 2px
}

.pagination li>a,
.pagination li>span {
    display: inline-flex;
    min-width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(17, 20, 26, .40);
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) * .3));
    backdrop-filter: blur(calc(var(--glass-blur) * .3));
}

.pagination li.active>span {
    background: linear-gradient(180deg, rgba(14, 165, 233, .95), rgba(2, 132, 199, .92));
    color: #04131a;
    border-color: rgba(14, 165, 233, .8)
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(17, 20, 26, .60);
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) * .2));
    backdrop-filter: blur(calc(var(--glass-blur) * .2));
    color: #fff;
}

.alert-danger {
    background: linear-gradient(180deg, rgba(120, 12, 12, .70), rgba(60, 8, 8, .65));
    border-color: rgba(255, 0, 0, .25);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(0, 0, 0, .45)
}

.modal.show {
    display: flex
}

.modal .dialog {
    width: min(760px, 92vw);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
}

.modal .header,
.modal .body,
.modal .footer {
    padding: 14px
}

.modal .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border)
}

.modal .footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid var(--glass-border)
}

/* Utilities */
.hide {
    display: none !important
}

.center {
    display: flex;
    align-items: center;
    justify-content: center
}

.stack-8>* {
    margin-block: 6px
}

.rounded {
    border-radius: var(--radius-md)
}

.text-muted {
    color: var(--muted)
}

.fw-600 {
    font-weight: 600
}

.hr {
    height: 1px;
    background: var(--line);
    border: 0;
    margin: 10px 0
}

/* Skeletons */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    border-radius: 10px
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
    transform: translateX(-100%);
    animation: shine 1.4s infinite;
}

@keyframes shine {
    to {
        transform: translateX(100%)
    }
}

/* Backdrop fallback */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {

    .card,
    .topbar,
    .alert,
    .pagination li>a,
    .pagination li>span,
    input,
    select,
    textarea,
    .modal .dialog,
    thead th,
    tbody td {
        background: rgba(22, 26, 32, .88);
    }
}

/* Scrollbar corner (Chromium) */
.table-container::-webkit-scrollbar-corner {
    background: transparent
}

/* Prevent horizontal double scrollbars */
.table-container {
    overflow-x: auto;
    overflow-y: hidden
}

html,
body {
    max-width: 100%;
    overflow-x: hidden
}

/* End */

/* ===== Scoped overrides to neutralize any global `.bar` in the inventory table ===== */
#inventory-table .meter {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    overflow: hidden;
    margin-top: 6px;
}

/* لو ما غيّرت المارك-أب وما زلت تستخدم `.bar` داخل .meter */
#inventory-table .meter .bar {
    position: relative !important;
    /* يلغي absolute العالمي */
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    height: 100% !important;
    width: var(--w, 0%) !important;
    background: linear-gradient(90deg, #f59e0b, #22c55e) !important;
}

/* الحالات */
#inventory-table .meter.-danger .bar {
    background: var(--color-danger) !important;
}

#inventory-table .meter.-warn .bar {
    background: var(--color-warn) !important;
}

/* زيادة أمان: لا تسمح لأي z-index من `.bar` يطلع فوق الرأس اللاصق */
#inventory-table .meter,
#inventory-table .meter .bar {
    z-index: 0 !important;
}

/* ===== Scoped overrides to neutralize any global `.bar` in the inventory table ===== */
#inventory-table .meter {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    overflow: hidden;
    margin-top: 6px;
}

/* لو ما غيّرت المارك-أب وما زلت تستخدم `.bar` داخل .meter */
#inventory-table .meter .bar {
    position: relative !important;
    /* يلغي absolute العالمي */
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    height: 100% !important;
    width: var(--w, 0%) !important;
    background: linear-gradient(90deg, #f59e0b, #22c55e) !important;
}

/* الحالات */
#inventory-table .meter.-danger .bar {
    background: var(--color-danger) !important;
}

#inventory-table .meter.-warn .bar {
    background: var(--color-warn) !important;
}

/* زيادة أمان: لا تسمح لأي z-index من `.bar` يطلع فوق الرأس اللاصق */
#inventory-table .meter,
#inventory-table .meter .bar {
    z-index: 0 !important;
}

html[dir="rtl"] .table-container thead th:first-child {
    border-top-right-radius: var(--radius-lg);
}

html[dir="rtl"] .table-container thead th:last-child {
    border-top-left-radius: var(--radius-lg);
}

/* ===== Inventory table hardening (scoped) ===== */
#inventory-table {
    position: relative;
}

/* احصر أي .bar داخل الجدول وألغِ absolute/top/left من أي ستايل عام قديم */
#inventory-table .bar {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    float: none !important;
    z-index: 0 !important;
}

/* مقياس المخزون (BEM) — يعمل سواء غيّرت الـBlade أو لا */
#inventory-table .meter {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    overflow: hidden;
    margin-top: 6px;
}

#inventory-table .meter__bar {
    position: relative;
    display: block;
    height: 100%;
    width: var(--w, 0%);
    background: linear-gradient(90deg, #f59e0b, #22c55e);
}

#inventory-table .meter.-danger .bar,
#inventory-table .meter--danger .meter__bar {
    background: var(--color-danger);
}

#inventory-table .meter.-warn .bar,
#inventory-table .meter--warn .meter__bar {
    background: var(--color-warn);
}

/* أي .bar طليقة داخل #inventory-table وليست جزءًا من المقياس — اُخفِها (حزام أمان أخير) */
#inventory-table .bar:not(.meter .bar) {
    display: none !important;
}

/* زوايا رأس الجدول + الحواف اللاصقة (تجنّب “الهلال”) */
#inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-clip: padding-box;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

html[dir="rtl"] #inventory-table thead th:first-child {
    border-top-right-radius: var(--radius-lg);
}

html[dir="rtl"] #inventory-table thead th:last-child {
    border-top-left-radius: var(--radius-lg);
}

html[dir="ltr"] #inventory-table thead th:first-child {
    border-top-left-radius: var(--radius-lg);
}

html[dir="ltr"] #inventory-table thead th:last-child {
    border-top-right-radius: var(--radius-lg);
}

/* تمرير نظيف */
#inventory-table.table-container {
    overflow-x: auto;
    overflow-y: hidden;
}

/* ===== Inventory table hardening (scoped to #inventory-table) ===== */
#inventory-table {
    position: relative;
}

/* احصر أي .bar عامة داخل الجدول (تمنع التكدّس أعلى اليسار) */
#inventory-table .bar {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    float: none !important;
    z-index: 0 !important;
    display: block !important;
    height: 6px !important;
    width: var(--w, 0%) !important;
    background: linear-gradient(90deg, #f59e0b, #22c55e) !important;
}

/* مقياس BEM */
#inventory-table .meter {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    overflow: hidden;
    margin-top: 6px;
}

#inventory-table .meter__bar {
    position: relative;
    display: block;
    height: 100%;
    width: var(--w, 0%);
    background: linear-gradient(90deg, #f59e0b, #22c55e);
}

#inventory-table .meter--danger .meter__bar {
    background: var(--color-danger);
}

#inventory-table .meter--warn .meter__bar {
    background: var(--color-warn);
}

/* لو ظهرت .bar متطفلة ليست داخل .meter — أخفها */
#inventory-table .bar:not(.meter .bar) {
    display: none !important;
}

/* رأس الجدول اللاصق وزواياه */
#inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-clip: padding-box;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

html[dir="rtl"] #inventory-table thead th:first-child {
    border-top-right-radius: var(--radius-lg);
}

html[dir="rtl"] #inventory-table thead th:last-child {
    border-top-left-radius: var(--radius-lg);
}

/* خلية الحد الأدنى البسيطة */
#inventory-table .min-col .min-val {
    font-variant-numeric: tabular-nums;
    margin-inline-end: .5rem;
}

#inventory-table .min-col .state {
    font-size: .82rem;
    opacity: .85
}

#inventory-table .min-col .state.is-ok {
    color: #bbf7d0
}

#inventory-table .min-col .state.is-danger {
    color: #fecaca
}

#inventory-table .min-col .muted {
    color: #c7cfdd
}

/* تمرير أفقي نظيف */
#inventory-table.table-container {
    overflow-x: auto;
    overflow-y: hidden;
}

/* ===== Scrollbar (modern, dark, RTL-safe) ===== */

/* متغيرات تحكم سريعة */
:root {
    --sb-size: 10px;
    --sb-radius: 12px;
    --sb-track: rgba(255, 255, 255, .06);
    --sb-thumb: rgba(255, 255, 255, .28);
    --sb-thumb-hover: rgba(255, 255, 255, .42);
    --sb-thumb-active: rgba(255, 255, 255, .52);
}

/* ثبات المساحة عند ظهور السكروول (يمنع اهتزاز العرض) */
html,
body {
    scrollbar-gutter: stable both-edges;
}

/* Firefox */
* {
    scrollbar-width: thin;
    /* auto | thin | none */
    scrollbar-color: var(--sb-thumb) transparent;
    /* thumb | track */
}

/* WebKit (Chrome/Edge/Safari/Opera) */
*::-webkit-scrollbar {
    width: var(--sb-size);
    height: var(--sb-size);
}

*::-webkit-scrollbar-track {
    background: var(--sb-track);
    border-radius: var(--sb-radius);
}

*::-webkit-scrollbar-thumb {
    background: var(--sb-thumb);
    border-radius: var(--sb-radius);
    border: 2px solid transparent;
    /* يخلق padding بصري */
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--sb-thumb-hover);
}

*::-webkit-scrollbar-thumb:active {
    background: var(--sb-thumb-active);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

/* ===== تخصيص أدق لحاوية جدول المخزون ===== */
.table-container {
    scrollbar-gutter: stable;
    /* يحافظ على عرض ثابت أثناء التمرير الأفقي */
}

/* فايرفوكس داخل الجدول: لون أوضح */
.table-container {
    scrollbar-color: var(--color-primary) transparent;
}

/* WebKit داخل الجدول: لمسة لون أساسي مع حافة خفيفة */
.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary), #0284c7);
    border-radius: var(--sb-radius);
    border: 2px solid rgba(0, 0, 0, .25);
}

.table-container::-webkit-scrollbar-thumb:hover {
    filter: brightness(1.05);
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .05);
    border-radius: var(--sb-radius);
}

/* سكروول أفقي فقط عند الحاجة (لا تغيّر overflow الذي ضبطناه سابقًا) */
#inventory-table.table-container {
    overflow-x: auto;
    overflow-y: hidden;
}

/* ===== Typography + Centered Page Header ===== */
:root {
    /* اختر ترتيب الخطوط المفضلة */
    --font-ui: "Cairo", "Tajawal", "Noto Kufi Arabic", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--font-ui);
}

/* نسخة مركزية من الهيدر */
.page-header--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 12px 0 18px;
}

/* عنوان كبير، واضح، مع حركة دخول خفيفة */
.page-header--center .title {
    text-align: center;
    font-weight: 900;
    letter-spacing: .2px;
    /* حجم مرن بين 32px و 48px حسب العرض */
    font-size: clamp(32px, 3.2vw + 6px, 48px);
    line-height: 1.2;
    animation: fadeUp .35s ease-out both;
}

/* مسار فتات الخبز تحت العنوان وبمحاذاة الوسط */
.page-header--center .breadcrumbs {
    order: 2;
    color: var(--muted);
    text-align: center;
    font-size: .98rem;
    opacity: .9;
}

/* حركة لطيفة */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* القائمة المنسدلة */
.dropdown-notifs {
    width: 340px;
    max-height: 300px;
    overflow: auto;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 14px;
    padding: 8px 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    color: #fff;
    z-index: 50;
}

.dropdown-notifs li {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.dropdown-notifs li:last-child {
    border-bottom: 0;
}

/* التوستات */
#toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
    padding: 10px 12px;
    opacity: 0;
    transform: translateY(16px);
    animation: toast-in .18s ease forwards, toast-out .30s ease 5s forwards;
}

.toast .row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toast .title {
    font-weight: 700;
    font-size: 14px;
}

.toast .text {
    font-size: 12px;
    opacity: .9;
}

.toast .amt {
    font-size: 12px;
    opacity: .9;
    margin-inline-start: auto;
}

.toast .close {
    cursor: pointer;
    padding: 0 6px;
    font-weight: 700;
    opacity: .8;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

#toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px
}

.toast {
    min-width: 260px;
    max-width: 360px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
    padding: 10px 12px
}

.toast .row {
    display: flex;
    gap: 8px;
    align-items: center
}

.toast .btn {
    font-size: 12px;
    text-decoration: underline
}

.toast .close {
    margin-inline-start: auto;
    cursor: pointer
}

.notif-menu {
    position: absolute;
    right: 0;
    top: 100%;
    width: 340px;
    max-height: 300px;
    overflow: auto;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .2)
}

.badge {
    position: absolute;
    inset-inline-end: -6px;
    inset-block-start: -6px;
    background: #e11d48;
    color: #fff;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    padding: 0 5px
}

/* الحاوية المنسدلة */
#notif-menu {
    width: 340px;
    max-height: 360px;
    overflow: hidden;
    /* <-- لا سكروول هنا */
    background: rgba(255, 255, 255, .100);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 14px;
    backdrop-filter: blur(100px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    color: #fff;
}

/* منطقة العناصر فقط هي التي تسكرول */
#notif-list {
    max-height: 300px;
    overflow-y: auto;
    /* <-- السكروول هنا فقط */
    overflow-x: hidden;
    padding: 8px 0;
    box-sizing: border-box;
}