/* ============================================================
   هوية قطاف — تصميم مسطّح (Flat) بدون شفافية أو Blur
   الألوان قابلة للتخصيص من لوحة الإدارة عبر متغيرات CSS
   (يُعاد تعريفها ديناميكيًا في <head> بواسطة render_branding_style)
   ============================================================ */

:root {
    --primary: #6d28d9;
    --primary-dark: #521fa3;
    --primary-soft: #f3eefc;
    --cta: #e11d48;
    --cta-dark: #a91636;
    --bg: #ffffff;
    --card-bg: #f7f7f9;
    --card-border: #ececf1;
    --text-main: #111111;
    --text-muted: #7a7a85;
    --danger: #d64545;
    --success: #17a35c;
    --info: #2563eb;
    --warning: #b45309;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-soft: 0 1px 3px rgba(17, 17, 17, 0.06);
    --font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-size-base: 15px;
    --heading-scale: 1.3;
    --line-height-base: 1.6;
    --sidebar-width: 264px;
    --content-width: 1080px;
    --logo-size-header: 40px;
    --logo-size-login: 48px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    background: var(--bg);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.section-title, h1, h2, h3 {
    line-height: calc(var(--line-height-base) * 0.85);
}

h1.section-title {
    font-size: calc(17px * var(--heading-scale) * 0.86);
}

/* ===== بطاقة صفحات الدخول ===== */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.brand-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--text-main);
}

.brand-subtitle {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.brand-logo-img {
    max-height: var(--logo-size-header, 40px);
    display: block;
}

.glass-card .brand-logo-img {
    max-height: var(--logo-size-login, 48px);
    margin: 0 auto;
}

.navbar-brand.logo-pos-center {
    margin-inline: auto;
}

.navbar-brand.logo-pos-left {
    margin-inline-end: auto;
}

/* ===== النماذج ===== */
.form-group {
    text-align: right;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.field-error {
    display: block;
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    min-height: 14px;
}

/* ===== الأزرار ===== */
.btn {
    display: inline-block;
    border: none;
    border-radius: var(--radius-md);
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: transform .15s, background-color .15s, opacity .15s;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn:active {
    transform: scale(0.97);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-primary {
    background: var(--cta);
    color: #fff;
}

.btn-primary:hover {
    background: var(--cta-dark);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: var(--card-bg);
}

/* أزرار متتالية بعرض كامل تحافظ على مسافة موحّدة بينها */
.btn-block + .btn-block {
    margin-top: 10px;
}

/* زر صغير موحّد (إجراءات ثانوية داخل القوائم والجداول) */
.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    margin-top: 0;
}

.btn-danger {
    background: var(--card-bg);
    color: var(--danger);
    border: 1px solid #f3cdd3;
}

.btn-danger:hover {
    background: #fdeef0;
}

/* حالة تركيز واضحة للتنقل بلوحة المفاتيح في كل العناصر التفاعلية */
.btn:focus-visible,
.nav-links a:focus-visible,
.bottom-nav a:focus-visible,
.list-item:focus-visible,
.tab-btn:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

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

.gateway-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* ===== التنبيهات ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 14px;
    text-align: right;
}

.alert-error {
    background: #fdeef0;
    color: var(--danger);
    border: 1px solid #f6cdd3;
}

.alert-success {
    background: #e9f8f0;
    color: var(--success);
    border: 1px solid #bfe9d3;
}

.success-box {
    text-align: center;
}

.generated-password {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin: 10px 0;
    display: inline-block;
    direction: ltr;
    word-break: break-all;
}

.hint {
    font-size: 13px;
    color: var(--text-muted);
}

.switch-link {
    margin-top: 18px;
    font-size: 14px;
}

.switch-link a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }
}

/* ===== هيكل صفحات التطبيق ===== */
body.app-body {
    align-items: flex-start;
    padding: 16px;
}

body.has-bottom-nav {
    padding-bottom: 86px;
}

.app-shell {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 auto;
}

.app-shell-wide {
    max-width: 1080px;
}

/* ===== الشريط العلوي (إدارة/كاشير) ===== */
.navbar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: right;
}

.navbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color .15s, border-color .15s;
}

.nav-links a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-links a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* عنوان مجموعة داخل القائمة الجانبية (لوحة المطوّر) — يظهر على الديسكتوب فقط */
.nav-group-label {
    display: none;
}

/* ===== رأس صفحة موحّد: عنوان يمين + إجراء أساسي يسار ===== */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.page-head .section-title {
    margin: 0;
}

/* ===== بلاطات إجراءات كبيرة (شاشة الكاشير — سرعة باللمس) ===== */
.action-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 108px;
    padding: 18px 12px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 14px;
    text-align: center;
    transition: border-color .15s, transform .15s;
}

.action-tile:active {
    transform: scale(0.97);
}

.action-tile:hover {
    border-color: var(--primary);
}

.action-tile .tile-icon {
    font-size: 30px;
    line-height: 1;
}

.action-tile.tile-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===== هيدر صفحة العميل (جرس + شعار) ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 2px;
}

.app-header .navbar-brand {
    font-size: 19px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text-main);
}

.bell-btn svg {
    width: 20px;
    height: 20px;
}

.bell-dot {
    position: absolute;
    top: 8px;
    left: 9px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cta);
    border: 2px solid #fff;
}

/* ===== الكروت ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 22px;
    text-align: right;
}

.section-title {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 14px;
    color: var(--text-main);
}

h1.section-title {
    font-size: 20px;
}

.data-table tbody tr:hover {
    background: var(--primary-soft);
}

/* ===== كرت الرصيد الرئيسي (بنفسجي) ===== */
.balance-card {
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 24px 22px;
    color: #fff;
    text-align: right;
}

.balance-label {
    font-size: 13px;
    opacity: .85;
    margin: 0 0 4px;
}

.balance-points {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
}

.balance-points small {
    font-size: 15px;
    font-weight: 600;
    opacity: .85;
}

.balance-cta {
    display: inline-block;
    background: var(--cta);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    margin-top: 14px;
}

.balance-cta:active {
    transform: scale(0.97);
}

.balance-note {
    font-size: 12px;
    opacity: .8;
    margin: 12px 0 0;
}

/* ===== شريط التقدم للمستوى التالي ===== */
.progress-wrap {
    margin-top: 14px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: .9;
    margin-bottom: 6px;
}

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #ffffff;
    transition: width .3s ease;
}

/* ===== شارات الإنجازات ===== */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 10px;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding: 12px 6px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.achievement-badge .achievement-icon {
    font-size: 26px;
    line-height: 1;
}

.achievement-badge .achievement-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
}

.achievement-badge.locked {
    opacity: .4;
    filter: grayscale(1);
}

/* ===== الترحيب والمستوى ===== */
.greeting-name {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.greeting-tier {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    padding: 3px 12px;
}

/* ===== الكاروسيل الدعائي ===== */
.carousel {
    position: relative;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    border-radius: var(--radius-lg);
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.carousel-slide img {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}

.carousel-slide .banner-text {
    padding: 12px 14px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #d9d9e0;
    transition: width .25s, background-color .25s;
}

.carousel-dot.active {
    width: 18px;
    background: var(--primary);
}

/* ===== القائمة السفلية الثابتة (عميل فقط) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-around;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 900;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    min-width: 72px;
}

.bottom-nav a svg {
    width: 22px;
    height: 22px;
}

.bottom-nav a.active {
    color: var(--primary);
}

/* ===== قائمة "المزيد" (Bottom Sheet) للبوابات على الجوال والتابلت ===== */
.more-sheet .bottom-sheet {
    max-height: 78vh;
    overflow-y: auto;
}

.more-group-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    margin: 16px 2px 8px;
}

.more-group-title:first-child {
    margin-top: 0;
}

.list-item .list-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== سلوك التنقل حسب الجهاز: طريقة واحدة فعّالة فقط لكل شاشة ===== */
@media (max-width: 1023px) {
    /* على الجوال/التابلت: التنقل الأساسي ينتقل بالكامل للقائمة السفلية الثابتة.
       بوابة المطوّر (الوحيدة التي لا تزال تضع الشعار/الجرس داخل .navbar عبر .navbar-top)
       تُخفي روابطها فقط وتُبقي شريطها العلوي النحيف؛ الكاشير/الإدارة (شعار+جرس في .app-header
       منفصل) تُخفي الشريط الجانبي بالكامل هنا لعدم وجود ما يعرضه على الجوال أصلًا */
    .navbar .nav-links,
    .navbar .nav-group-label {
        display: none;
    }

    .navbar {
        padding: 12px 16px;
    }

    .navbar:not(:has(.navbar-top)) {
        display: none;
    }

    body:has(.bottom-nav) {
        padding-bottom: 86px;
    }
}

@media (min-width: 1024px) {
    /* على الديسكتوب: القائمة الجانبية هي طريقة التنقل الوحيدة للبوابات ذات الشريط،
       فتُخفى القائمة السفلية الخاصة بالجوال */
    body:has(.app-shell .navbar) .bottom-nav {
        display: none;
    }
}

/* ===== بطاقة العضوية الرقمية الفاخرة ===== */
.mcard {
    border-radius: 26px;
    padding: 28px 26px 24px;
    color: #fff;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 55%, #0f0a1e 130%);
    box-shadow: 0 16px 40px rgba(17, 17, 17, 0.28);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.mcard::before,
.mcard::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.mcard::before {
    width: 220px;
    height: 220px;
    top: -80px;
    left: -60px;
}

.mcard::after {
    width: 160px;
    height: 160px;
    bottom: -70px;
    right: -50px;
}

.mcard-logo {
    max-height: 30px;
    margin-bottom: 14px;
    filter: brightness(0) invert(1);
    opacity: .95;
}

.mcard-name {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 6px;
    position: relative;
}

.mcard-tier {
    display: inline-block;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 4px 16px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 18px;
    position: relative;
}

.mcard-qr-wrap {
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    display: inline-block;
    margin: 0 auto 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform .15s;
    position: relative;
}

.mcard-qr-wrap:active {
    transform: scale(0.97);
}

.mcard-qr-wrap svg {
    display: block;
    width: 168px;
    height: 168px;
}

.mcard-hint {
    font-size: 12px;
    opacity: .8;
    position: relative;
}

.mcard-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* عند التشغيل كتطبيق مثبَّت (بلا شريط متصفح) نضيف مسافة أمان أعلى الشاشة لتفادي تداخل النوتش/الساعة بالمحتوى */
@media (display-mode: standalone) {
    body.app-body {
        padding-top: calc(20px + env(safe-area-inset-top));
    }

    .app-header {
        padding-top: env(safe-area-inset-top);
    }

    body:has(.app-shell .navbar) .navbar {
        padding-top: calc(26px + env(safe-area-inset-top));
    }
}

.mcard-actions .btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

/* ===== وضع ملء الشاشة (QR العضوية / كرت الخصم) ===== */
.fullscreen-overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0e;
    z-index: 1500;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.fullscreen-overlay.open {
    display: flex;
    animation: sheet-pop .2s ease;
}

.fullscreen-close {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    left: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.fullscreen-logo {
    max-height: 32px;
    margin-bottom: 18px;
    filter: brightness(0) invert(1);
}

.fullscreen-qr-box {
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.fullscreen-qr-box svg {
    display: block;
    width: min(72vw, 320px);
    height: min(72vw, 320px);
}

.fullscreen-name {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    margin: 20px 0 4px;
}

.fullscreen-tier {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 0;
}

.fullscreen-code {
    color: #fff;
    font-family: monospace;
    font-size: 22px;
    letter-spacing: 3px;
    direction: ltr;
    margin: 18px 0 6px;
}

.fullscreen-value {
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    margin: 4px 0 18px;
}

/* ===== كروت الخصم الرقمية (بنسب البطاقات البنكية الحقيقية) ===== */
.dcard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.dcard {
    aspect-ratio: 1.586;
    border-radius: 18px;
    padding: 20px 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.dcard::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.dcard.dcard-muted {
    background: linear-gradient(135deg, #8a8a95 0%, #5f5f6a 100%);
    box-shadow: 0 6px 16px rgba(17, 17, 17, 0.14);
}

.dcard-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.dcard-brand {
    font-size: 13px;
    font-weight: 800;
    opacity: .9;
}

.dcard .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.dcard-value {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
}

.dcard-value small {
    font-size: 14px;
    font-weight: 600;
    opacity: .85;
}

.dcard-code {
    font-family: monospace;
    font-size: 19px;
    letter-spacing: 3px;
    direction: ltr;
    text-align: left;
    user-select: all;
    -webkit-user-select: all;
}

.dcard-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
}

.dcard-meta {
    font-size: 11px;
    opacity: .85;
    line-height: 1.7;
}

.dcard-copy {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.dcard-copy:active {
    transform: scale(0.96);
}

@media (min-width: 640px) {
    .dcard-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.dcard-large {
    aspect-ratio: auto;
    min-height: 200px;
    padding: 26px 28px;
}

.dcard-qr-embed {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin: 14px 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.dcard-qr-embed svg {
    display: block;
    width: 152px;
    height: 152px;
}

.dcard-large .dcard-value {
    font-size: 44px;
}

.dcard-large .dcard-code {
    font-size: 26px;
    letter-spacing: 4px;
}

/* ===== كروت خاصة (هدية عيد ميلاد / تعويض) — تصميم مختلف يبرز المناسبة ===== */
.dcard.dcard-theme-birthday {
    background: linear-gradient(135deg, #ff7ab6 0%, #7a4fd6 100%);
}

.dcard.dcard-theme-compensation {
    background: linear-gradient(135deg, #2ea88f 0%, #1f6f7a 100%);
}

.dcard-occasion {
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.22);
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    width: fit-content;
}

/* ===== شاشة مسح QR (كاميرا) ===== */
.qr-scan-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 14, 0.92);
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.qr-scan-panel {
    background: #17171c;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: sheet-pop .2s ease;
}

.qr-scan-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.qr-scan-title {
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    margin: 0;
}

.qr-scan-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.qr-scan-body {
    padding: 16px;
}

.qr-video-wrap {
    position: relative;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-scan-frame {
    position: absolute;
    inset: 14%;
    border: 3px solid #fff;
    border-radius: 18px;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.qr-scan-success {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    background: rgba(23, 163, 92, 0.25);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.qr-scan-success.show {
    opacity: 1;
}

.qr-scan-status {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

.qr-scan-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.qr-scan-actions .btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.qr-scan-actions .btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.qr-scan-error {
    text-align: center;
    padding: 20px 6px;
}

.qr-error-msg {
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    margin: 0 0 6px;
}

.qr-error-hint {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    margin: 0 0 16px;
    line-height: 1.6;
}

.qr-error-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== توست (تأكيد سريع أسفل الشاشة) ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1c1c22;
    color: #fff;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    z-index: 1300;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.3);
    animation: sheet-pop .2s ease;
    max-width: calc(100vw - 40px);
    text-align: center;
}

/* ===== قائمة الإشعارات المنسدلة (جرس موحّد في كل البوابات) ===== */
.bell-wrap {
    position: relative;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 330px;
    max-width: calc(100vw - 32px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(17, 17, 17, 0.16);
    z-index: 1150;
    display: none;
    overflow: hidden;
    text-align: right;
}

.notif-dropdown.open {
    display: block;
    animation: sheet-pop .16s ease;
}

.notif-head {
    padding: 11px 14px;
    border-bottom: 1px solid var(--card-border);
    font-weight: 800;
    font-size: 14px;
    color: var(--text-main);
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.6;
    text-decoration: none;
}

a.notif-item {
    cursor: pointer;
}

a.notif-item:hover {
    background: var(--primary-soft);
}

.notif-icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.6;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item.unread {
    background: var(--primary-soft);
}

.notif-item.notif-priority-high {
    border-right: 3px solid var(--cta);
}

.notif-title {
    font-weight: 800;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-empty {
    padding: 26px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-foot a {
    display: block;
    text-align: center;
    padding: 11px;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    border-top: 1px solid var(--card-border);
}

/* روابط تظهر فقط في القائمة الجانبية للعميل على الديسكتوب (تغني عن فتح "المزيد") */
.bottom-nav .desktop-link {
    display: none;
}

@media (min-width: 1024px) {
    .bottom-nav .desktop-link {
        display: flex;
    }

    /* على الديسكتوب كل الصفحات ظاهرة في القائمة الجانبية — لا حاجة لعنصر "المزيد" */
    .bottom-nav .mobile-only-link {
        display: none;
    }
}

/* ===== الإحصائيات ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-box .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
}

.stat-box .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== البانر المفرد (كاشير) ===== */
.banner-item {
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.banner-item img {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}

.banner-item .banner-text {
    padding: 12px 14px;
}

.banner-title {
    font-weight: 800;
    margin: 0 0 4px;
}

.banner-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.banner-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}

/* ===== الملاحظات ===== */
.notice {
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: right;
}

.notice-info {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid var(--card-border);
}

.notice-warning {
    background: #fff7e8;
    color: #8a5a13;
    border: 1px solid #f3e0b8;
}

/* ===== القوائم (نمط قطاف: كرت + فاصل + سهم) ===== */
.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.list-item .list-main {
    font-weight: 700;
    font-size: 14px;
}

.list-item .list-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.list-item .list-amount {
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
}

.list-item .chevron {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.list-item .list-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 17px;
}

.list-item .list-lead {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.amount-positive {
    color: var(--success);
}

.amount-negative {
    color: var(--danger);
}

/* ===== الشارات ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.badge-active {
    background: #e9f8f0;
    color: var(--success);
}

.badge-used {
    background: #efeff3;
    color: #666;
}

.badge-expired {
    background: #fdeef0;
    color: var(--danger);
}

.tag-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: var(--primary-soft);
    color: var(--primary);
    margin-inline-start: 6px;
}

.empty-state {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.code-box {
    font-family: monospace;
    font-size: 18px;
    letter-spacing: 1px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    direction: ltr;
    text-align: center;
    word-break: break-all;
}

.qr-frame {
    background: #fff;
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: var(--radius-md);
    display: inline-block;
    line-height: 0;
}

.qr-frame svg {
    display: block;
    width: 180px;
    height: 180px;
}

/* ===== النوافذ المنبثقة (تأكيد) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(17, 17, 17, 0.18);
    padding: 28px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.modal-message {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions .btn {
    flex: 1;
    margin-top: 0;
}

/* ===== زر إجراء سريع داخل عناصر القوائم (عملاء/كاشيرز/أعياد ميلاد) ===== */
.qa-btn {
    background: var(--primary-soft);
    color: var(--primary);
    border: none;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

.qa-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== نافذة الإجراءات السريعة ===== */
.qa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1100;
}

.qa-overlay[hidden] {
    display: none;
}

.qa-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}

.qa-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 4px;
}

.qa-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.qa-type-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.qa-type-btn {
    flex: 1;
    padding: 9px 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-main);
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
}

.qa-type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.qa-field {
    display: none;
}

.qa-field.visible {
    display: block;
}

.qa-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.qa-actions .btn {
    margin-top: 0;
}

/* ===== الطبقة السفلية (Bottom Sheet) ===== */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.bottom-sheet {
    background: var(--card-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 720px;
    padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 40px rgba(17, 17, 17, 0.18);
    animation: sheet-up .25s ease;
}

@keyframes sheet-up {
    from {
        transform: translateY(40%);
        opacity: .6;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.sheet-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
}

.sheet-close {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-main);
    line-height: 1;
}

/* ===== منتقي التاريخ الدوّار (Wheel Picker) ===== */
.wheel-picker {
    display: flex;
    gap: 6px;
    direction: ltr;
    position: relative;
    height: 180px;
    margin: 10px 0;
}

.wheel-col {
    flex: 1;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    text-align: center;
}

.wheel-col::-webkit-scrollbar {
    display: none;
}

.wheel-item {
    height: 36px;
    line-height: 36px;
    scroll-snap-align: center;
    font-size: 15px;
    color: var(--text-muted);
    cursor: pointer;
}

.wheel-item.selected {
    color: var(--text-main);
    font-weight: 800;
}

.wheel-spacer {
    height: 72px;
}

.wheel-highlight {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    height: 36px;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    background: var(--primary-soft);
    opacity: .45;
    pointer-events: none;
    border-radius: 8px;
}

.date-display {
    cursor: pointer;
    background: var(--card-bg);
}

/* ===== تبويبات ===== */
.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-main);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    transition: background-color .15s, border-color .15s, color .15s;
}

.tab-btn:hover {
    border-color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ===== الجداول ===== */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 800;
    font-size: 12px;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background-color .15s;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
}

.sortable-th:hover {
    color: var(--primary);
}

.sort-arrow {
    font-size: 9px;
    display: inline-block;
    width: 10px;
}

/* ===== الخط الزمني ===== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 2px solid var(--card-border);
    padding-right: 16px;
}

.timeline-item {
    position: relative;
    padding-bottom: 4px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -21px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
}

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

/* ===== نتائج البحث والترتيب ===== */
.search-result {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: right;
    transition: border-color .15s;
}

.search-result:hover,
.search-result.selected {
    border-color: var(--primary);
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
}

.rank-number {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    min-width: 28px;
    text-align: center;
}

/* ============================================================
   التجاوب مع الشاشات الكبيرة (تابلت وديسكتوب)
   الجوال هو الأساس، وهنا نضيف تخطيط الشاشات الأوسع فقط
   ============================================================ */

@keyframes sheet-pop {
    from {
        transform: scale(0.96);
        opacity: .5;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== تابلت فأكبر: منتقي التاريخ يظهر كنافذة في المنتصف بدل شريط سفلي ===== */
@media (min-width: 768px) {
    .sheet-overlay {
        align-items: center;
        padding: 24px;
    }

    .bottom-sheet {
        max-width: 420px;
        border-radius: var(--radius-lg);
        padding: 20px 22px;
        box-shadow: 0 10px 40px rgba(17, 17, 17, 0.2);
        animation: sheet-pop .22s ease;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (min-width: 1024px) {
    /* على الديسكتوب: نمنع صناديق الإحصائيات من التمدد لعرض ضخم عند قلة عددها في الصف —
       عمود بحد أقصى معقول أدق للعين من التمدد الكامل لعرض الشاشة */
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 200px));
    }
}

/* ===== قائمة إحصائيات مضغوطة (صف تسمية:قيمة) بدل صناديق كبيرة متفرقة —
   لأقسام "إضافية" كثيرة العدد يصعب تتبعها كصناديق ===== */
.stat-compact-list {
    display: flex;
    flex-direction: column;
}

.stat-compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--card-border);
    font-size: 13.5px;
}

.stat-compact-row:last-child {
    border-bottom: none;
}

.stat-compact-label {
    color: var(--text-muted);
}

.stat-compact-value {
    color: var(--text-main);
    font-weight: 800;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .stat-compact-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 28px;
    }
}

/* ===== ديسكتوب: قائمة جانبية ثابتة على اليمين (نمط قطاف/STC) ===== */
@media (min-width: 1024px) {

    /* --- تطبيق العميل: القائمة السفلية تتحول لقائمة جانبية بنفسجية --- */
    body.has-bottom-nav {
        padding-bottom: 24px;
        padding-right: calc(var(--sidebar-width) + 24px);
    }

    body.has-bottom-nav .app-shell {
        max-width: calc(var(--content-width) * 0.8);
    }

    .bottom-nav {
        top: 0;
        bottom: 0;
        left: auto;
        right: 0;
        width: var(--sidebar-width);
        flex-direction: column;
        justify-content: flex-start;
        gap: 8px;
        background: var(--primary);
        border-top: none;
        padding: 28px 16px;
        overflow-y: auto;
    }

    .bottom-nav a {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        min-width: 0;
        padding: 13px 16px;
        border-radius: var(--radius-md);
        color: rgba(255, 255, 255, 0.78);
        font-size: 14px;
        transition: background-color .15s, color .15s;
    }

    .bottom-nav a svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .bottom-nav a:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.10);
    }

    .bottom-nav a.active {
        color: #fff;
        background: rgba(255, 255, 255, 0.16);
    }

    /* --- بوابات الكاشير/الإدارة/المطوّر: الشريط العلوي يتحول لقائمة جانبية ثابتة --- */
    body:has(.app-shell .navbar) {
        padding-right: calc(var(--sidebar-width) + 32px);
    }

    body:has(.app-shell .navbar) .app-shell {
        margin: 0 auto;
    }

    body:has(.app-shell .navbar) .app-shell-wide {
        max-width: var(--content-width);
    }

    body:has(.app-shell .navbar) .navbar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: var(--sidebar-width);
        border-radius: 0;
        border: none;
        background: var(--primary);
        box-shadow: none;
        padding: 26px 18px;
        overflow-y: auto;
        z-index: 950;
    }

    body:has(.app-shell .navbar) .navbar-top {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        text-align: right;
    }

    body:has(.app-shell .navbar) .navbar .navbar-brand {
        color: #fff;
        font-size: 20px;
    }

    body:has(.app-shell .navbar) .nav-links {
        flex-direction: column;
        gap: 6px;
        overflow: visible;
        padding-bottom: 0;
    }

    body:has(.app-shell .navbar) .nav-group-label {
        display: block;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .4px;
        color: rgba(255, 255, 255, 0.5);
        margin: 12px 6px 2px;
    }

    body:has(.app-shell .navbar) .nav-links a svg {
        width: 18px;
        height: 18px;
    }

    /* داخل القائمة الجانبية الملاصقة ليمين الشاشة: القائمة المنسدلة تتمدد لليسار حتى لا تخرج عن الشاشة */
    body:has(.app-shell .navbar) .navbar .notif-dropdown {
        left: auto;
        right: 0;
    }

    body:has(.app-shell .navbar) .nav-links a {
        background: transparent;
        border-color: transparent;
        color: rgba(255, 255, 255, 0.78);
        font-size: 14px;
        padding: 12px 16px;
        border-radius: var(--radius-md);
        transition: background-color .15s, color .15s;
    }

    body:has(.app-shell .navbar) .nav-links a:hover {
        background: rgba(255, 255, 255, 0.10);
        color: #fff;
    }

    body:has(.app-shell .navbar) .nav-links a.active {
        background: rgba(255, 255, 255, 0.16);
        border-color: transparent;
        color: #fff;
    }
}
