/* [2026-08-20] هوية core_style */
/* بقايا الكحلى/الذهبى هنا رُبطت بنفس رموز pro_ui.css (--pui-*) — لونٌ
   واحد يُدار من مكانٍ واحد، لا نسختان تفترقان يوم تتغيّر الهوية. */
@layer base {
/* [MIGRATED 2026-07-27] ملف كامل مُلفوف فى @layer base — تحقّق حسابى مسبق أثبت عدم وجود أي تعارض محدّدات (selectors) مع swanco_design.css/pro_ui.css/themes.css/auth-login.css/home-screen.css/palm_grid_form.css، وأن كل تراكب مع الـ<style> الداخلى فى base.html يحافظ على نفس الفائز الحالى فى الـcascade (طبقة عادية < بلا-طبقة عادية < طبقة !important < بلا-طبقة !important). */

/* ==========================================================================
   SWANCO ERP · Premium Core Style Sheet v4.0 (2026)
   Design: Deep Slate Comfort — داكن دافئ مريح للعين × ذهبي احترافي
   --------------------------------------------------------------------------
   التغييرات في v4.0:
     • لوحة ألوان جديدة: Deep Slate بدلاً من Navy الأسود القاتم
     • خلفيات البطاقات دافئة وأوضح — راحة بصرية حقيقية
     • تدرج بين الطبقات واضح — hierarchy مرئي
     • إصلاح Spacing الصفحة الرئيسية
     • تأثير 3D احترافي للوجوات
   ========================================================================== */


/* ══════════════════════════════════════════════════════════════════════
   01 · CSS VARIABLES
   ══════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* [UI 2026-07-13] ── لوحة فاخرة فاتحة — أبيض/لبنى غامق/رمادى/ذهبى ──
       استبدال كامل للكحلى الغامق (Deep Slate) بطلب صريح من المستخدم.
       نفس أسماء المتغيرات (لضمان توافق كل الملفات) بقيم جديدة فاتحة. */
    --bg-deep:      #eef2f7;   /* أعمق خلفية — body (رمادى فاتح جداً) */
    --bg-main:      #f5f8fc;   /* خلفية منطقة المحتوى */
    --bg-card:      #ffffff;   /* بطاقات رئيسية */
    --bg-card2:     #f6f9fd;   /* بطاقات ثانوية */
    --bg-hover:     #eef4fb;   /* hover للعناصر */
    --bg-sidebar:   #ffffff;   /* خلفية الشريط الجانبي */
    --bg-topbar:    #ffffff;   /* خلفية الشريط العلوي */
    --bg-elevated:  #ffffff;   /* بطاقات مرفوعة */

    /* ── نظام الذهب ── */
    /* [2026-08-18] ‎--gold-*‎ اسمٌ موروث لا يصف قيمته: هذه المجموعة هى
       **لون لهجة السمة** (accent)، ويُعاد تعريفها فى ستّ سمات بألوان
       مختلفة تماماً — بنفسجى وسماوى وزمردى ووردى — ولا ذهب فى أيٍّ منها.
       والاسم المضلِّل يُكلِّف: من يقرأ ‎var(--sw-accent)‎ يظنه ثابتاً ذهبياً
       فيتجنّبه حيث يلزمه، أو يستعمله ظانّاً أنه يُضيف ذهباً.
       الأسماء الصحيحة ‎--sw-accent-*‎ أدناه، والقديمة أُبقيت مرادفاتٍ لها
       حتى تُهاجَر الاستعمالات كلها ثم تُحذف. مصدر القيمة واحد لا اثنان. */
    --sw-accent:       #0f6e56;
    --sw-accent-lt:    #8fe3c4;
    --sw-accent-br:    #2dc88f;
    --sw-accent-dim:   rgba(15,110,86,0.10);
    --sw-accent-glow:  rgba(15,110,86,0.20);
    /* مرادفات موروثة — لا تستعملها فى كود جديد */
    --gold:      var(--sw-accent);
    --gold-lt:   var(--sw-accent-lt);
    --gold-br:   var(--sw-accent-br);
    --gold-dim:  var(--sw-accent-dim);
    --gold-glow: var(--sw-accent-glow);
    /* ── ألوان التمييز ── */
    --teal:         #157347;
    --teal2:        #1D9E75;
    --blue:         #2c6fc7;
    --blue2:        #5BA8E8;
    --red:          #c0392b;
    --orange:       #c9761f;
    --purple:       #6C5CE0;
    --purp2:        #8b7ff0;

    /* ── نصوص — لبنى غامق على خلفية فاتحة ── */
    --tx-prime:     var(--pui-ink, #1E2422);   /* نص رئيسى — لبنى غامق بدل الأبيض */
    --tx-gold:      var(--pui-accent, #1BB18C);   /* نص ذهبى داكن للعناوين (يقرأ على الأبيض) */
    --tx-sec:       rgba(30,45,74,0.66);
    --tx-muted:     rgba(30,45,74,0.46);
    --tx-faint:     rgba(30,45,74,0.28);

    /* ── حدود ── */
    --b-gold:       rgba(15,110,86,0.28);
    --b-blue:       rgba(91,168,232,0.25);
    --b-white:      rgba(30,45,74,0.08);

    /* ── زوايا ── */
    --r-sm:  10px;
    --r-md:  14px;
    --r-lg:  18px;
    --r-xl:  22px;
    --r-2xl: 26px;

    /* ── انتقالات ── */
    --t-fast:   0.18s ease;
    --t-med:    0.25s ease;
    --t-spring: 0.28s cubic-bezier(0.34,1.4,0.64,1);
}


/* ══════════════════════════════════════════════════════════════════════
   02 · BASE & RESET
   ══════════════════════════════════════════════════════════════════════ */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-deep);
    color: var(--tx-prime);
    /* [FIX-CRITICAL 2026-10-02] كانت "direction: rtl" مفروضة هنا بلا شرط،
       فتُلغي ميراثها من `<html dir="...">` الذي يضبطه user_prefs.js بشكل
       صحيح عند التبديل للإنجليزية — فيبقى كل تخطيط الصفحة (الشريط الجانبي،
       ترتيب العناصر) RTL فعلياً رغم أن dir="ltr" مضبوط. الاتجاه الآن
       يُورَّث طبيعياً من عنصر html. */
    -webkit-font-smoothing: antialiased;
}


/* ══════════════════════════════════════════════════════════════════════
   03 · SCROLLBAR
   ══════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(15,110,86,0.28); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15,110,86,0.50); }


/* ══════════════════════════════════════════════════════════════════════
   04 · ANIMATIONS
   ══════════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* ══════════════════════════════════════════════════════════════════════
   [ADDED 2026-08-25] ظهورٌ بالشفافية وحدها — بلا ‎transform‎.
   ──────────────────────────────────────────────────────────────────────
   ‎fadeIn‎ أعلاه يحمل ‎transform‎ فى طرفَيه. وغلافُ الأجزاء فى
   ‎routers.js‎ كان يستعمله بـ‎forwards‎، فيحتفظ الغلاف بعد انتهاء الحركة
   بـ‎transform: matrix(1,0,0,1,0,0)‎ — تحويلٌ **محايدٌ بصرياً** لكنه
   بمقتضى المواصفة يُنشئ «كتلةً حاوية» لكل ‎position:fixed‎ تحته.

   والنتيجة: كل نافذة إدخال فى النظام (‎.sw-form-overlay‎ وهى
   ‎position:fixed; inset:0‎) كانت تُحبس داخل منطقة المحتوى بدل أن تغطّى
   الشاشة — فتظهر «فوق جدول العرض» لا صفحةً مستقلّة. وهو عطلٌ فى
   **كل الأقسام** لا فى شاشةٍ بعينها، ولا أثر له فى الـconsole.

     > **والتحويلُ المحايد يُرى محايداً ولا يُحسب محايداً: صفرُه**
     > **يُغيّر مرجعَ كل ثابتٍ تحته.**

   والحلّ ألّا يكون فى الغلاف ‎transform‎ أصلاً. والحركة محفوظة: سبع
   بكسلاتٍ من الإزاحة لم تكن هى ما يُرى، بل الشفافية.
   ══════════════════════════════════════════════════════════════════ */
@keyframes swFragmentIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes screenSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(14px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes pulse-gold {
    0%,100% { box-shadow: 0 0 0 0 rgba(15,110,86,0); }
    50%      { box-shadow: 0 0 0 7px rgba(15,110,86,0.12); }
}
@keyframes pulse-teal {
    0%,100% { box-shadow: 0 0 0 0 rgba(45,200,143,0); }
    50%      { box-shadow: 0 0 0 6px rgba(45,200,143,0.14); }
}
@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes countUp {
    from { opacity: 0; transform: scale(0.84) translateY(4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes borderGlow {
    0%,100% { border-color: rgba(15,110,86,0.12); box-shadow: 0 0 0 0 rgba(15,110,86,0); }
    50%      { border-color: rgba(15,110,86,0.38); box-shadow: 0 0 12px rgba(15,110,86,0.10); }
}
@keyframes iconBounce {
    0%  { transform: scale(1) rotate(0deg); }
    40% { transform: scale(1.15) rotate(-6deg); }
    70% { transform: scale(0.95) rotate(3deg); }
    100%{ transform: scale(1) rotate(0deg); }
}
@keyframes shimmer {
    from { background-position: -200% center; }
    to   { background-position:  200% center; }
}
/* تأثير 3D للوجو — تحريك خفيف */
@keyframes float3d {
    0%,100% { transform: perspective(500px) rotateY(-4deg) rotateX(2deg) translateY(0px); }
    50%      { transform: perspective(500px) rotateY(-2deg) rotateX(1deg) translateY(-4px); }
}

.animate-fade-in { animation: fadeIn     0.28s ease-out forwards; }
.animate-slide-r { animation: slideRight 0.28s ease-out forwards; }


/* ══════════════════════════════════════════════════════════════════════
   05 · UTILITY — TEXT & BACKGROUND
   ══════════════════════════════════════════════════════════════════════ */
.text-gold    { color: #0f6e56; }
.text-gold-lt { color: #8fe3c4; }
.text-gold-br { color: #2dc88f; }
.text-teal    { color: #1D9E75; }
.text-teal-2  { color: #2DC88F; }
.text-blue    { color: #378ADD; }
.text-red     { color: #E24B4A; }
.text-purple  { color: #7F77DD; }

/* خلفيات Slate — للاستخدام المباشر */
.bg-slate     { background: #0f1b2e; }
.bg-slate-2   { background: #152238; }
.bg-slate-3   { background: #1a2a44; }
.bg-slate-4   { background: #24344f; }
.bg-slate-5   { background: #131f34; }

/* Legacy Navy — للتوافق مع الكود القديم */
.bg-navy   { background: #0f1b2e; }
.bg-navy-2 { background: #152238; }
.bg-navy-3 { background: #1a2a44; }
.bg-navy-4 { background: #24344f; }
.bg-navy-5 { background: #131f34; }

/* Glass card */
.glass-card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(30,45,74,0.08);
    border-radius: var(--r-lg);
}

.market-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}


/* ══════════════════════════════════════════════════════════════════════
   06 · GRADIENTS — تدرجات الشركات
   ══════════════════════════════════════════════════════════════════════ */
.grad-sys    { background: linear-gradient(135deg, #B07B1A 0%, #2dc88f 100%); }

.grad-meq    { background: linear-gradient(135deg, #0F3A6A 0%, #1F6BB5 100%); }
.grad-mco    { background: linear-gradient(135deg, #7A320D 0%, #C46020 100%); }
.grad-mfound { background: linear-gradient(135deg, #381870 0%, #7050C8 100%); }
.grad-jtrade { background: linear-gradient(135deg, #0E4A38 0%, #1A9068 100%); }
.grad-jagri  { background: linear-gradient(135deg, #0B5A3C 0%, #22A870 100%); }

/* Legacy */
.grad-agri   { background: linear-gradient(135deg, #0F6E56, #2DC88F); }
.grad-sup    { background: linear-gradient(135deg, #854F0B, #E8B84B); }
.grad-mah    { background: linear-gradient(135deg, #3C3489, #7F77DD); }
.grad-nokba  { background: linear-gradient(135deg, #72243E, #D4537E); }
.grad-srv    { background: linear-gradient(135deg, #0C447C, #378ADD); }
.grad-bayt   { background: linear-gradient(135deg, #791F1F, #E24B4A); }


/* ══════════════════════════════════════════════════════════════════════
   07 · SPA SCREENS
   ══════════════════════════════════════════════════════════════════════ */
.screen        { display: none; }
.screen.active { display: flex; }


/* ══════════════════════════════════════════════════════════════════════
   08 · HOME SCREEN
   إصلاح: overflow + spacing لبطاقات الشركات
   ══════════════════════════════════════════════════════════════════════ */

/* ── الـ wrapper الرئيسي للصفحة الرئيسية — قابل للتمرير ── */
.s-home {
    flex-direction: column;
    overflow-y: auto !important;
    overflow-x: hidden;
    height: 100%;
    min-height: 0;
}
/* المنطقة القابلة للتمرير داخل s-home */
.home-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 40px;   /* مساحة كافية في الأسفل */
}

/* بطاقة إحصاء صغيرة في الرأس */
.home-stat-pill {
    background: #ffffff;
    border: 1px solid rgba(30,45,74,0.10);
    border-radius: 16px;
    padding: 12px 24px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: border-color var(--t-med), background var(--t-med), transform var(--t-spring);
    min-width: 88px;
    cursor: default;
}
.home-stat-pill:hover {
    border-color: rgba(15,110,86,0.38);
    background: rgba(15,110,86,0.10);
    transform: translateY(-2px);
}
.home-stat-pill .pill-val {
    font-size: 20px;
    font-weight: 900;
    color: var(--sw-accent-br);
    line-height: 1.1;
}
.home-stat-pill .pill-label {
    font-size: 10px;
    color: var(--tx-muted);
    margin-top: 2px;
}

/* شريط الأسعار المتحرك */
.ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
    background: rgba(255,255,255,0.75);
    border-top: 1px solid rgba(15,110,86,0.15);
    border-bottom: 1px solid rgba(15,110,86,0.15);
    height: 32px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.ticker-inner {
    display: inline-flex;
    animation: ticker 36s linear infinite;
    will-change: transform;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 28px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.07);
}
.ticker-sep {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(15,110,86,0.40);
    display: inline-block;
}

/* ══ بطاقات الشركات ══ */
.co-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-deep) 100%);
    border: 1px solid var(--b-blue);
    border-radius: var(--r-xl);
    transition: transform var(--t-spring), box-shadow var(--t-med), border-color var(--t-med);
    min-height: 180px;   /* ارتفاع أدنى لتجنب القص */
}
/* طبقة shine علوية */
.co-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 55%);
    opacity: 0;
    transition: opacity var(--t-med);
    pointer-events: none;
    border-radius: inherit;
}
/* خط ذهبي سفلي */
.co-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(15,110,86,0.40) 50%, transparent);
    opacity: 0;
    transition: opacity var(--t-med);
}
.co-card:hover {
    transform: translateY(-6px) scale(1.018);
    box-shadow:
        0 18px 40px rgba(30,45,74,0.16),
        0 0 0 1px rgba(15,110,86,0.24);
    border-color: rgba(15,110,86,0.30);
}
.co-card:hover::before { opacity: 1; }
.co-card:hover::after  { opacity: 1; }
.co-card:active { transform: translateY(-1px) scale(0.99); }


/* ══════════════════════════════════════════════════════════════════════
   LOGO 3D — تأثير اللوجو الثلاثي الأبعاد
   الاستخدام:
     <div class="co-logo-3d co-logo-meq">
       <img src="..." class="co-logo-img" alt="...">
     </div>
   ══════════════════════════════════════════════════════════════════════ */
.co-logo-3d {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    overflow: visible;
    flex-shrink: 0;
    /* تأثير 3D الأساسي */
    transform: perspective(500px) rotateY(-4deg) rotateX(2deg);
    transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.35s ease;
    animation: float3d 4s ease-in-out infinite;
}
.co-card:hover .co-logo-3d {
    animation: none;
    transform: perspective(500px) rotateY(0deg) rotateX(0deg) translateY(-4px) scale(1.08);
}

/* صورة اللوجو داخل الـ 3D wrapper */
.co-logo-img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    padding: 6px;
    display: block;
    position: relative;
    z-index: 2;
    /* ظل متعدد الطبقات — يعطي عمق 3D حقيقي */
    box-shadow:
        0  1px  0  rgba(255,255,255,0.90) inset,        /* highlight علوي */
        0 -1px  0  rgba(0,0,0,0.25) inset,               /* ظل داخلي سفلي */
        2px 4px 0  rgba(0,0,0,0.28),                     /* ظل جانبي */
        0  8px 20px rgba(0,0,0,0.45),                    /* ظل عمق */
        0 16px 40px rgba(0,0,0,0.22);                    /* هالة بعيدة */
    transition: box-shadow 0.35s ease;
}
.co-card:hover .co-logo-img {
    box-shadow:
        0  1px  0  rgba(255,255,255,0.90) inset,
        0 -1px  0  rgba(0,0,0,0.25) inset,
        2px 4px 0  rgba(0,0,0,0.28),
        0 12px 32px rgba(0,0,0,0.55),
        0 24px 56px rgba(0,0,0,0.30);
}

/* ── هالة ملونة خلف اللوجو حسب الشركة ── */
.co-logo-3d::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 24px;
    opacity: 0;
    transition: opacity 0.35s ease;
    filter: blur(14px);
    z-index: 1;
}
.co-card:hover .co-logo-3d::before { opacity: 1; }

/* ألوان الهالة حسب الشركة */
.co-logo-meq::before    { background: radial-gradient(circle, rgba(31,107,181,0.55) 0%, transparent 70%); }
.co-logo-mco::before    { background: radial-gradient(circle, rgba(196,96,32,0.55)  0%, transparent 70%); }
.co-logo-mfound::before { background: radial-gradient(circle, rgba(112,80,200,0.55) 0%, transparent 70%); }
.co-logo-jtrade::before { background: radial-gradient(circle, rgba(26,144,104,0.55) 0%, transparent 70%); }
.co-logo-jagri::before  { background: radial-gradient(circle, rgba(34,168,112,0.55) 0%, transparent 70%); }

/* ── حلقة توهج حول اللوجو ── */
.co-logo-ring {
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    border: 1.5px solid rgba(15,110,86,0.22);
    pointer-events: none;
    animation: borderGlow 3s ease-in-out infinite;
    z-index: 3;
}

/* Monogram fallback (إذا لم يكن هناك لوجو) */
.monogram {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: rgba(255,255,255,0.92);
    letter-spacing: -0.5px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: transform var(--t-spring), box-shadow var(--t-med);
    box-shadow:
        2px 4px 0  rgba(0,0,0,0.30),
        0  8px 20px rgba(0,0,0,0.40);
}
.monogram::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.20) 0%, transparent 60%);
    pointer-events: none;
}
.monogram-dark { color: rgba(0,0,0,0.65); }
.co-card:hover .monogram {
    transform: scale(1.08);
    box-shadow:
        2px 4px 0  rgba(0,0,0,0.35),
        0 14px 32px rgba(0,0,0,0.55);
}

/* خط ذهبي رفيع فاصل */
.hairline-gold {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(15,110,86,0.20) 20%,
        rgba(15,110,86,0.45) 50%,
        rgba(15,110,86,0.20) 80%,
        transparent 100%
    );
}


/* ══════════════════════════════════════════════════════════════════════
   09 · SIDEBAR
   ══════════════════════════════════════════════════════════════════════ */
.sidebar-luxe {
    background: linear-gradient(180deg,
        #ffffff 0%, #f7fafd 40%, #f5f8fc 80%, #ffffff 100%
    );
    border-left: 1px solid rgba(30,45,74,0.08);
    position: relative;
}
.sidebar-luxe::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 1px; height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(15,110,86,0.22) 25%,
        rgba(15,110,86,0.40) 55%,
        rgba(15,110,86,0.18) 80%,
        transparent 100%
    );
    z-index: 1;
}

.sb-item {
    border-radius: var(--r-sm);
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    margin-bottom: 1px;
    border-right: 3px solid transparent;
    position: relative;
}
.sb-item:hover {
    background: rgba(91,168,232,0.10);
    color: var(--pui-ink, #1E2422) !important;
}
.sb-item:hover i { color: rgba(15,110,86,0.80); }

.sb-active {
    background: linear-gradient(90deg, rgba(15,110,86,0.14) 0%, rgba(15,110,86,0.05) 100%);
    border-right-color: #0f6e56;
    color: #8fe3c4 !important;
}
.sb-active i { color: #0f6e56; }


/* ══════════════════════════════════════════════════════════════════════
   10 · TOP BAR
   ══════════════════════════════════════════════════════════════════════ */
/* [توحيد 2026-07-27] كانت .topbar-luxe مُعرَّفة مرتين فى هذا الملف (هنا +
   تكرار "EXCHANGE FLOOR SKIN" لاحقاً بنفس الاسم يفوز بالـ!important+ترتيب
   المصدر لكل من background/border-bottom/backdrop-filter/box-shadow) —
   دُمجتا فى تعريف واحد بالقيم الفعلية النهائية (بلا أي تغيير بصري).
   ::after الأصلية هنا كانت ميتة دائماً: تُخفى فوراً بقاعدة display:none
   !important لاحقة، وكل الثيمات السبعة (dark/midnight/ocean/forest/ruby/
   azure/emerald) تُعيد تعريفها بلونها الخاص فى themes.css — حُذفت. */
.topbar-luxe {
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(250,251,253,0.94) 100%);
    border-bottom: 1px solid rgba(30,45,74,0.08);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(10,20,40,0.16);
    position: relative;
    /* [FIX 2026-07-27] كان 20 بينما #sidebar-main = 30 !important — أي قائمة
       منسدلة تنبثق من الشريط العلوي (تبديل الشركة، التصدير، الثيم، اللغة)
       كانت تُرسَم تحت الشريط الجانبي فعلياً وتختفي بصرياً كلما امتدت لمنطقة
       الشريط الجانبي (مؤكَّد حياً: قائمة "تبديل الشركة" كانت غير مرئية
       تماماً رغم display:block الصحيح فى الـDOM). الآن الشريط العلوي
       بالكامل فوق الجانبي دائماً. */
    z-index: 40 !important;
}
.topbar-luxe::after { display: none; }

.topbar-btn {
    background: rgba(30,45,74,0.04);
    border: 1px solid rgba(30,45,74,0.12);
    color: rgba(30,45,74,0.60);
    transition: all var(--t-fast);
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
}
.topbar-btn:hover {
    background: rgba(15,110,86,0.12);
    border-color: rgba(15,110,86,0.32);
    color: var(--sw-accent-lt);
    transform: translateY(-1px);
}

.live-clock {
    font-size: 11px;
    font-weight: 700;
    color: rgba(15,110,86,0.70);
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}


/* ══════════════════════════════════════════════════════════════════════
   11 · MAIN CONTENT BACKGROUND
   ══════════════════════════════════════════════════════════════════════ */
.main-bg {
    background:
        radial-gradient(ellipse 60% 42% at 90% -4%, rgba(15,110,86,0.09) 0%, transparent 60%),
        radial-gradient(ellipse 55% 42% at 4% 2%,    rgba(91,168,232,0.10) 0%, transparent 60%),
        linear-gradient(150deg, #ffffff 0%, #f5f9fd 38%, #faf6eb 70%, #eef2f7 100%);
}


/* ══════════════════════════════════════════════════════════════════════
   12 · KPI CARDS
   ══════════════════════════════════════════════════════════════════════ */
.kpi-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%);
    border: 1px solid rgba(30,45,74,0.08);
    border-radius: var(--r-lg);
    padding: 18px 16px 15px;
    position: relative;
    overflow: hidden;
    transition: transform var(--t-spring), box-shadow var(--t-med), border-color var(--t-med);
    animation: countUp 0.45s ease-out backwards;
}
.kpi-card:nth-child(1) { animation-delay: 0.04s; }
.kpi-card:nth-child(2) { animation-delay: 0.09s; }
.kpi-card:nth-child(3) { animation-delay: 0.14s; }
.kpi-card:nth-child(4) { animation-delay: 0.19s; }
.kpi-card::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,110,86,0.10) 0%, transparent 65%);
    pointer-events: none;
}
.kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(15,110,86,0.40) 50%, transparent 100%);
}
.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 32px rgba(30,45,74,0.12),
        0 0 0 1px rgba(15,110,86,0.22);
    border-color: rgba(15,110,86,0.28);
}


/* ══════════════════════════════════════════════════════════════════════
   13 · CHART PANELS
   ══════════════════════════════════════════════════════════════════════ */
.chart-panel {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%);
    border: 1px solid rgba(30,45,74,0.08);
    border-radius: var(--r-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--t-med), border-color var(--t-med);
}
.chart-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(15,110,86,0.26) 50%, transparent 100%);
}
.chart-panel:hover {
    box-shadow: 0 10px 28px rgba(30,45,74,0.10);
    border-color: rgba(15,110,86,0.18);
}
.dept-charts-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 14px;
}


/* ══════════════════════════════════════════════════════════════════════
   14 · DEPARTMENT HEADER
   ══════════════════════════════════════════════════════════════════════ */
.dept-header {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%);
    border: 1px solid rgba(15,110,86,0.20);
    border-radius: var(--r-xl);
    padding: 22px 26px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out backwards;
}
.dept-header::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15,110,86,0.36) 50%, transparent);
}
.dept-header::after {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,110,86,0.08) 0%, transparent 65%);
    pointer-events: none;
}


/* ══════════════════════════════════════════════════════════════════════
   15 · FUNCTION CARDS
   ══════════════════════════════════════════════════════════════════════ */
.func-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%);
    border: 1px solid rgba(30,45,74,0.08);
    border-radius: var(--r-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform var(--t-spring), box-shadow var(--t-med), border-color var(--t-med);
}
.func-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15,110,86,0.22) 50%, transparent);
    opacity: 0;
    transition: opacity var(--t-med);
}
.func-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(30,45,74,0.12);
    border-color: rgba(15,110,86,0.22);
}
.func-card:hover::before { opacity: 1; }

.func-icon-badge {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 15px;
    flex-shrink: 0;
    transition: transform var(--t-spring);
    position: relative;
    overflow: hidden;
}
.func-icon-badge::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 55%);
    border-radius: inherit;
    pointer-events: none;
}
.func-card:hover .func-icon-badge {
    transform: scale(1.12) rotate(-4deg);
    animation: iconBounce 0.4s ease-out;
}

.glow-sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(80,130,200,0.14) 50%, transparent);
}


/* ══════════════════════════════════════════════════════════════════════
   16 · BUTTONS
   ══════════════════════════════════════════════════════════════════════ */
.btn-gold, .btn-ghost, .btn-blue, .btn-teal, .btn-red {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--r-sm);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--t-fast);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.btn-gold {
    background: linear-gradient(135deg, #BF8C2E 0%, #E0B040 100%);
    color: #0d1824;
    box-shadow: 0 4px 16px rgba(15,110,86,0.36);
}
.btn-gold:hover {
    background: linear-gradient(135deg, #CB9A35 0%, #F0C048 100%);
    box-shadow: 0 8px 28px rgba(15,110,86,0.50);
    transform: translateY(-2px);
}
.btn-gold:active { transform: translateY(0); }

.btn-ghost {
    background: rgba(30,45,74,0.04);
    color: rgba(30,45,74,0.62);
    border: 1px solid rgba(30,45,74,0.14);
}
.btn-ghost:hover {
    background: rgba(30,45,74,0.08);
    color: var(--pui-ink, #1E2422);
    border-color: rgba(30,45,74,0.24);
}

.btn-blue {
    background: linear-gradient(135deg, #215FA8 0%, #3280CC 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(55,138,221,0.30);
}
.btn-blue:hover {
    background: linear-gradient(135deg, #2A72BC 0%, #4292DC 100%);
    box-shadow: 0 8px 28px rgba(55,138,221,0.44);
    transform: translateY(-2px);
}

.btn-teal {
    background: linear-gradient(135deg, #156852 0%, #1D9E75 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(29,158,117,0.30);
}
.btn-teal:hover {
    background: linear-gradient(135deg, #1A8468 0%, #22B888 100%);
    box-shadow: 0 8px 28px rgba(29,158,117,0.44);
    transform: translateY(-2px);
}

.btn-red {
    background: linear-gradient(135deg, #A83030 0%, #CC4040 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(226,75,74,0.30);
}
.btn-red:hover {
    background: linear-gradient(135deg, #BC3838 0%, #E04848 100%);
    box-shadow: 0 8px 28px rgba(226,75,74,0.42);
    transform: translateY(-2px);
}


/* ══════════════════════════════════════════════════════════════════════
   17 · BADGES
   ══════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    white-space: nowrap;
    border: 1px solid transparent;
    letter-spacing: 0.2px;
}
.badge-success { background: rgba(21,115,71,0.10);  color: #157347; border-color: rgba(21,115,71,0.30); }
.badge-warning { background: rgba(186,117,23,0.12);  color: #854f0b; border-color: rgba(186,117,23,0.32); }
.badge-danger  { background: rgba(192,57,43,0.10);   color: #c0392b; border-color: rgba(192,57,43,0.30);  }
.badge-info    { background: rgba(44,111,199,0.10);  color: #2c6fc7; border-color: rgba(44,111,199,0.30); }


/* ══════════════════════════════════════════════════════════════════════
   18 · LUXURY TABLE
   ══════════════════════════════════════════════════════════════════════ */
.luxury-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 3px;
    font-family: 'Cairo', sans-serif;
    font-size: 11.5px;
}
.luxury-table thead th {
    background: transparent;
    color: var(--pui-accent, #1BB18C);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.6px;
    padding: 10px 14px;
    text-align: right;
    border-bottom: 1.5px solid rgba(30,45,74,0.10);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.luxury-table thead th:first-child { border-radius: 8px 0 0 8px; }
.luxury-table thead th:last-child  { border-radius: 0 8px 8px 0; }
.luxury-table tbody tr {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(30,45,74,0.05), inset 0 0 0 1px #eef1f6;
    transition: box-shadow var(--t-fast);
}
.luxury-table tbody tr:nth-child(even) {
    background: linear-gradient(135deg,#f4f8fc 0%,#eef2f6 100%);
}
.luxury-table tbody tr:hover {
    box-shadow: 0 3px 10px rgba(15,110,86,.14), inset 0 0 0 1px rgba(15,110,86,.35);
}
.luxury-table tbody td {
    padding: 11px 14px;
    color: var(--pui-ink, #1E2422);
    border-top: none;
    white-space: nowrap;
}
.luxury-table tbody td:first-child { border-radius: 8px 0 0 8px; }
.luxury-table tbody td:last-child  { border-radius: 0 8px 8px 0; }


/* ══════════════════════════════════════════════════════════════════════
   19 · ACTION BUTTONS (icon-only)
   ══════════════════════════════════════════════════════════════════════ */
.action-btn {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
    background: transparent;
    font-size: 12px;
}
.action-btn.view  { color: rgba(55,138,221,0.75);  border-color: rgba(55,138,221,0.20); }
.action-btn.view:hover  { background: rgba(55,138,221,0.15);  color: #378ADD;  border-color: rgba(55,138,221,0.42); transform: scale(1.1); }
.action-btn.edit  { color: rgba(15,110,86,0.75);  border-color: rgba(15,110,86,0.20); }
.action-btn.edit:hover  { background: rgba(15,110,86,0.15);  color: var(--sw-accent); border-color: rgba(15,110,86,0.42); transform: scale(1.1); }
.action-btn.del   { color: rgba(226,75,74,0.70);   border-color: rgba(226,75,74,0.20); }
.action-btn.del:hover   { background: rgba(226,75,74,0.15);   color: #E24B4A;  border-color: rgba(226,75,74,0.42); transform: scale(1.1); }
.action-btn.print { color: rgba(45,200,143,0.70);  border-color: rgba(45,200,143,0.20); }
.action-btn.print:hover { background: rgba(45,200,143,0.14);  color: #2DC88F;  border-color: rgba(45,200,143,0.40); transform: scale(1.1); }


/* ══════════════════════════════════════════════════════════════════════
   20 · FORM INPUTS
   ══════════════════════════════════════════════════════════════════════ */
.field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: rgba(30,45,74,0.50);
    margin-bottom: 7px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.input-luxe {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--r-sm);
    padding: 9px 13px;
    font-family: 'Cairo', sans-serif;  /* [2026-08-20] توحيد على عائلة واحدة */
    font-size: 12px;
    color: var(--tx-prime);
    transition: border-color var(--t-med), background var(--t-med), box-shadow var(--t-med);
    outline: none;
    -webkit-appearance: none;
}
.input-luxe:focus {
    border-color: rgba(15,110,86,0.55);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15,110,86,0.12);
}
.input-luxe::placeholder { color: rgba(30,45,74,0.32); }
.input-luxe option       { background: #ffffff; color: var(--tx-prime); }


/* ══════════════════════════════════════════════════════════════════════
   21 · SETTINGS — wrapper + header + grid + cards + rows
   ══════════════════════════════════════════════════════════════════════ */

/* ── المغلف الرئيسي — يحمل الـ scroll بنفسه ── */
.settings-scroll-wrap {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 20px 40px;
    background:
        radial-gradient(ellipse 60% 40% at 90% -4%, rgba(15,110,86,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 55% 40% at 4% 2%,   rgba(91,168,232,0.08) 0%, transparent 60%),
        linear-gradient(150deg, #ffffff 0%, #f5f9fd 40%, #f3f5f7 100%);
    /* scrollbar مخصصة لقسم الإعدادات */
    scrollbar-width: thin;
    scrollbar-color: rgba(15,110,86,0.35) rgba(255,255,255,0.04);
}
.settings-scroll-wrap::-webkit-scrollbar       { width: 6px; }
.settings-scroll-wrap::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 4px; }
.settings-scroll-wrap::-webkit-scrollbar-thumb { background: rgba(15,110,86,0.32); border-radius: 4px; }
.settings-scroll-wrap::-webkit-scrollbar-thumb:hover { background: rgba(15,110,86,0.55); }

/* ── رأس الصفحة ── */
.settings-page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(15,110,86,0.08) 0%, #ffffff 100%);
    border: 1px solid rgba(15,110,86,0.20);
    border-radius: 16px;
}
.settings-page-icon {
    width: 46px; height: 46px;
    background: linear-gradient(135deg, #0b5744, #1d9e75);
    border: 1px solid rgba(15,110,86,0.25);
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0; color: #fff;
    box-shadow: 0 6px 16px rgba(15,110,86,0.28);
}
.settings-page-title {
    font-size: 15px; font-weight: 800; color: #1a2b25; letter-spacing: .02em;
    font-family: 'Cairo', sans-serif;  /* [2026-08-20] كان El Messiri — خطّ زخرفى لا خطّ واجهات */
}
.settings-page-sub {
    font-size: 10.5px; color: rgba(30,45,74,0.42); margin-top: 2px; font-weight: 500;
}
.settings-page-badge {
    margin-right: auto; flex-shrink: 0;
    background: rgba(15,110,86,0.12);
    border: 1px solid rgba(15,110,86,0.22);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 10px; font-weight: 700;
    color: rgba(15,110,86,0.75);
}

/* ── الشبكة — 2 أعمدة على الشاشات المتوسطة، 3 على الكبيرة ── */
.settings-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 1400px) {
    .settings-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .settings-grid { grid-template-columns: 1fr; }
}

/* ── البطاقة ── */
.settings-card {
    background: linear-gradient(145deg, #ffffff 0%, #f4f7fc 100%);
    border: 1px solid rgba(80,130,200,0.14);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow var(--t-med), border-color var(--t-med), transform var(--t-spring);
}
.settings-card:hover {
    box-shadow: 0 10px 36px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    border-color: rgba(15,110,86,0.30);
    transform: translateY(-2px);
}

/* ── رأس البطاقة — خلفية فاتحة ── */
.settings-card > div:first-child {
    background: linear-gradient(135deg, #f8faff 0%, #eef3fb 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}

/* ── الصفوف ── */
.settings-row {
    transition: background var(--t-fast);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover {
    background: rgba(15,110,86,0.06);
    cursor: pointer;
}
.settings-row:hover .ti-chevron-left {
    transform: translateX(-3px);
    transition: transform 0.2s ease;
    color: rgba(15,110,86,0.5);
}

/* ── [إصلاح 2026-07-19] حركة دخول + دعم prefers-reduced-motion —
   نفس نمط الهوية المرجعية المطبّق على journal_entries/cost_centers ── */
@keyframes settingsCardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.settings-page-header { animation: settingsCardIn .3s ease-out backwards; }
.settings-card { animation: settingsCardIn .3s ease-out backwards; }
.settings-grid .settings-card:nth-child(1) { animation-delay: .02s; }
.settings-grid .settings-card:nth-child(2) { animation-delay: .05s; }
.settings-grid .settings-card:nth-child(3) { animation-delay: .08s; }
.settings-grid .settings-card:nth-child(4) { animation-delay: .11s; }
.settings-grid .settings-card:nth-child(5) { animation-delay: .14s; }
.settings-grid .settings-card:nth-child(n+6) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) {
    .settings-scroll-wrap *, .settings-scroll-wrap { animation: none; transition: none; }
}


/* ══════════════════════════════════════════════════════════════════════
   22 · QUICK STATS
   ══════════════════════════════════════════════════════════════════════ */
.quick-stat {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%);
    border: 1px solid rgba(30,45,74,0.08);
    border-radius: var(--r-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform var(--t-spring), box-shadow var(--t-med), border-color var(--t-med);
    position: relative;
    overflow: hidden;
}
.quick-stat::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15,110,86,0.18) 50%, transparent);
}
.quick-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    border-color: rgba(15,110,86,0.20);
}


/* ══════════════════════════════════════════════════════════════════════
   23 · SECTION LABELS
   ══════════════════════════════════════════════════════════════════════ */
.section-label      { display: flex; align-items: center; gap: 12px; }
.section-label-text {
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(30,45,74,0.55);
    letter-spacing: 0.8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}
.section-label-line  { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(80,130,200,0.14), transparent); }
.section-label-count { font-size: 10px; color: rgba(15,110,86,0.58); font-weight: 600; white-space: nowrap; }


/* ══════════════════════════════════════════════════════════════════════
   24 · STATUS DOT & PROGRESS BARS
   ══════════════════════════════════════════════════════════════════════ */
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.active  { background: #2DC88F; box-shadow: 0 0 0 2px rgba(45,200,143,0.22); animation: pulse-teal 2s infinite; }
.status-dot.warning { background: #E08830; }
.status-dot.danger  { background: #E24B4A; }

.prog-bar-wrap {
    height: 5px;
    background: rgba(80,130,200,0.14);
    border-radius: 10px;
    overflow: hidden;
}
.prog-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.34,1.2,0.64,1);
    background: linear-gradient(90deg, var(--teal), var(--teal2));
    position: relative;
    overflow: hidden;
}
.prog-bar-fill::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.24) 50%, transparent);
    animation: shimmer 1.8s linear infinite;
    background-size: 200% 100%;
}


/* ══════════════════════════════════════════════════════════════════════
   FRAGMENT MODULES
   ══════════════════════════════════════════════════════════════════════ */

/* 26 · FRAGMENT NAV TABS */
.styled-link.current-active {
    background: linear-gradient(135deg, #BF8C2E 0%, #E0B040 100%) !important;
    color: #0d1824 !important;
    box-shadow: 0 4px 16px rgba(15,110,86,0.36);
}
.sub_content_section        { display: none; }
.sub_content_section.active { display: block; }


/* 27 · MODULE CARDS GRID */
.module-card {
    background: #ffffff;
    border: 1px solid rgba(30,45,74,0.08);
    border-radius: 14px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all var(--t-med);
    cursor: default;
}
.module-card.module-enabled {
    border-color: rgba(45,200,143,0.30);
    background: rgba(45,200,143,0.07);
}
.module-card.module-disabled {
    border-color: rgba(80,130,200,0.10);
    opacity: 0.60;
}
.module-card:hover { transform: translateY(-2px); }
.module-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(15,110,86,0.12);
    border: 1px solid rgba(15,110,86,0.22);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: #0f6e56;
}
.module-label     { font-size: 11px; font-weight: 700; color: var(--pui-ink, #1E2422); line-height: 1.3; }
.module-code-tag  { font-size: 9px; color: rgba(30,45,74,0.45); background: rgba(30,45,74,0.05); padding: 2px 7px; border-radius: 6px; }
.module-date      { font-size: 9.5px; color: rgba(30,45,74,0.40); }


/* 28 · TOGGLE SWITCH */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px; height: 20px;
    cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: rgba(80,130,200,0.20);
    border-radius: 20px;
    transition: 0.25s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    right: 3px; bottom: 3px;
    background: rgba(200,220,245,0.65);
    border-radius: 50%;
    transition: 0.25s;
}
.toggle-switch input:checked + .toggle-slider             { background: #1D9E75; }
.toggle-switch input:checked + .toggle-slider::before     { transform: translateX(-18px); background: #fff; }


/* 29 · BTN-ACTION (text variant) */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
}
.btn-action.btn-success {
    color: #2DC88F;
    border-color: rgba(45,200,143,0.28);
    background: rgba(45,200,143,0.09);
}
.btn-action.btn-success:hover { background: rgba(45,200,143,0.18); transform: scale(1.04); }
.btn-action.btn-danger {
    color: #F07070;
    border-color: rgba(226,75,74,0.28);
    background: rgba(226,75,74,0.09);
}
.btn-action.btn-danger:hover { background: rgba(226,75,74,0.18); transform: scale(1.04); }
.btn-action.btn-edit {
    color: #8fe3c4;
    border-color: rgba(15,110,86,0.28);
    background: rgba(15,110,86,0.09);
}
.btn-action.btn-edit:hover { background: rgba(15,110,86,0.18); transform: scale(1.04); }
.btn-action.btn-warning {
    color: #E8A54E;
    border-color: rgba(232,165,78,0.28);
    background: rgba(232,165,78,0.09);
}
.btn-action.btn-warning:hover { background: rgba(232,165,78,0.18); transform: scale(1.04); }

/* [FIX] .status-badge — تستخدمها BaseUIManager.statusBadge() ومعظم صفحات
   الإدارة (companies, locations, ...) لعرض حالة نشط/موقوف، ولم تكن
   معرَّفة إطلاقاً في أي ملف تنسيق — تُعرَض بلا أي تنسيق (نص عادي فقط). */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}
.status-badge.active {
    color: #2DC88F;
    border-color: rgba(45,200,143,0.28);
    background: rgba(45,200,143,0.09);
}
.status-badge.inactive {
    color: #F07070;
    border-color: rgba(226,75,74,0.28);
    background: rgba(226,75,74,0.09);
}


/* ══════════════════════════════════════════════════════════════════════
   TAILWIND WHITE TEXT OVERRIDES — تحويل النصوص البيضاء في المحتوى
   يطبق فقط داخل #main-content
   ══════════════════════════════════════════════════════════════════════ */
#main-content .text-white\/65,
#main-content .text-white\/70,
#main-content .text-white\/75,
#main-content .text-white\/80 { color: rgba(237,234,227,0.82); }

#main-content .text-white\/52,
#main-content .text-white\/55,
#main-content .text-white\/60 { color: rgba(237,234,227,0.64); }

#main-content .text-white\/40,
#main-content .text-white\/42,
#main-content .text-white\/45,
#main-content .text-white\/50 { color: rgba(237,234,227,0.50); }

#main-content .text-white\/30,
#main-content .text-white\/32,
#main-content .text-white\/35,
#main-content .text-white\/38 { color: rgba(237,234,227,0.38); }

#main-content .text-white\/20,
#main-content .text-white\/22,
#main-content .text-white\/24,
#main-content .text-white\/25,
#main-content .text-white\/28 { color: rgba(237,234,227,0.28); }

#main-content .text-white\/10,
#main-content .text-white\/12,
#main-content .text-white\/15,
#main-content .text-white\/18 { color: rgba(237,234,227,0.18); }

/* ══════════════════════════════════════════════════════════════════════
   EXECUTIVE HORIZON THEME — Royal Navy × Stone Gray × Silver Glass ×
   Brushed Gold × Soft Sky Blue
   ══════════════════════════════════════════════════════════════════════ */

/* خلفية المحتوى — «الأفق التنفيذى Executive Horizon»
   تدرج لبنى/أزرق واضح من الأعلى، يذوب نحو توهج ذهبى دافئ فى الوسط
   ثم رمادى حجرى دافئ عند الحافة السفلية — بروح الصورة المرجعية بالظبط */
.main-bg {
    /* [UI 2026-07-13] هوية فاخرة فاتحة — أبيض/لبنى غامق/رمادى/ذهبى.
       استبدال كامل للتدرج الداكن السابق بطلب صريح من المستخدم. */
    background:
        radial-gradient(ellipse 60% 42% at 92% -6%, rgba(15,110,86,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 55% 42% at 4% 0%,    rgba(91,168,232,0.10) 0%, transparent 60%),
        linear-gradient(150deg, #ffffff 0%, #f5f9fd 38%, #faf6eb 70%, #eef2f7 100%) !important;
}

/* Scrollbar واضح لـ main-content */
#main-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(15,110,86,0.45) #f1f5f9;
}
#main-content::-webkit-scrollbar         { width: 8px; }
#main-content::-webkit-scrollbar-track   { background: #f1f5f9; border-radius: 8px; }
#main-content::-webkit-scrollbar-thumb   {
    background: rgba(15,110,86,0.45);
    border-radius: 8px;
    border: 2px solid #f1f5f9;
}
#main-content::-webkit-scrollbar-thumb:hover { background: rgba(15,110,86,0.75); }

/* ══════════════════════════════════════════════════════════════════════
   EXCHANGE FLOOR SKIN — Midnight Blue × Dark Gold × White
   [REBUILT] هوية جديدة بالكامل: شاشة تداول عالمية داكنة، بلا تغيير
   فى أى اسم كلاس — تعديل بصرى فقط.
   ══════════════════════════════════════════════════════════════════════ */
/* [توحيد 2026-07-27] .topbar-luxe/::after المكرَّرتان هنا دُمجتا فى التعريف
   الأصلي أعلى الملف (قسم 10 · TOP BAR) — القيم الفعلية لم تتغيّر إطلاقاً. */
/* [2026-08-16] رُفعت `!important` عن أزرار البار وعن الساعة.
   ────────────────────────────────────────────────────────────────────
   هذه بقايا هوية «Exchange Floor» (كحلى × ذهبى) — وهى **مهجورة**:
   هوية النظام المعتمدة خضراء بنصّ `design-tokens.css` («لون العلامة
   الأساسي، ثابت»). فبقيت هنا تفرض ذهباً على تحويم أزرار البار وعلى
   لون الساعة، وتغلب كل ما بعدها بحكم `!important` لا بحكم القصد.

   و`.topbar-btn` مُعرَّف **مرتين فى هذا الملف** (سطر 564 وهنا)، والثانى
   يفرض نفسه على الأول — فالملفُ يُنازع نفسه.

   > **و`!important` تُكتب لتحسم خلافاً، فتبقى بعد أن ينتهى الخلاف**
   > **وتُخاصم من لم يكن طرفاً فيه.**

   القيم بقيت كما هى — حُذف الفرضُ وحده، فتعمل الآن قواعدُ التتالى
   الطبيعية: ما هو أدقّ أو أحدث يغلب. وهو عين ما يوصى به `layers.css`
   عند الهجرة: «احذف الـ!important الزائدة». */
.topbar-btn {
    background: rgba(30,45,74,0.05);
    border: 1px solid rgba(30,45,74,0.10);
    color: var(--pui-ink, #1E2422);
    box-shadow: none;
}
.topbar-btn:hover {
    background: rgba(212,175,106,0.14);
    border-color: #D4AF6A;
    color: var(--pui-accent, #1BB18C);
}
.live-clock { color: #D4AF6A; text-shadow: none; }
#top-title  { color: var(--pui-ink, #1E2422); text-shadow: none; }
#breadcrumb { color: #7a8fb0; }

/* ══════════════════════════════════════════════════════════════════════
   #tools-sidebar — بار الأدوات الجانبى الأيسر، ذهبى احترافى بطول الشاشة
   (المستخدم أعلى، الثيم/اللغة، فاصل، التصدير/الطباعة أسفل)
   ══════════════════════════════════════════════════════════════════════ */
/* [2026-07-17] البار الجانبى أزرق ملكى صلب بأيقونات فاتحة — نمط الصور المرجعية */
#tools-sidebar {
    position: relative !important;
    background: linear-gradient(180deg, #0f1b2e 0%, #152238 55%, #0f1b2e 100%) !important;   /* كحلى المرجع */
    border-right: 1px solid #24344f !important;
    box-shadow: -6px 0 22px rgba(15,25,70,0.25), inset -1px 0 0 rgba(255,255,255,0.06) !important;
    z-index: 25 !important;
}
/* حاوية الأزرار — بلا overflow مقصوداً: أى overflow (ولو auto) على هذا
   العنصر الضيق كان بيقصّ القوائم المنسدلة العائمة (الثيم/اللغة/المستخدم/
   التصدير) لأنها absolute بداخله. لو زاد عدد الأزرار مستقبلاً عن ارتفاع
   الشاشة، الحل الصحيح هو تصغير حجم الأيقونات وليس overflow-y. */
#tools-sidebar-stack {
    width: 100%;
    padding-bottom: 16px;
}
#tools-sidebar .topbar-btn,
#tools-sidebar #theme-btn,
#tools-sidebar #lang-btn {
    width: 34px; height: 34px;
    padding: 0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    gap: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid #24344f;
    color: #8fa3bf;          /* navmut من المرجع */
}
#tools-sidebar .topbar-btn:hover,
#tools-sidebar #theme-btn:hover,
#tools-sidebar #lang-btn:hover {
    background: #152238;
    border-color: #1d9e75;   /* لمسة الأخضر المرجعية */
    color: #e8eef7;
    box-shadow: 0 0 12px rgba(29,158,117,0.30);
}
#topbar-export-btn span[data-i18n="topbar.export"],
button[onclick*="printPage"] span[data-i18n="topbar.print"],
#tools-sidebar .lang-btn-label { display: none; }
#topbar-export-btn .ti-chevron-down { display: none; }

.tools-sidebar-sep {
    width: 26px; height: 1px; margin: 4px 0 2px;
    background: linear-gradient(90deg, transparent, #24344f, transparent);
}

/* avatar المستخدم — دائرة ذهبية موحدة القياس تتصدّر البار */
#tools-sidebar .um-wrap { position: relative; }
#tools-sidebar .um-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d9e75, #0f6e56);
    border: 2px solid rgba(230,179,37,0.70);   /* حلقة ذهب المرجع (brandmark) */
    box-shadow: 0 3px 12px rgba(0,0,0,0.35), 0 0 0 3px rgba(29,158,117,0.15);
    font-size: 12.5px;
}
#tools-sidebar .um-badge {
    min-width: 15px; height: 15px;
    font-size: 8.5px; line-height: 15px;
    top: -3px; left: -3px;
    border: 1.5px solid var(--pui-ink, #1E2422);
}
#tools-sidebar .um-panel { left: 46px; right: auto; top: 0; }

/* بطاقات KPI — «الزجاج الذكى Smart-Glass»: شفافية أعلى + مسحة فضية باردة
   تعكس ضوء الخلفية بنعومة بدل الإطار الصلب الغامق */
.kpi-card {
    /* [UI 2026-07-13] بطاقة بيضاء فاخرة بشريط علوى ذهبى/لبنى بدل الزجاج الداكن */
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(30,45,74,0.08) !important;
    border-top-color: rgba(30,45,74,0.08) !important;
    box-shadow: 0 4px 14px rgba(30,45,74,0.07), inset 0 1px 0 rgba(255,255,255,0.6) !important;
    position: relative !important;
    overflow: hidden !important;
}
/* شريط علوى ذهبى/لبنى مزدوج بدل الزجاج */
.kpi-card::before {
    display: block !important;
    content: '' !important;
    position: absolute !important;
    top: 0; right: 0; left: 0; height: 3px !important;
    background: linear-gradient(90deg,#0f6e56,#5BA8E8,#0f6e56) !important;
}
.kpi-card::after {
    display: block !important;
    content: '' !important;
    position: absolute !important;
    top: 0; right: 0;
    width: 0; height: 0;
    border-style: solid;
    border-width: 0 16px 16px 0;
    border-color: transparent rgba(15,110,86,0.12) transparent transparent;
    border-radius: 0 12px 0 0;
    pointer-events: none;
    z-index: 2;
    transition: all .2s ease;
}
.kpi-card:hover {
    box-shadow: 0 12px 30px rgba(30,45,74,0.12), 0 0 0 1px rgba(15,110,86,0.20) !important;
    border-color: rgba(15,110,86,0.28) !important;
    transform: translateY(-4px) !important;
}
.kpi-card:hover::after { border-color: transparent rgba(15,110,86,0.30) transparent transparent; }

/* لوحات الرسوم — إطار زجاجى واضح (Frosted Glass Pane) بحافة مضيئة عاكسة
   تماماً كالألواح الزجاجية فى الصورة المرجعية */
.chart-panel {
    /* [UI 2026-07-13] لوح أبيض فاخر بدل الزجاج الداكن */
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(30,45,74,0.08) !important;
    border-top-color: rgba(30,45,74,0.08) !important;
    box-shadow: 0 4px 14px rgba(30,45,74,0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow: hidden !important;
}
.chart-panel::before {
    display: block; content: '' !important; position: absolute !important;
    top: 0; right: 0; left: 0; height: 2px !important;
    background: linear-gradient(90deg, transparent, rgba(15,110,86,0.45) 50%, transparent) !important;
}
.chart-panel::after { display: none; }
.chart-panel:hover {
    box-shadow: 0 10px 26px rgba(30,45,74,0.10) !important;
    border-color: rgba(15,110,86,0.20) !important;
}

/* استثناء: لوح "اتجاه التدفق النقدى" فقط يطفو بلا إطار/صندوق كما فى المرجع
   — specificity أعلى من قواعد [data-theme=...] .chart-panel فى themes.css
     (التى تُحمَّل بعد هذا الملف وتتساوى معه فى الأولوية بدونها) */
[data-theme] .chart-panel.chart-panel--flat,
.chart-panel.chart-panel--flat {
    background: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(255,255,255,0.05) 0%, transparent 60%),
        transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    overflow: visible;
}
[data-theme] .chart-panel.chart-panel--flat::before,
.chart-panel.chart-panel--flat::before {
    display: none;
}
[data-theme] .chart-panel.chart-panel--flat:hover,
.chart-panel.chart-panel--flat:hover {
    box-shadow: none;
    border-color: transparent;
}

/* ══════════════════════════════════════════════════════════════════════
   HUB — بوابة دخول الشركة (كروت الأقسام) — كلاسات جديدة بالكامل، إضافية فقط
   ══════════════════════════════════════════════════════════════════════ */
.hub-dept-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%);
    border: 1px solid rgba(30,45,74,0.08);
    box-shadow: 0 4px 14px rgba(30,45,74,0.06);
    transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.hub-dept-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15,110,86,0.35);
    box-shadow: 0 10px 26px rgba(30,45,74,0.12);
}
.hub-dept-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.hub-dept-name {
    font-size: 12.5px; font-weight: 800; color: var(--pui-ink, #1E2422); margin-bottom: 3px; line-height: 1.3;
    font-family: 'Cairo', sans-serif;  /* [2026-08-20] كان El Messiri — خطّ زخرفى لا خطّ واجهات */
}
.hub-dept-desc {
    font-size: 9.5px; color: rgba(30,45,74,0.48); line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hub-dept-meta {
    font-size: 9px; font-weight: 700; margin-top: 5px;
}
.hub-dash-card {
    margin-bottom: 4px;
    border: 1px solid rgba(15,110,86,0.30);
    background: linear-gradient(145deg, #fffaf0 0%, #f7fafd 100%);
}

/* شريحة المستخدم أعلى الـ Hub */
.hub-user-chip {
    display: flex; align-items: center; gap: 9px;
    background: #ffffff;
    border: 1px solid rgba(15,110,86,0.22);
    border-radius: 12px;
    padding: 6px 12px 6px 6px;
    box-shadow: 0 2px 8px rgba(30,45,74,0.05);
}
.hub-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(212,175,106,0.55);
    display: flex; align-items: center; justify-content: center;
    color: rgba(30,45,74,0.35);
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.20);
}

/* معرض صور نشاط الشركة — [UI 2026-07-13] بانر عرض شرائح بعرض الصفحة بالكامل
   بإطار ذهبى فاخر يتماشى مع هوية النظام، بدل صندوق أبيض معزول عن الصفحة */
.hub-photo-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 6;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(212,175,106,0.35);
    box-shadow: 0 14px 36px rgba(5,9,18,0.30), inset 0 0 0 1px rgba(255,255,255,0.10);
}
/* إطار زخرفى داخلى خفيف يوحّد المعرض مع باقى الزجاج الذهبى فى الصفحة */
.hub-photo-gallery::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(212,175,106,0.18), inset 0 40px 60px -40px rgba(0,0,0,0.35);
    pointer-events: none;
    z-index: 3;
}
.hub-photo-frame {
    position: absolute; inset: 0;
    background: #ffffff;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    color: rgba(30,45,74,0.20);
    font-size: 40px;
    opacity: 0;
    transition: opacity 0.9s ease;
    pointer-events: none;
}
.hub-photo-frame.active {
    opacity: 1;
    pointer-events: auto;
}
.hub-photo-frame::before {
    content: 'صورة الشركة ستُضاف هنا قريباً';
    font-size: 11px;
    font-weight: 700;
    color: rgba(30,45,74,0.30);
    letter-spacing: .3px;
}
.hub-photo-dots {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 7px; z-index: 4;
}
.hub-photo-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(30,45,74,0.20);
    transition: background var(--t-med), transform var(--t-med);
}
.hub-photo-dot.active {
    background: #D4AF6A;
    transform: scale(1.3);
}
@media (max-width: 900px) {
    .hub-photo-gallery { aspect-ratio: 16 / 9; }
}

/* رأس القسم — أبيض فاخر بحد ذهبى يمين */
.dept-header {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(30,45,74,0.08) !important;
    border-right: 3px solid #0f6e56 !important;
    box-shadow: 0 3px 12px rgba(30,45,74,0.06) !important;
}
.dept-header::before { display: none !important; }
.dept-header::after  { display: none !important; }

/* بطاقات الوظائف — أبيض فاخر */
.func-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(30,45,74,0.08) !important;
    box-shadow: 0 3px 12px rgba(30,45,74,0.06) !important;
}
.func-card::before { display: none; }
.func-card:hover {
    box-shadow: 0 10px 26px rgba(30,45,74,0.12) !important;
    border-color: rgba(15,110,86,0.40) !important;
    transform: translateY(-4px) !important;
}

/* Ghost button */
.btn-ghost {
    background: rgba(30,45,74,0.04) !important;
    color: rgba(30,45,74,0.62) !important;
    border: 1px solid rgba(30,45,74,0.14) !important;
}
.btn-ghost:hover {
    background: rgba(15,110,86,0.12) !important;
    color: var(--pui-accent, #1BB18C) !important;
    border-color: rgba(15,110,86,0.35) !important;
}

/* الجدول — كل سطر داخل صندوقه الخاص (Boxed Rows) */
.luxury-table { border-collapse: separate !important; }
.luxury-table thead th {
    background: transparent !important;
    color: var(--pui-accent, #1BB18C) !important;
    border-bottom: 1.5px solid rgba(30,45,74,0.10) !important;
}
.luxury-table tbody tr {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(30,45,74,0.05), inset 0 0 0 1px #eef1f6 !important;
    transition: background .15s ease, box-shadow .15s ease !important;
}
.luxury-table tbody tr:nth-child(even) {
    background: linear-gradient(135deg,#f4f8fc 0%,#eef2f6 100%) !important;
}
.luxury-table tbody tr:hover {
    background: #fdf6e8;
    box-shadow: 0 3px 10px rgba(15,110,86,.14), inset 0 0 0 1px rgba(15,110,86,.35) !important;
}
.luxury-table tbody td {
    color: var(--pui-ink, #1E2422) !important;
    border-top: none !important;
}

/* فاصل توهج */
.glow-sep {
    background: linear-gradient(90deg, transparent, rgba(212,175,106,0.30) 50%, transparent) !important;
}

/* [ApexCharts] صندوق التلميح عند التأشير — ذهبى انسيابى زجاجى
   بدل الصندوق الأبيض الافتراضى، يطابق روح الصورة المرجعية */
.apexcharts-tooltip {
    background: linear-gradient(160deg, #ffffff 0%, #f7fafd 100%) !important;
    border: 1px solid rgba(15,110,86,0.35) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 24px rgba(30,45,74,0.14), 0 0 0 1px rgba(15,110,86,0.08) !important;
    backdrop-filter: blur(10px) !important;
    overflow: hidden !important;
    color: var(--pui-ink, #1E2422) !important;
}
.apexcharts-tooltip-title {
    background: linear-gradient(90deg, rgba(15,110,86,0.14), rgba(15,110,86,0.03));
    border-bottom: 1px solid rgba(15,110,86,0.20);
    color: var(--pui-accent, #1BB18C);
    font-family: 'Cairo', sans-serif;  /* [2026-08-20] توحيد على عائلة واحدة */
    font-weight: 700;
}
.apexcharts-tooltip-series-group { color: var(--pui-ink, #1E2422); }
.apexcharts-tooltip .apexcharts-tooltip-marker { box-shadow: 0 0 6px currentColor; }
.apexcharts-xaxistooltip {
    background: #ffffff;
    border-color: rgba(15,110,86,0.35);
    color: var(--pui-ink, #1E2422);
    border-radius: 8px;
}
.apexcharts-xaxistooltip::before, .apexcharts-xaxistooltip::after { display: none; }

/* إحصاء سريع — بطاقة بيضاء فاخرة [UI 2026-07-13] */
.quick-stat {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafd 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(30,45,74,0.08) !important;
    box-shadow: 0 3px 12px rgba(30,45,74,0.06) !important;
    overflow: hidden !important;
}

/* حقول إدخال */
.input-luxe {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: var(--pui-ink, #1E2422) !important;
}
.input-luxe:focus {
    background: #ffffff !important;
    border-color: rgba(15,110,86,0.55) !important;
}
.input-luxe::placeholder { color: rgba(30,45,74,0.32) !important; opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════
   DEPT TAB SYSTEM — نظام تبويبات القسم
   ══════════════════════════════════════════════════════════════════════ */

#main-content {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 !important;
}

.dept-layout {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: visible;
    animation: fadeIn 0.25s ease-out forwards;
}

.dept-tab-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #ffffff;
    border-bottom: 1px solid rgba(15,110,86,0.14);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30,45,74,0.05);
    z-index: 5;
}

.dept-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    background: transparent;
    color: rgba(30,45,74,0.45);
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
}
.dept-tab-btn:hover { background: rgba(15,110,86,0.06); color: var(--pui-ink, #1E2422); }
.dept-tab-btn.active {
    background: linear-gradient(135deg, rgba(15,110,86,0.18), rgba(15,110,86,0.06));
    color: #2dc88f;
    border-color: rgba(15,110,86,0.40);
    box-shadow: 0 2px 8px rgba(15,110,86,0.14);
}
.dept-tab-btn i { font-size: 14px; }

.tab-badge {
    background: rgba(15,110,86,0.16);
    color: #8fe3c4;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 20px;
    border: 1px solid rgba(15,110,86,0.30);
    font-family: 'Cairo', sans-serif;
}

.dept-tab-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    padding-right: 8px;
    border-right: 1px solid rgba(15,110,86,0.14);
}
.dept-tab-meta-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--pui-ink, #1E2422);
    line-height: 1.2;
}

.dept-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px 20px;
    gap: 14px;
    min-height: 0;
}
.dept-pane.hidden { display: none !important; }

#dept-pane-funcs { overflow-y: auto !important; }

.dept-kpi-row {
    display: grid;
    gap: 10px;
    flex-shrink: 0;
}

.dept-charts-fill {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
    flex: 1;
    min-height: 240px;
}
.dept-charts-fill .chart-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dept-chart-area {
    flex: 1;
    min-height: 220px;
}

.dept-funcs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pui-ink, #1E2422);
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(15,110,86,0.14);
    flex-shrink: 0;
}
.dept-funcs-header i { color: #8fe3c4; margin-left: 6px; }
.funcs-count {
    font-size: 11px;
    font-weight: 400;
    color: rgba(30,45,74,0.55);
    background: rgba(15,110,86,0.06);
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid rgba(15,110,86,0.20);
}

.dept-funcs-grid {
    display: grid;
    gap: 14px;
    padding-bottom: 20px;
}

/* لوحة التحكم الرئيسية */
.dash-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 16px 20px;
    gap: 14px;
}
.dash-charts-row {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 14px;
    flex-shrink: 0;
}
.dash-bottom-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 14px;
    flex: 1;
    min-height: 0;
}
.dash-bottom-row .chart-panel { height: 100% !important; }

/* section-label */
.section-label { border-color: rgba(15,110,86,0.16) !important; }
.section-label-text { color: var(--pui-ink, #1E2422) !important; }
.section-label-count { color: rgba(30,45,74,0.45) !important; }

/* لوحة الوظائف (tab pane) */
/* [إصلاح 2026-07-19] overflow:hidden مع #main-content{overflow-y:auto} و
   .dept-layout{min-height:100%} كان يجعل ارتفاع .dept-pane «ذاتى» (intrinsic)
   لا ارتفاعاً ثابتاً مفروضاً من الأب — وهذا يُصفّر ارتفاع أى ابن flex:1
   بداخله (مثل مساحات الرسوم البيانية) لأنه لا يوجد "باقى مساحة" محسوبة
   فعلياً ليملأها. overflow-y:auto هنا يسمح بالتمرير كحل احتياطى إن زاد
   المحتوى، لكن الإصلاح الحقيقى للرسوم هو ارتفاع أدنى صريح بالبكسل أدناه. */
.dept-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px 20px;
    gap: 14px;
    min-height: 0;
}
.dept-pane.hidden { display: none !important; }

/* لوحة الوظائف — تتمرر */
#dept-pane-funcs {
    overflow-y: auto !important;
}

/* صف KPI (ثابت الارتفاع) — [إصلاح 2026-07-19] بطاقات أكثر إحكاماً لترك
   مساحة أكبر للرسوم أسفلها */
.dept-kpi-row {
    display: grid;
    gap: 10px;
    flex-shrink: 0;
}

/* منطقة الرسوم البيانية — تملأ الباقي */
.dept-charts-fill {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
    flex: 1;
    min-height: 240px;
}

/* منطقة الرسم داخل chart-panel — [إصلاح 2026-07-19] ارتفاع أدنى صريح
   بالبكسل بدل الاعتماد فقط على flex:1/height:100% التى تنهار إلى صفر
   حين يكون ارتفاع الأب نفسه ذاتياً (auto) لا ثابتاً — هذا هو سبب اختفاء
   الأعمدة/الدوائر فى رسوم ApexCharts (يقرأ ارتفاع الحاوية عند الرسم). */
.dept-chart-area {
    flex: 1;
    min-height: 220px;
    height: 100%;
}

/* رأس لوحة الوظائف */
.dept-funcs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pui-ink, #1E2422);
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(15,110,86,0.14);
    flex-shrink: 0;
}
.dept-funcs-header i { color: #8fe3c4; margin-left: 6px; }
.dept-funcs-header .funcs-count {
    font-size: 11px;
    font-weight: 400;
    color: rgba(30,45,74,0.55);
    background: rgba(15,110,86,0.06);
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid rgba(15,110,86,0.20);
}

/* شبكة بطاقات الوظائف */
.dept-funcs-grid {
    display: grid;
    gap: 14px;
    padding-bottom: 20px;
}

/* [UI 2026-07-12] شريط بحث الوظائف داخل صفحة القسم */
.dept-func-search-wrap {
    position: relative;
    margin: 14px 0 18px;
    flex-shrink: 0;
}
.dept-func-search-wrap i {
    position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
    color: rgba(212,175,106,0.55); font-size: 13px; pointer-events: none;
}
.dept-func-search {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 40px 10px 14px;
    font-size: 12px;
    font-family: 'Cairo', sans-serif;  /* [2026-08-20] توحيد على عائلة واحدة */
    color: var(--pui-ink, #1E2422);
    outline: none;
    transition: border-color var(--t-med), background var(--t-med);
}
.dept-func-search::placeholder { color: rgba(30,45,74,0.32); }
.dept-func-search:focus {
    border-color: rgba(15,110,86,0.55);
    background: #ffffff;
}

/* مجموعات الوظائف */
.dept-func-group { margin-bottom: 4px; }

/* لوحة التحكم الرئيسية — أيضاً بدون scroll */
.dash-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 16px 20px;
    gap: 14px;
}
.dash-charts-row {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 14px;
}
.dash-bottom-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 14px;
    flex: 1;
    min-height: 0;
}
.dash-bottom-row .chart-panel {
    height: 100%;
}

/* ══════════════════════════════════════════════════════════════════════
   SIDEBAR — نمط هجين قابل للطى (Hover Preview + Click-to-Pin)
   اللوجو يبقى ظاهراً دائماً؛ باقى المحتوى (النصوص/التصنيفات/التذييل)
   يظهر تدريجياً عند التوسّع فقط. أسماء الكلاسات الأصلية (.sidebar-luxe,
   .sb-item...) لم تتغير — هذه إضافات فقط.
   ══════════════════════════════════════════════════════════════════════ */
/* [توحيد 2026-07-27] كان #sidebar-main معرَّفاً 3 مرات فى الملف تاريخياً
   (إخفاء كامل 2026-07-12 → إعادة تفعيل 2026-07-18 → position/z-index هنا)،
   وكانت فقرة "الإخفاء الكامل" (display:none) ميتة تماماً دائماً — مُتجاوَزة
   بفقرة "إعادة التفعيل" الأحدث والمساوية فى القوة (!important + ترتيب
   مصدر لاحق). دُمج display/width الفعليان هنا؛ حُذفت فقرة الإخفاء الميتة
   بالكامل. قواعد عرض الطى (.sb-collapsed) تُركت كما هى دون تغيير — تتحكم
   فى آلية hover/pin الحالية ولم يُطلب تعديلها. */
/* [2026-08-20] العرض 250 → 280.
   السبب وظيفى لا جمالى: تسميات التنقّل العربية كانت تُقطع بنقاط
   («العمليات الأساسية (استلام/...)»)، والنصّ المقطوع فى قائمة تنقّل يجعل
   المستخدم يُخمّن الوجهة أو يقف بالماوس على كل بند — وهو عيب استعمال لا
   ضِيق مساحة.

   ⚠ ملاحظة مسجَّلة (لم تُغيَّر هنا عمداً): `width` أدناه تحمل `!important`،
   فهى تغلب قاعدتَى الطىّ والتثبيت التاليتين لأنهما بلا `!important` مهما
   علت أولويّتهما. أى أن **عرض البار ثابت فعلياً فى كل الحالات**، وقاعدتا
   `.sb-collapsed` و`.sb-pinned` ميتتان منذ توحيد 2026-07-27. وُحِّدت
   قيمهما مع العرض الجديد حتى لا تتناقض القراءة، لكن **إحياء الطىّ قرارُ
   سلوكٍ لا تنسيق** — يُعرض على صاحب النظام قبل تنفيذه، فتفعيله فجأةً
   يُغيّر ما اعتاده المستخدم بلا أن يطلبه. */
#sidebar-main {
    position: relative !important;
    display: flex !important;
    width: 280px !important;
    transition: width .28s cubic-bezier(.4,0,.2,1) !important;
    z-index: 30 !important;
}
#sidebar-main.sb-collapsed { width: 68px; }
#sidebar-main.sb-collapsed.sb-hover,
#sidebar-main.sb-pinned { width: 280px; }

/* ── الشاشة الضيّقة ──────────────────────────────────────────────────
   [ADDED 2026-08-17] وُضعت هنا لأن هذا الملف يملك عرضَ البار وطيَّه.

   قِيس المشروع كلُّه (٢٥ ملفَّ أنماط + كتل القوالب): **صفرُ استعلامات
   وسائطَ بالعرض تمسّ البار.** فسلوكُه على الهاتف ليس مُصمَّماً بل موروثاً
   من المكتب: عمودٌ ثابت ٢٥٠px داخل `flex-shrink-0`.

   فعلى شاشةٍ عرضُها ٣٩٠px يأخذ البارُ المثبَّت **٦٤٪** ويترك للمحتوى
   ١٤٠px. ولا ينجو المستخدم إلا بالصدفة: أن يكون البارُ مطوياً، وأن
   يكون جهازُه بلا تحويم فلا يتوسّع. أما مَن ثبّته مرّةً على المكتب فقد
   حُفظ اختيارُه ورافقه إلى الهاتف.

   > **وتصميمٌ يصحّ لأن حالةً افتراضية صادفت الصواب ليس تصميماً بل**
   > **حظّاً: يسقط أوّلَ ما يُغيّر المستخدم الافتراضَ، وهو أوّلُ ما يفعل.**

   فدون ٩٠٠px: البارُ مطوىٌّ دائماً ولا يزاحم المحتوى، وإن فُتح فُتح
   **فوقه** لا بجانبه — ولذلك `position: fixed`.

   و`!important` هنا ليست اختياراً: القاعدةُ الأساس أعلاه تفرض العرض بها،
   فلا تُغلَب إلا بمثلها. وهى دَينٌ يُسدَّد يومَ تُنزع من تلك القاعدة. */
@media (max-width: 900px) {
    #sidebar-main,
    #sidebar-main.sb-pinned { width: 68px !important; }

    #sidebar-main.sb-hover,
    #sidebar-main.sb-pinned.sb-hover {
        width: 236px !important;
        position: fixed !important;
        inset-block: 0;
        inset-inline-end: 0;
        box-shadow: -8px 0 24px rgba(15, 110, 86, .18);
    }
}

/* عناصر تختفى/تظهر تدريجياً مع التوسّع */
.sb-fade-content {
    opacity: 1;
    transition: opacity .18s ease .08s, max-height .2s ease;
    white-space: nowrap;
}
#sidebar-main.sb-collapsed:not(.sb-hover) .sb-fade-content {
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}

/* توسيط الأيقونات فى وضع الطى */
#sidebar-main.sb-collapsed:not(.sb-hover) .sb-item { justify-content: center !important; padding-left: 0 !important; padding-right: 0 !important; }
#sidebar-main.sb-collapsed:not(.sb-hover) #nav-depts .sb-item span,
#sidebar-main.sb-collapsed:not(.sb-hover) .dept-header-label { display: none; }

/* لوجو الشركة ثابت الحجم دائماً */
#sb-logo { width: 40px; height: 40px; transition: none !important; }

/* [تنقيح 2026-07-23] مقبض التثبيت لم يعد عائماً خارج حدود الشريط —
   أصبح جزءاً من صف "الرئيسية"، فيظهر معه طبيعياً (تُخفيه .sb-fade-content
   تلقائياً فى وضع الطى مثل بقية النصوص) — لا داعى لإخفاء إضافى بالمرور */
#sb-pin-btn:hover { background: #E6EAE9 !important; }
#sidebar-main.sb-pinned #sb-pin-icon { color: #0F6E56; }

/* تظليل خفيف يوضح إمكانية التمرير/الطى فى الوضع المطوى */
#sidebar-main.sb-collapsed:not(.sb-hover)::after {
    content: '';
    position: absolute; top: 0; bottom: 0; left: -3px; width: 3px;
    background: linear-gradient(180deg, transparent, rgba(15,110,86,0.30) 40%, rgba(15,110,86,0.30) 60%, transparent);
    border-radius: 3px;
}

/* [أُزيلت 2026-07-27] قاعدة "إخفاء البار الجانبى بالكامل" (2026-07-12) كانت
   ميتة دائماً — مُتجاوَزة بقاعدة إعادة التفعيل الأحدث (دُمجت أعلى الملف فى
   قسم SIDEBAR). لا تغيير بصري. */

/* لوجو الشركة فى البار العلوى — بديل اللوجو القديم فى البار الجانبى */
#tb-logo { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }


/* ══════════════════════════════════════════════════════════════════════
   [إصلاح 2026-07-23] الشريط الجانبى الأيمن — كان كحلى بحرى داكناً يخالف
   تماماً الهوية الفاتحة المعتمدة لبقية النظام (شاشتا الدخول والشركات
   ولوحة النخيل). هذا هو التعريف الفعلى الذى يفوز فى الـ cascade
   (خصوصية أعلى من التعريفات فى base.html) — أُعيد بناؤه فاتحاً بنفس
   هوية --sw- الخضراء/النعناعية المستخدمة فى باقى الشاشات المُطوَّرة.
   ══════════════════════════════════════════════════════════════════════ */
.sidebar-luxe {
    background: linear-gradient(180deg, #FFFFFF 0%, #F7FBF9 100%) !important;
    border-left: 1px solid #E6EAE9 !important;
}
.sidebar-luxe::before { display: none; }
/* [REMOVED 2026-08-17] `#sb-name`/`#sb-type` — صندوقُ الهوية حُذف من
   البار (٢٠٢٦-٠٧-٢٣) وبقيت أنماطُه تصف عنصرَين لا وجود لهما. */
.sidebar-luxe .sb-item { color: #63746F; }
.sidebar-luxe .sb-item:hover { background: #EFFAF8; color: #0D5442; }
.sidebar-luxe .sb-active,
.sidebar-luxe .sb-item.sb-active {
    background: #EFFAF8;
    border-right-color: #0F6E56;
    color: #0D5442 !important;
}
.sidebar-luxe .sb-active i,
.sidebar-luxe .sb-item.sb-active i { color: #0F6E56; }
/* عنصر «الرئيسية» المخصص أعلى القائمة */
.sidebar-luxe #nav-hub {
    color: #0D5442 !important;
    background: #EFFAF8 !important;
    border: 1px solid #B6EDDF !important;
}

/* [توحيد 2026-07-27] display/width الأساسيان دُمجا فى تعريف #sidebar-main
   الموحّد أعلى الملف (قسم SIDEBAR) — بقيت هنا فقط قاعدة عرض الطى الأدق
   تخصيصاً (تتغلّب على .sb-collapsed العادية أعلاه عمداً حين لا يكون
   الشريط فى وضع hover أو pin). */
#sidebar-main.sb-collapsed:not(.sb-hover):not(.sb-pinned) { width: 64px !important; }

/* [2026-07-18 · المرحلة 2] عناصر الشريط العلوى الجديدة (نمط SAP/Oracle) */
.tb-search-pill {
    display:flex; align-items:center; gap:8px;
    padding:6px 12px; border:1px solid var(--b-white);
    border-radius:20px; background:#f2faf7; color:#6b7d76;
    font-size:12px; font-family:'Cairo',sans-serif; cursor:pointer;
    transition:all .15s ease;
}
.tb-search-pill:hover { border-color:#1D9E75; color:#0f6e56; background:#e1f5ee; }
.tb-search-pill kbd {
    font-family:monospace; font-size:9.5px; font-weight:700;
    background:#fff; border:1px solid #e6ece9; border-bottom-width:2px;
    border-radius:5px; padding:1px 6px; color:#9aa8a2;
}
/* [2026-08-20] ترقية البار العلوى — تجميع وفراغ لا تكبير.
   ──────────────────────────────────────────────────────────────────────
   البار يحمل ثلاث عشرة أداة فى صفٍّ واحد. والفخامة فى شريطٍ كهذا لا تأتى
   من تكبير اللوجو ولا من تكبير صورة المستخدم — بل من أن تُقرأ الأدوات
   **مجموعاتٍ** لا سلسلةً متراصّة: هوية · تنقّل · أدوات · تفضيلات · مستخدم.

   فالفواصل صارت أوضح قليلاً وبفراغٍ حولها، والكبسولات أهدأ لوناً، وكل
   الألوان من رموز النظام بدل الرمادى المائل إلى الأزرق (‎#f1f5f9‎ ·
   ‎#e2e8f0‎ · ‎#475569‎) الذى كان بقيّةَ الهوية الكحلية السابقة. */
.tb-vsep { width:1px; height:22px; flex-shrink:0;
           background:var(--sw-border, #E6EAE9);
           margin-inline: 6px; }
/* [ترقية بصرية 2026-07-27] تجميع أزرار الشريط العلوي فى كبسولات بدل صف
   واحد متجانس من الأزرار العائمة — تنظيم بصري فقط، لا تغيير وظيفي. */
.tb-cluster {
    display:flex; align-items:center;
    background:var(--sw-bg-sunken, #F5F7F6);
    border:1px solid var(--sw-border, #E6EAE9);
    border-radius:10px; padding:3px; gap:2px;
}
.tb-cluster .topbar-btn { background: transparent; border: none; box-shadow: none; }
.tb-cluster .topbar-btn:hover { background: var(--sw-primary-50, #EFFAF8);
                                color: var(--sw-primary-700, #0D5442); }
/* أفاتار المستخدم فى الشريط العلوى — نفس هوية الأخضر */
#user-menu-root .um-avatar {
    width:32px !important; height:32px !important;
    background:linear-gradient(135deg,#1d9e75,#0f6e56) !important;
    border:2px solid #B6EDDF !important;
}

/* [2026-07-18] بطاقة المنشأة بالنمط المرجعى (.co) */
.co-ref {
    background:#152238 !important;
    border:1px solid #24344f !important;
    border-radius:13px !important;
    padding:16px !important;
    text-align:center !important;
    transition:transform .12s, box-shadow .12s, border-color .12s !important;
}
.co-ref:hover {
    transform: translateY(-3px);
    border-color: #1d9e75;
    box-shadow: 0 8px 24px rgba(33,193,122,0.15);
}
.co-ref:hover .coarrow { color: #1d9e75; }
#co-search:focus { border-color: #1d9e75; }

/* [2026-07-18] بطاقة قسم بيضاء بالنمط المرجعى (.mod) */
.mod-ref {
    background:#fff; border:1px solid #e6ece9; border-radius:12px;
    padding:14px; cursor:pointer;
    transition:box-shadow .12s, transform .12s, border-color .12s;
}
.mod-ref:hover {
    box-shadow:0 6px 18px rgba(15,110,86,0.12);
    transform:translateY(-2px);
}
.mod-ref:hover .mod-go { background:#0f6e56; color:#fff; border-color:#0f6e56; }
/* بطاقة لوحة التحكم المختصرة أعلى الـHub — تتبع النمط الفاتح أيضاً */
#s-hub .hub-dash-card {
    background:#fff !important; border:1px solid #e6ece9 !important;
    border-radius:12px !important; box-shadow:0 1px 3px rgba(20,45,35,0.04) !important;
}
#s-hub .hub-dash-card .hub-dept-name { color: #1a2b25; }
#s-hub .hub-dash-card .hub-dept-desc { color: #6b7d76; }
#s-hub .hub-dash-card:hover { box-shadow: 0 6px 18px rgba(15,110,86,0.12); }
/* إطارات معرض الصور على الخلفية الفاتحة */
#s-hub .hub-photo-frame { background:#fff !important; border:1px solid #e6ece9 !important; color:#cfdbd5 !important; }

/* ══════════════════════════════════════════════════════════════════════
   [2026-07-18] لوحة القسم بالنمط المرجعى (dashboards + dept view)
   ══════════════════════════════════════════════════════════════════════ */
/* خلفية منطقة المحتوى — رمادى المرجع الدافئ */
.main-bg { background:#f4f7f5 !important; }

/* بانر الرؤية الذكية للقسم */
/* [تنقيح 2026-07-23] كان مليء أخضر باهت بالكامل — الآن أبيض نقي مع
   حد جانبي أخضر صلب فقط، لمظهر أقرب لتنبيه تحريري احترافى بدل "بقعة" لون */
.dept-insight-ref {
    display:flex; align-items:center; gap:10px;
    padding:11px 14px; margin-bottom:12px;
    background:#ffffff; border:1px solid #e6ece9; border-right:3px solid #0f6e56;
    border-radius:10px;
    color:#4b5855; font-size:13px;
}
.dept-insight-ref i { color:#0f6e56; }
.dept-insight-ref b { font-weight:800; color:#0f6e56; }

/* KPI المرجعية */
.kpi-card.kpi-hero-ref {
    background:#0f6e56 !important; border:none !important;
    border-radius:10px !important; padding:11px 14px !important;
    color:#fff !important; box-shadow:none !important;
}
.kpi-card.kpi-hero-ref::before, .kpi-card.kpi-hero-ref::after { display:none !important; }
.kpi-card.kpi-ref {
    background: #fff; border: 1px solid #e6ece9;
    border-radius: 10px; padding: 11px 14px;
    box-shadow: none;
}
.kpi-card.kpi-ref::before, .kpi-card.kpi-ref::after { display:none !important; }
.kpi-card.kpi-ref:hover, .kpi-card.kpi-hero-ref:hover {
    transform:none !important; box-shadow:0 4px 14px rgba(15,110,86,0.10) !important;
}

/* بطاقات الرسوم البيانية */
.chart-panel.chart-ref {
    background:#fff !important; border:1px solid #e6ece9 !important;
    border-radius:10px !important; padding:14px !important; box-shadow:none !important;
}
.chart-panel.chart-ref::before { display: none; }
.chart-ref-title {
    font-size:14px; font-weight:600; color:#1a2b25;
    display:flex; align-items:center; gap:6px; margin-bottom:10px; flex-shrink:0;
}
.chart-ref-title i { color:#0f6e56; }

/* رأس قسم الوظائف + البحث على الخلفية الفاتحة */
.dept-funcs-header { color:#1a2b25 !important; border-bottom-color:#e6ece9 !important; }
.funcs-count { color:#6b7d76 !important; background:#fff !important; border-color: #e6ece9; }
.dept-func-search { background:#fff !important; border:1px solid #cfdbd5 !important; color:#1a2b25 !important; }
.dept-func-search:focus { border-color:#0f6e56 !important; box-shadow: 0 0 0 3px #e1f5ee; }
.section-label-text { color:#1a2b25 !important; }
.section-label-line { background:#e6ece9 !important; }
.section-label-count { color:#9aa8a2 !important; }

/* رأس القسم (dept-header) إن وُجد — بطاقة بيضاء بحد أخضر */
.dept-header {
    background:#fff !important; border:1px solid #e6ece9 !important;
    border-right:3px solid #0f6e56 !important; box-shadow:none !important;
}
.dept-header::before, .dept-header::after { display:none !important; }

/* [2026-07-18] جدول تقرير مصغّر بالنمط المرجعى (deptReport) */
.ref-report-table { width:100%; border-collapse:collapse; font-size:12px; }
.ref-report-table th {
    color:#6b7d76; font-size:11px; font-weight:600; text-align:right;
    padding:6px; background:transparent; white-space:nowrap;
}
.ref-report-table td { padding:7px 6px; border-top:1px solid #eef2f0; color:#1a2b25; }
.ref-report-table tbody tr:hover td { background:#f2faf7; }
/* عمود المؤشرات الفاتح */
.quick-stat.quick-ref {
    background:#fff !important; border:1px solid #e6ece9 !important;
    border-radius:10px !important; box-shadow:none !important;
    display:flex; align-items:center; gap:10px; padding:10px 12px;
}
/* جدول لوحة التحكم (آخر القيود) على الفاتح */
.chart-ref .luxury-table thead th {
    background:#f2faf7 !important; color:#6b7d76 !important;
    border-bottom:1px solid #e6ece9 !important; font-size:11px !important;
}
.chart-ref .luxury-table tbody tr { background: #fff; }
.chart-ref .luxury-table tbody tr:hover { background: #f2faf7; }

/* [2026-07-18 · حسم نهائى] بطاقات KPI المرجعية — تلغى كل زخارف النمط القديم
   (الشريط الذهبى/الزاوية/الرفع) مهما كانت قوة قواعدها */
.kpi-card.kpi-ref, .kpi-card.kpi-hero-ref {
    background-image: none;
    overflow: visible;
}
.kpi-card.kpi-ref::before,  .kpi-card.kpi-ref::after,
.kpi-card.kpi-hero-ref::before, .kpi-card.kpi-hero-ref::after {
    display: none !important;
    content: none;
}
.kpi-card.kpi-ref:hover, .kpi-card.kpi-hero-ref:hover {
    transform: none !important;
    border-color: #e6ece9;
    box-shadow: 0 4px 14px rgba(15,110,86,0.10) !important;
}
.kpi-card.kpi-hero-ref { background: #0f6e56 !important; color: #fff !important; }
.kpi-card.kpi-hero-ref:hover { border-color: transparent !important; }

/* [2026-07-18] تنحيف بار التنقل الأيمن لمطابقة المرجع:
   عناصر رفيعة 9px بلا كبسولات ضخمة + أيقونات إيموجى مطفأة أحادية الطابع */
#sidebar-main #nav-hub,
#sidebar-main #nav-dash {
    background: transparent;
    border: none;
    border-right: 3px solid transparent;
    border-radius: 0;
    padding: 9px 16px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #8fa3bf;
}
#sidebar-main #nav-hub:hover, #sidebar-main #nav-dash:hover {
    background: #152238; color: #e8eef7;
}
#sidebar-main #nav-hub i, #sidebar-main #nav-dash i { color: inherit; }
/* [MOVED 2026-08-17] أيقونات وظائف البار → `sidebar.css` (مالكٌ واحد) */

/* ══════════════════════════════════════════════════════════════════════
   [2026-07-19 · تحصين ضد الكاش] النمط المرجعى يُفرض على كل بطاقات KPI
   حتى لو كان المتصفح يقدّم app_core قديمًا (بلا كلاسات -ref):
   ══════════════════════════════════════════════════════════════════════ */
/* 1) إلغاء الشريط الذهبى/الزاوية/الرفع لكل البطاقات نهائياً */
.kpi-card::before, .kpi-card::after { display:none !important; content:none !important; }
.kpi-card {
    background:#fff !important; background-image: none;
    border:1px solid #e6ece9 !important; border-radius:10px !important;
    box-shadow:none !important;
}
.kpi-card:hover {
    transform:none !important; border-color:#e6ece9 !important;
    box-shadow:0 4px 14px rgba(15,110,86,0.10) !important;
}
/* 2) أول بطاقة فى أى صف KPI = Hero خضراء (توقيع المرجع) حتى بالمولد القديم */
.dept-kpi-row .kpi-card:first-child,
.dept-kpi-row > div:first-child .kpi-card {
    background: #0f6e56; border-color: #0f6e56;
}
.dept-kpi-row .kpi-card:first-child *,
.dept-kpi-row > div:first-child .kpi-card * { color: #fff; }
/* 3) نصوص المولد القديم (ذهبى/فاتح) → ألوان المرجع الداكنة على الأبيض */
.kpi-card [data-kpi-l], .kpi-card .kpi-badge { color: #6b7d76; }
.kpi-card [data-kpi-v] { color: #1a2b25; }

/* ══════════════════════════════════════════════════════════════════════
   [تحسين 2026-07-23] صقل إضافى للوحة القسم الافتراضية (dept-pane-dash)
   — طبقة إضافية فوق النمط المرجعى (لا تُعدّل قواعده، فقط تُحسّن الكثافة
   والوضوح): أرقام KPI بخط ثابت العرض كشاشات البورصة، بانر رؤية أوضح
   تدرجاً، وعناوين لوحات الرسم البيانية بحرف أدق. لا حركة/رفع جديدة
   (القرار النهائى أعلاه يمنعها عمداً على بطاقات KPI). */
.kpi-card [data-kpi-v] {
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.01em !important;
}
/* [إصلاح 2026-07-23] كانت القاعدة العامة .kpi-card [data-kpi-l] تفرض رمادياً
   باهتاً على بطاقة الـHero الخضراء الغامقة أيضاً (تباين ضعيف جداً) —
   نفس المشكلة لم تُحل بالكامل سابقاً لأن التصحيح اقتصر على data-kpi-v فقط.
   الآن كل نصوص بطاقة الـHero (تسمية + قيمة + نص فرعى) بيضاء بوضوح. */
.kpi-card.kpi-hero-ref [data-kpi-v],
.kpi-card.kpi-hero-ref [data-kpi-l],
.kpi-card.kpi-hero-ref [data-kpi-s] { color: #ffffff; }
.kpi-card.kpi-hero-ref [data-kpi-l] { opacity:.88; }
.kpi-card.kpi-hero-ref [data-kpi-s] { opacity:.82; }
.kpi-card.kpi-hero-ref i { color: #ffffff; opacity:.9; }

.dept-insight-ref {
    background: #ffffff !important;
    border-color: #e6ece9;
    border-right-color: #0f6e56;
}

.chart-panel.chart-ref {
    transition: box-shadow .18s ease, border-color .18s ease;
}
.chart-panel.chart-ref:hover {
    box-shadow: 0 8px 22px rgba(15,110,86,0.10);
    border-color: #bfe6d9;
}
.chart-ref-title {
    text-transform: uppercase; font-size: 11.5px !important;
    letter-spacing: .03em; font-weight: 700 !important;
}


} /* end @layer base [MIGRATED 2026-07-27] */
