/* ═══════════════════════════════════════════════════════════════
   portal-theme.css — هوية البوابة الموحَّدة
   • الرسمي:  أخضر + كحلي + ذهبي  →  html[data-theme="green"]  (الافتراضي)
   • البديل:  كحلي صِرف + ذهبي     →  html[data-theme="grad"]
   تُضبط السمة من portal-sidebar.js (الافتراضي green عند عدم وجود تفضيل).
   الأسلوب: أسطح بيضاء مسطّحة، حدود خفيفة، ظلال خفيفة، لمسة ذهبية للتمييز.
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════ ① Navy + ذهبي (الرسمي/الافتراضي) ═══════════════════ */
html[data-theme="grad"] {
  --navy: #1b3a6b;  --navy-700: #15294d;  --navy-900: #0f1f3d;
  --navy-2: #254d8f; --navy-3: #15294d;
  --primary: #1b3a6b; --primary-2: #254d8f; --primary-3: #15294d;

  --gold: #c4a76e;  --gold-700: #ad8e54;  --gold-light: #e6d6b0;
  --gold-bright: #efe3c6; --gold-2: #d8c391; --gold-soft: #f8f3e6; --gold-bg: #f8f3e6;

  --bg: #f4f6fb;  --page-bg: #f4f6fb;
  --surface: #ffffff;  --surface-2: #f7f9fc;
  --bg-card: #ffffff;  --card-bg: #ffffff;  --panel: #ffffff;  --paper: #ffffff;
  --border: #e2e7f1;  --border-2: #cdd6e6;  --line: #e2e7f1;  --card-border: #e2e7f1;

  --blue: #254d8f;  --blue-bg: #eaf0fe;
  --blue-deep: #15294d;  --blue-mid: #254d8f;  --blue-light: #3a6fc4;  --blue-pale: #eaf0fe;

  --ps-plum-dark: #15294d;  --ps-plum: #1b3a6b;  --ps-green: #254d8f;
  --ps-gold: #e6d6b0;  --ps-gold-light: #efe3c6;
}
/* خلفية الصفحة: مسطّحة صلدة (بلا تدرّجات صاخبة) */
html[data-theme="grad"] body {
  background: #f4f6fb !important;
}
/* الهيدر: كحلي رصين مع شريط ذهبي سفلي للتمييز */
html[data-theme="grad"] .header,
html[data-theme="grad"] .ds-header,
html[data-theme="grad"] .tabs-nav {
  background: linear-gradient(105deg, #15294d 0%, #1b3a6b 55%, #254d8f 100%) !important;
  border-top: none !important;
  border-bottom: 2px solid var(--gold) !important;
  box-shadow: 0 2px 12px rgba(20,41,77,.22) !important;
}
html[data-theme="grad"] .ops-topbar {
  background: linear-gradient(105deg, #15294d 0%, #1b3a6b 55%, #254d8f 100%) !important;
  border-bottom: 2px solid var(--gold) !important;
  box-shadow: 0 2px 12px rgba(20,41,77,.22) !important;
}
/* عنوان الهيدر ذهبي على الكحلي + الفرعي أبيض شفاف */
html[data-theme="grad"] .ds-header__title,
html[data-theme="grad"] .header-logo .h-title,
html[data-theme="grad"] .logo-text { color: #e6d6b0 !important; }
html[data-theme="grad"] .header > div:first-child div { color: #fff !important; }
html[data-theme="grad"] .ds-header__sub,
html[data-theme="grad"] .header-logo .h-sub { color: rgba(255,255,255,.72) !important; }
/* شريط العدّ التنازلي — نفس كحلي الهيدر + نصوص ذهبية
   (نسبق بـ body لتجاوز body.page-tenders في portal-header.css) */
html[data-theme="grad"] body .countdown-banner {
  background: linear-gradient(105deg, #15294d 0%, #1b3a6b 55%, #254d8f 100%) !important;
  border: 1px solid rgba(196,167,110,.50) !important;
  box-shadow: 0 2px 12px rgba(20,41,77,.22) !important;
}
html[data-theme="grad"] body .countdown-title { color: #e6d6b0 !important; }
html[data-theme="grad"] body .countdown-name,
html[data-theme="grad"] body #cd-name { color: #e6d6b0 !important; }
html[data-theme="grad"] body .countdown-owner { color: rgba(255,255,255,.62) !important; }
html[data-theme="grad"] body .countdown-unit {
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
}
html[data-theme="grad"] body .countdown-num { color: #fff !important; }
html[data-theme="grad"] body .countdown-label { color: #e6d6b0 !important; }
html[data-theme="grad"] body .countdown-sep { color: rgba(255,255,255,.40) !important; }

/* ═══════════════════ ② أخضر + كحلي (الرسمي/الافتراضي) ═══════════════════
   مطابق لهوية صفحة الهبوط: أخضر غابي + كحلي داكن + لمسة ذهبية.
   الهيدرات بتدرّج كحلي←أخضر (مثل بطاقة "مركز تشغيل المناقصات").
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="green"] {
  --navy: #1f5239;  --navy-700: #173d2b;  --navy-900: #10251d;
  --navy-2: #2d6a4f; --navy-3: #10251d;
  --primary: #1f5239; --primary-2: #2d6a4f; --primary-3: #173d2b;

  --gold: #d9a443;  --gold-700: #b9812e;  --gold-light: #e8b547;
  --gold-bright: #e8b547; --gold-2: #e8bd63; --gold-soft: #f7efdc; --gold-bg: #f7efdc;

  --bg: #eef2ec;  --page-bg: #eef2ec;
  --surface: #ffffff;  --surface-2: #f4f8f3;
  --bg-card: #ffffff;  --card-bg: #ffffff;  --panel: #ffffff;  --paper: #ffffff;
  --border: #d6e2d6;  --border-2: #c3d6c3;  --line: #d6e2d6;  --card-border: #d6e2d6;

  --blue: #2d6a4f;  --blue-bg: #e6f0ea;
  --blue-deep: #10251d;  --blue-mid: #2d6a4f;  --blue-light: #40916c;  --blue-pale: #e6f0ea;

  --ps-plum-dark: #10251d;  --ps-plum: #173d2b;  --ps-green: #2d6a4f;
  --ps-gold: #e8b547;  --ps-gold-light: #e8b547;
}
html[data-theme="green"] body {
  background: #eef2ec !important;
}
/* الهيدر: تدرّج كحلي←أخضر + شريط ذهبي سفلي (هوية صفحة الهبوط) */
html[data-theme="green"] .header,
html[data-theme="green"] .ds-header,
html[data-theme="green"] .tabs-nav {
  background: linear-gradient(105deg, #15294d 0%, #173d2b 52%, #2d6a4f 100%) !important;
  border-top: none !important;
  border-bottom: 2px solid var(--gold) !important;
  box-shadow: 0 2px 12px rgba(16,37,29,.24) !important;
}
html[data-theme="green"] .ops-topbar {
  background: linear-gradient(105deg, #15294d 0%, #173d2b 52%, #2d6a4f 100%) !important;
  border-bottom: 2px solid var(--gold) !important;
  box-shadow: 0 2px 12px rgba(16,37,29,.24) !important;
}
html[data-theme="green"] .ds-header__title,
html[data-theme="green"] .header-logo .h-title,
html[data-theme="green"] .logo-text { color: #e8b547 !important; }
html[data-theme="green"] .header > div:first-child div { color: #fff !important; }
html[data-theme="green"] .ds-header__sub,
html[data-theme="green"] .header-logo .h-sub { color: rgba(255,255,255,.72) !important; }
html[data-theme="green"] body .countdown-banner {
  background: linear-gradient(105deg, #15294d 0%, #173d2b 52%, #2d6a4f 100%) !important;
  border: 1px solid rgba(217,164,67,.45) !important;
  box-shadow: 0 2px 12px rgba(16,37,29,.24) !important;
}
html[data-theme="green"] body .countdown-title { color: #e8b547 !important; }
html[data-theme="green"] body .countdown-name,
html[data-theme="green"] body #cd-name { color: #fff !important; }
html[data-theme="green"] body .countdown-owner { color: rgba(255,255,255,.62) !important; }
html[data-theme="green"] body .countdown-unit {
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
}
html[data-theme="green"] body .countdown-num { color: #fff !important; }
html[data-theme="green"] body .countdown-label { color: #e8b547 !important; }
html[data-theme="green"] body .countdown-sep { color: rgba(255,255,255,.40) !important; }

/* ═══════════════════════════════════════════════════════════════
   تناغم محتوى الصفحة مع الهوية (تجاوزات ألوان فقط — لا تمسّ أي منطق)
   نسبق بـ body لتجاوز inline + portal-header.css. ألوان الحالة
   (متأخر/مكتمل/تحذير) تُترك كما هي لأنها تحمل معنى.
   ═══════════════════════════════════════════════════════════════ */

/* ── ① Navy + ذهبي ── */
html[data-theme="grad"] body .section-count { background: #1b3a6b !important; }
html[data-theme="grad"] body .side-card,
html[data-theme="grad"] body .table-card,
html[data-theme="grad"] body .table-section,
html[data-theme="grad"] body .filters {
  background: #ffffff !important;
  border-color: #e2e7f1 !important;
  box-shadow: 0 1px 2px rgba(20,41,77,.06) !important;
}
html[data-theme="grad"] body .side-card::before,
html[data-theme="grad"] body .table-section::before,
html[data-theme="grad"] body .filters::before { display: none !important; }
html[data-theme="grad"] body .section-header {
  background: #f7f9fc !important;
  border-bottom-color: #e2e7f1 !important;
}
html[data-theme="grad"] body thead tr,
html[data-theme="grad"] body th {
  background: #eef2f8 !important;
  color: #1b3a6b !important;
}
html[data-theme="grad"] body .section-title::before {
  background: linear-gradient(135deg, #1b3a6b, #254d8f) !important;
  box-shadow: 0 0 0 4px rgba(27,58,107,.10) !important;
}
/* الفلاتر: العام النشط كحلي (ألوان الحالة تبقى) */
html[data-theme="grad"] body .filter-btn.active:not(.f-today):not(.f-3days):not(.f-week):not(.f-active) {
  background: #1b3a6b !important; border-color: #15294d !important; color: #fff !important;
}
html[data-theme="grad"] body .filter-btn:hover { border-color: #254d8f !important; color: #1b3a6b !important; }
html[data-theme="grad"] body .search-box:focus-within { border-color: #254d8f !important; }
/* أشرطة الجهات المالكة: كحلي متدرّج أحادي بدل ألوان متعددة */
html[data-theme="grad"] body .owner-bar { background: #1b3a6b !important; }
html[data-theme="grad"] body .owner-row:nth-child(2n) .owner-bar { background: #3a6fc4 !important; }
html[data-theme="grad"] body .owner-row:nth-child(3n) .owner-bar { background: #15294d !important; }
html[data-theme="grad"] body .owner-row.active-owner {
  background: #eef2f8 !important; border-right-color: #1b3a6b !important;
}

/* ── ② الأخضر ── */
html[data-theme="green"] body .section-count { background: #2d6a4f !important; }
html[data-theme="green"] body .side-card,
html[data-theme="green"] body .table-card,
html[data-theme="green"] body .table-section,
html[data-theme="green"] body .filters {
  background: #ffffff !important;
  border-color: #d6e2da !important;
  box-shadow: 0 1px 2px rgba(15,45,30,.06) !important;
}
html[data-theme="green"] body .side-card::before,
html[data-theme="green"] body .table-section::before,
html[data-theme="green"] body .filters::before { display: none !important; }
html[data-theme="green"] body .section-header {
  background: #f2f7f4 !important;
  border-bottom-color: #d6e2da !important;
}
html[data-theme="green"] body thead tr,
html[data-theme="green"] body th {
  background: #eef5f0 !important;
  color: #235940 !important;
}
html[data-theme="green"] body .section-title::before {
  background: linear-gradient(135deg, #2d6a4f, #40916c) !important;
  box-shadow: 0 0 0 4px rgba(45,106,79,.10) !important;
}
html[data-theme="green"] body .filter-btn.active:not(.f-today):not(.f-3days):not(.f-week):not(.f-active) {
  background: #2d6a4f !important; border-color: #235940 !important; color: #fff !important;
}
html[data-theme="green"] body .filter-btn:hover { border-color: #40916c !important; color: #2d6a4f !important; }
html[data-theme="green"] body .search-box:focus-within { border-color: #40916c !important; }
html[data-theme="green"] body .owner-bar { background: #2d6a4f !important; }
html[data-theme="green"] body .owner-row:nth-child(2n) .owner-bar { background: #40916c !important; }
html[data-theme="green"] body .owner-row:nth-child(3n) .owner-bar { background: #235940 !important; }
html[data-theme="green"] body .owner-row.active-owner {
  background: #e6f0ea !important; border-right-color: #2d6a4f !important;
}

/* ═══════════════════════════════════════════════════════════════
   توحيد بطاقات المؤشرات (KPI) عبر كل الوحدات
   → أسطح بيضاء نظيفة بدل التدرّجات الملوّنة (بنفسجي/برتقالي/تركواز).
   حافة علوية رفيعة باللون الذهبي للتمييز فقط. ينطبق على الثيمين.
   ═══════════════════════════════════════════════════════════════ */
html[data-theme] body .stat-card,
html[data-theme] body .client-kpi,
html[data-theme] body .an-kpi,
html[data-theme] body .kpi-card {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px rgba(20,41,77,.06) !important;
}
html[data-theme] body .stat-card::before,
html[data-theme] body .client-kpi::before,
html[data-theme] body .an-kpi::before {
  background: var(--gold) !important;
}
/* أرقام المؤشرات: كحلي رصين بدل الألوان المتفرّقة (الحالة تبقى عبر الكلاسات) */
html[data-theme="green"] body .client-kpi-num,
html[data-theme="green"] body .an-kpi-num,
html[data-theme="green"] body .stat-card .stat-num { color: var(--navy) !important; }
html[data-theme="grad"] body .client-kpi-num,
html[data-theme="grad"] body .an-kpi-num,
html[data-theme="grad"] body .stat-card .stat-num { color: var(--navy) !important; }

/* ═══════════════════════════════════════════════════════════════
   إزالة أزرار التصدير من كل الصفحات (بطلب الإدارة)
   ═══════════════════════════════════════════════════════════════ */
.export-wrap,
.export-btn,
.export-excel-btn,
.export-dropdown { display: none !important; }
