/* =====================================================================
   PORTFOLIO ITEMS — صفحة «إضافة المنجزات» (/portfolio/list/items/file)
   تجميل + تحسين تجربة بهوية cmp النحاسية. RTL. بلا تغيير منطق.
   الأنماط مبنية على الأصناف البنيوية الموجودة (.main-item/.sub-item/.card-body)
   حتى تبقى العناصر المُضافة عبر AJAX متناسقة. مقيّدة بـ .ph-items.
   ===================================================================== */
.ph-items {
  --pi-brand: #D46E2A;
  --pi-brand-rgb: 212, 110, 42;
  --pi-brand-hover: #B85B21;
  --pi-brand-light: #E8A05F;
  --pi-ink: #2b3a4a;
  --pi-ink-2: #6b7a89;
  --pi-border: rgba(34, 48, 63, .10);
  --pi-surface: #ffffff;   /* سطح البطاقات والترويسة */
  --pi-surface-2: #ffffff; /* سطح داخلي: أزرار صغيرة داخل البطاقة */
  --pi-glass: rgba(255, 255, 255, .7); /* طبقة زجاج فوق التظليل النحاسي */
  --pi-bg: #FAFCFE;        /* نهاية تدرّج الأسطح الفاتحة */
  --pi-shadow: rgba(34, 48, 63, .05);
  --pi-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- الترويسة والبحث (مضغوطة في سطر واحد) ---------- */
.ph-items-head {
  border-radius: 14px; padding: .6rem .8rem; margin-bottom: .9rem;
  background: linear-gradient(180deg, var(--pi-surface), var(--pi-bg));
  border: 1px solid var(--pi-border);
  box-shadow: 0 8px 22px var(--pi-shadow);
}
.ph-items-bar {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
}
.ph-items-title {
  font-weight: 800; color: var(--pi-ink); margin: 0;
  font-size: 1rem; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}

.ph-items-search { position: relative; flex: 1 1 220px; min-width: 160px; }
.ph-items-search .ti {
  position: absolute; inset-inline-start: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--pi-ink-2); pointer-events: none; font-size: .95rem;
}
.ph-items #searchInput {
  padding-inline-start: 2.1rem; border-radius: 10px; height: 40px;
  border: 1px solid var(--pi-border); background: var(--pi-surface);
  transition: border-color .2s var(--pi-ease), box-shadow .2s ease;
}
.ph-items #searchInput:focus {
  border-color: var(--pi-brand);
  box-shadow: 0 0 0 .18rem rgba(var(--pi-brand-rgb), .15);
}

/* زر مسح البحث */
.ph-items .phi-clear {
  position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: rgba(34, 48, 63, .08); color: var(--pi-ink-2);
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s var(--pi-ease), color .2s ease;
}
.ph-items .phi-clear:hover { background: rgba(var(--pi-brand-rgb), .15); color: var(--pi-brand-hover); }
.ph-items #searchInput { padding-inline-end: 2.2rem; }

/* أزرار الأدوات (فتح/طيّ الكل) */
.ph-items .phi-tools { display: inline-flex; gap: .35rem; }
.ph-items .phi-tool-btn {
  width: 38px; height: 40px; border-radius: 10px;
  background: var(--pi-surface-2); border: 1px solid var(--pi-border); color: var(--pi-ink-2);
  display: grid; place-items: center; cursor: pointer;
  transition: all .2s var(--pi-ease);
}
.ph-items .phi-tool-btn:hover { color: var(--pi-brand); border-color: rgba(var(--pi-brand-rgb), .4); background: rgba(var(--pi-brand-rgb), .06); }
.ph-items .phi-tool-btn .ti { font-size: 1.15rem; }

/* ترويسة لاصقة أثناء التمرير */
.ph-items-head {
  position: sticky; top: .5rem; z-index: 5;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

@media (max-width: 575.98px) {
  .ph-items-title { max-width: 100%; flex: 1 1 100%; text-align: center; }
  .ph-items-bar { justify-content: center; }
  .ph-items-head { position: static; }
}

/* ---------- عدّادات مضغوطة ---------- */
.ph-items .phi-summary { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.ph-items .phi-sum-stat {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .32rem .7rem; border-radius: 999px; white-space: nowrap;
  background: rgba(var(--pi-brand-rgb), .05); border: 1px solid rgba(var(--pi-brand-rgb), .12);
}
.ph-items .phi-sum-stat > .ti { color: var(--pi-brand); font-size: 1rem; }
.ph-items .phi-sum-num { font-weight: 800; font-size: .95rem; color: var(--pi-brand-hover); line-height: 1; }
.ph-items .phi-sum-of { font-size: .82rem; color: var(--pi-ink-2); font-weight: 700; }
.ph-items .phi-sum-label { font-size: .78rem; color: var(--pi-ink-2); font-weight: 600; }

/* نبضة عند تحديث العدّاد */
@keyframes phiBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--pi-brand); } 100% { transform: scale(1); } }
.ph-items .phi-sum-num.phi-bump { animation: phiBump .4s var(--pi-ease); display: inline-block; }

/* ---------- نقطة الحالة (يحتوي إنجازات) ---------- */
.ph-items .phi-dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(145deg, rgba(52, 199, 89, .40), rgba(40, 167, 69, .25));
  border: 1px solid rgba(40, 167, 69, .25);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 0 0 3px rgba(40, 167, 69, .06);
}
.ph-items .phi-dot.is-off {
  background: linear-gradient(145deg, rgba(173, 181, 189, .5), rgba(173, 181, 189, .3));
  border-color: rgba(173, 181, 189, .35);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 0 0 3px rgba(173, 181, 189, .1);
}

/* ---------- زر إنشاء ملف (صفحة معاينة النموذج) ---------- */
.ph-items .phi-create-btn {
  display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; white-space: nowrap;
  padding: .55rem 1.1rem; border-radius: 10px; font-weight: 700; color: #fff !important;
  background: linear-gradient(135deg, var(--pi-brand-light), var(--pi-brand) 55%, var(--pi-brand-hover));
  box-shadow: 0 6px 16px rgba(var(--pi-brand-rgb), .18);
  transition: transform .2s var(--pi-ease), box-shadow .2s ease;
}
.ph-items .phi-create-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(var(--pi-brand-rgb), .30); color: #fff !important; }
.ph-items .phi-create-btn:active { transform: translateY(0) scale(.985); }

/* ---------- البند الرئيسي ---------- */
.ph-items .main-item {
  border: 1px solid var(--pi-border) !important;
  border-radius: 14px !important; overflow: hidden;
  box-shadow: 0 6px 16px var(--pi-shadow) !important;
  transition: box-shadow .22s ease, transform .22s var(--pi-ease);
}
.ph-items .main-item:hover { box-shadow: 0 14px 30px rgba(var(--pi-brand-rgb), .08) !important; }
.ph-items .main-item .card-body {
  /* تظليل نحاسي خافت جداً — يوحي بالهوية دون إشباع */
  background: linear-gradient(180deg, rgba(var(--pi-brand-rgb), .04), rgba(var(--pi-brand-rgb), .012)) !important;
  border-inline-start: 3px solid rgba(var(--pi-brand-rgb), .40);
  gap: .5rem;
}
.ph-items .main-item .fw-semibold { color: var(--pi-ink); }

/* رقاقة الوزن */
.ph-items .main-item .card-body > div:last-child > span:not(.badge) {
  display: inline-flex; align-items: center; padding: .28rem .6rem;
  border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: rgba(var(--pi-brand-rgb), .07); color: var(--pi-brand-hover);
}

/* شريط تقدّم البند */
.ph-items .progress { border-radius: 999px !important; background: rgba(var(--pi-brand-rgb), .09) !important; }
.ph-items .progress-bar {
  background: linear-gradient(90deg, var(--pi-brand), var(--pi-brand-light)) !important;
  border: 0 !important; border-radius: 999px;
}

/* زر تعديل البند الرئيسي */
.ph-items .btn-outline-warning {
  border-color: rgba(var(--pi-brand-rgb), .28); color: var(--pi-brand-hover);
  border-radius: 10px; transition: all .2s var(--pi-ease);
}
.ph-items .btn-outline-warning:hover {
  background: rgba(var(--pi-brand-rgb), .12);
  border-color: rgba(var(--pi-brand-rgb), .55);
  color: var(--pi-brand-hover);
}

/* ---------- زرّ الطيّ ---------- */
.ph-items .phi-toggle {
  background: var(--pi-surface-2); border: 1px solid var(--pi-border); color: var(--pi-ink-2);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  transition: all .2s var(--pi-ease); flex: 0 0 auto;
}
.ph-items .phi-toggle:hover { color: var(--pi-brand); border-color: rgba(var(--pi-brand-rgb), .4); }
.ph-items .phi-toggle .ti { transition: transform .22s var(--pi-ease); }
.ph-items .phi-toggle[aria-expanded="false"] .ti { transform: rotate(-90deg); }

/* ---------- البنود الفرعية ---------- */
.ph-items .sub-item {
  border: 1px solid var(--pi-border) !important;
  border-radius: 10px !important; overflow: hidden;
  transition: border-color .2s var(--pi-ease), background .2s ease;
}
.ph-items .sub-item:hover { border-color: rgba(var(--pi-brand-rgb), .3) !important; }
.ph-items .sub-item .card-body { background: transparent; }
.ph-items .sub-item .fw-bold { color: var(--pi-ink); }

/* أزرار الإضافة/التعديل داخل البنود الفرعية */
.ph-items .btn-label-success { border-radius: 9px; font-weight: 700; }
.ph-items .btn-label-warning { border-radius: 9px; font-weight: 700; }

/* ---------- صف «بند فرعي جديد» — تصميم مبدع ---------- */
.ph-items .sub-item.bg-label-github {
  position: relative; border: 0 !important; border-radius: 14px !important;
  overflow: hidden; margin-top: .4rem;
  /* سطح زجاجي نحاسي هادئ */
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(var(--pi-brand-rgb), .07), transparent 60%),
    linear-gradient(180deg, rgba(var(--pi-brand-rgb), .035), var(--pi-glass)) !important;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(var(--pi-brand-rgb), .06);
  transition: transform .22s var(--pi-ease), box-shadow .22s ease;
}
.ph-items .sub-item.bg-label-github:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(var(--pi-brand-rgb), .12);
}
/* حدّ متقطّع نحاسي متحرّك */
.ph-items .sub-item.bg-label-github::before {
  content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  padding: 1.5px;
  background:
    repeating-linear-gradient(90deg, var(--pi-brand) 0 10px, transparent 10px 20px) top/100% 1.5px no-repeat,
    repeating-linear-gradient(90deg, var(--pi-brand) 0 10px, transparent 10px 20px) bottom/100% 1.5px no-repeat,
    repeating-linear-gradient(0deg, var(--pi-brand) 0 10px, transparent 10px 20px) left/1.5px 100% no-repeat,
    repeating-linear-gradient(0deg, var(--pi-brand) 0 10px, transparent 10px 20px) right/1.5px 100% no-repeat;
  opacity: .3;
  animation: phiDash 22s linear infinite;
}
@keyframes phiDash {
  to { background-position: top -40px, bottom 40px, left 40px, right -40px; }
}
/* أيقونة + دائرية أمام النص */
.ph-items .sub-item.bg-label-github .fw-bold {
  display: inline-flex; align-items: center; gap: .55rem; color: var(--pi-brand-hover);
}
.ph-items .sub-item.bg-label-github .fw-bold::before {
  content: "+"; font-weight: 700; line-height: 1;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, var(--pi-brand-light), var(--pi-brand));
  box-shadow: 0 4px 10px rgba(var(--pi-brand-rgb), .22);
  animation: phiPulse 2.4s var(--pi-ease) infinite;
}
@keyframes phiPulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(var(--pi-brand-rgb), .22), 0 0 0 0 rgba(var(--pi-brand-rgb), .18); }
  50%      { box-shadow: 0 4px 10px rgba(var(--pi-brand-rgb), .22), 0 0 0 7px rgba(var(--pi-brand-rgb), 0); }
}

/* الزر — متدرّج بلمعان مارّ */
.ph-items .btn-github {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--pi-brand-light), var(--pi-brand) 55%, var(--pi-brand-hover));
  color: #fff; border: 0; border-radius: 10px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(var(--pi-brand-rgb), .20);
  transition: transform .2s var(--pi-ease), box-shadow .2s ease;
}
.ph-items .btn-github::after {
  content: ""; position: absolute; top: 0; inset-inline-start: -120%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); transition: inset-inline-start .5s var(--pi-ease);
}
.ph-items .btn-github:hover {
  color: #fff; transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(var(--pi-brand-rgb), .32);
}
.ph-items .btn-github:hover::after { inset-inline-start: 140%; }
.ph-items .btn-github .ti { transition: transform .2s var(--pi-ease); }
.ph-items .btn-github:hover .ti { transform: rotate(90deg) scale(1.15); }

@media (prefers-reduced-motion: reduce) {
  .ph-items .sub-item.bg-label-github::before,
  .ph-items .sub-item.bg-label-github .fw-bold::before { animation: none !important; }
}

/* شارات الحالة (نقطة) */
.ph-items .badge-dot { border-radius: 50%; }

/* ---------- بطاقة إضافة بند رئيسي ---------- */
.ph-items .phi-add-main {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 1rem; padding: 1.1rem 1.25rem; border-radius: 16px;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(var(--pi-brand-rgb), .06), transparent 55%),
    linear-gradient(180deg, rgba(var(--pi-brand-rgb), .03), var(--pi-surface));
  border: 1.5px dashed rgba(var(--pi-brand-rgb), .28);
  transition: box-shadow .22s ease, border-color .22s ease;
}
.ph-items .phi-add-main:hover {
  border-color: var(--pi-brand);
  box-shadow: 0 12px 28px rgba(var(--pi-brand-rgb), .14);
}
.ph-items .phi-add-main-text { display: flex; align-items: center; gap: .85rem; }
.ph-items .phi-add-main-text > .ti {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 1.5rem; color: #fff;
  background: linear-gradient(135deg, var(--pi-brand-light), var(--pi-brand));
  box-shadow: 0 6px 14px rgba(var(--pi-brand-rgb), .3);
}
.ph-items .phi-add-main-text .fw-bold { color: var(--pi-ink); }

/* زر حذف البند الرئيسي المرن — هادئ حتى التمرير */
.ph-items .phi-del-main {
  border-color: rgba(220, 53, 69, .25); color: #cf5560; border-radius: 10px;
  transition: all .2s var(--pi-ease);
}
.ph-items .phi-del-main:hover { background: #dc3545; border-color: #dc3545; color: #fff; }

/* ---------- حالة فارغة ---------- */
.ph-items .phi-empty {
  text-align: center; padding: 3rem 1rem; color: var(--pi-ink-2);
}
.ph-items .phi-empty .ti { font-size: 2.6rem; color: rgba(var(--pi-brand-rgb), .5); display: block; margin-bottom: .5rem; }

/* ---------- تمييز عند التمرير (منقول من الـblade) ---------- */
.ph-items .highlight-scroll { animation: phiHighlight 1.5s ease-in-out; box-shadow: 0 0 0 4px rgba(var(--pi-brand-rgb), .30); }
@keyframes phiHighlight {
  0%   { box-shadow: 0 0 0 6px rgba(var(--pi-brand-rgb), .38); }
  100% { box-shadow: 0 0 0 0 rgba(var(--pi-brand-rgb), 0); }
}

/* ============================================================
   مودالات (.phi-modal) — تصميم قوي مستقلّ التوكنات
   يعمل حتى لو نُقل المودال إلى <body> خارج .ph-items.
   ============================================================ */
.phi-modal {
  --pi-brand: #D46E2A;
  --pi-brand-rgb: 212, 110, 42;
  --pi-brand-hover: #B85B21;
  --pi-brand-light: #E8A05F;
  --pi-ink: #2b3a4a;
  --pi-ink-2: #6b7a89;
  --pi-border: rgba(34, 48, 63, .12);
  --pi-surface: #ffffff;   /* سطح المودال والترويسة */
  --pi-surface-2: #f6f7f9; /* سطح داخلي: تمرير زر الإلغاء */
  --pi-ease: cubic-bezier(.4, 0, .2, 1);
}

.phi-modal .modal-content {
  border: 0; border-radius: 18px; overflow: hidden;
  background: var(--pi-surface);
  box-shadow: 0 24px 60px rgba(24, 16, 8, .22);
}

/* الترويسة — بيضاء هادئة بلمسة نحاسية (الهوية بقلّة) */
.phi-modal .modal-header {
  background: var(--pi-surface); color: var(--pi-ink);
  border: 0; border-bottom: 1px solid var(--pi-border);
  padding: 1.1rem 1.3rem;
}
.phi-modal .modal-title {
  font-weight: 800; font-size: 1.08rem; color: var(--pi-ink);
  display: inline-flex; align-items: center; gap: .6rem;
}
.phi-modal .modal-title::before {
  content: "+"; font-weight: 700; flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 1.25rem; line-height: 1;
  color: var(--pi-brand); background: rgba(var(--pi-brand-rgb), .12);
}
.phi-modal .modal-header .btn-close {
  opacity: .6; padding: .55rem; border-radius: 8px;
  transition: opacity .2s var(--pi-ease), background-color .2s ease;
}
.phi-modal .modal-header .btn-close:hover { opacity: 1; background-color: rgba(34, 48, 63, .06); }

/* الجسم — حقول واضحة */
.phi-modal .modal-body { padding: 1.4rem 1.3rem; }
.phi-modal .modal-body .form-label {
  font-weight: 700; color: var(--pi-ink); margin-bottom: .5rem; font-size: .92rem;
}
.phi-modal .modal-body .form-control {
  border-radius: 10px; border: 1.5px solid var(--pi-border); padding: .65rem .9rem; font-size: .98rem;
  transition: border-color .2s var(--pi-ease), box-shadow .2s ease;
}
.phi-modal .modal-body .form-control:focus {
  border-color: var(--pi-brand);
  box-shadow: 0 0 0 .2rem rgba(var(--pi-brand-rgb), .15);
}

/* التذييل — أزرار متزنة، التأكيد بلون الهوية */
.phi-modal .modal-footer {
  border: 0; border-top: 1px solid var(--pi-border);
  padding: .9rem 1.3rem; gap: .5rem; justify-content: flex-end;
}
.phi-modal .modal-footer .btn {
  border-radius: 10px; font-weight: 700; padding: .55rem 1.4rem; font-size: .95rem;
}
.phi-modal .modal-footer .btn-success {
  background: var(--pi-brand); border: 0; color: #fff;
  box-shadow: 0 4px 12px rgba(var(--pi-brand-rgb), .28);
  transition: background .2s var(--pi-ease), transform .2s var(--pi-ease), box-shadow .2s ease;
}
.phi-modal .modal-footer .btn-success:hover {
  background: var(--pi-brand-hover); transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(var(--pi-brand-rgb), .38); color: #fff;
}
.phi-modal .modal-footer .btn-secondary {
  background: var(--pi-surface); color: var(--pi-ink-2); border: 1.5px solid var(--pi-border);
}
.phi-modal .modal-footer .btn-secondary:hover { background: var(--pi-surface-2); color: var(--pi-ink); }

/* ظهور ناعم */
.phi-modal.fade .modal-dialog {
  transition: transform .25s var(--pi-ease), opacity .25s ease;
  transform: translateY(14px) scale(.98); opacity: 0;
}
.phi-modal.show .modal-dialog { transform: none; opacity: 1; }

/* ---------- توحيد الألوان (استبدال ألوان Vuexy المتنوّعة) ---------- */
/* تناوب صفوف البنود الفرعية: بند بتظليل نحاسي فاتح، والتالي بسطح صافٍ —
   زيبرا واضحة للعين لكن هادئة، وكلاهما ضمن الهوية (بلا بنفسجي Vuexy). */
.ph-items .sub-item.bg-menu-theme { background: rgba(var(--pi-brand-rgb), .045) !important; }
.ph-items .sub-item.bg-body { background: var(--pi-surface) !important; }

/* زرّا «إضافة» و«تعديل» البند الفرعي — هوية نحاسية واحدة فاتحة مريحة للعين.
   لا يظهران معاً في صفٍّ واحد (البند إمّا إضافة أو تعديل)، فتوحيدهما نظيف
   والتمييز يبقى بالأيقونة (+ / قلم). التمرير يعمّق التظليل بلا امتلاء صلب. */
.ph-items .btn-label-success,
.ph-items .btn-label-warning {
  background: rgba(var(--pi-brand-rgb), .06);
  color: var(--pi-brand-hover);
  border: 1px solid rgba(var(--pi-brand-rgb), .13);
}
.ph-items .btn-label-success:hover,
.ph-items .btn-label-warning:hover {
  background: rgba(var(--pi-brand-rgb), .20);
  border-color: rgba(var(--pi-brand-rgb), .30);
  color: var(--pi-brand-hover);
}

/* رأس البند الرئيسي: تحييد لون slack الأصلي */
.ph-items .main-item .card-body.bg-label-slack { color: var(--pi-ink) !important; }

@media (prefers-reduced-motion: reduce) {
  .ph-items * { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------------
   الوضع الداكن — قلب التوكنات فقط (لا تكرار للقواعد).
   الصفحة لا تحمّل premium-theme، فالتوكنات محلية والقلب هنا يغطّيها كلها.
   الأبيض فوق تدرّجات الهوية (الأزرار/الأيقونات/اللمعان) يبقى أبيض عمداً.
   --------------------------------------------------------------------- */
html.dark-style .ph-items {
  --pi-ink:       #E6E8EC;
  --pi-ink-2:     #9AA0AB;
  --pi-border:    rgba(255, 255, 255, .10);
  --pi-surface:   #1C1F26;
  --pi-surface-2: #23272F;
  --pi-glass:     rgba(255, 255, 255, .05);
  --pi-bg:        #14161B;
  --pi-shadow:    rgba(0, 0, 0, .45);
}

/* المودال يُنقل إلى <body> خارج .ph-items، فيحتاج قلباً مستقلاً بنفس القيم */
html.dark-style .phi-modal {
  --pi-ink:       #E6E8EC;
  --pi-ink-2:     #9AA0AB;
  --pi-border:    rgba(255, 255, 255, .12);
  --pi-surface:   #1C1F26;
  --pi-surface-2: #23272F;
}

/* ---------------------------------------------------------------------
   الوضع الداكن — الألوان الدلالية والتظليل الرمادي
   نصوصها في الفاتح داكنة على تظليل شفّاف، فتصير غير مقروءة على خلفية داكنة،
   والتظليل الرمادي (rgba داكنة) يختفي تماماً فيُقلب إلى أبيض شفّاف.
   --------------------------------------------------------------------- */
html.dark-style .ph-items .btn-label-success,
html.dark-style .ph-items .btn-label-warning {
  background: rgba(var(--pi-brand-rgb), .18); color: #F0A874;
  border-color: rgba(var(--pi-brand-rgb), .30);
}
html.dark-style .ph-items .btn-label-success:hover,
html.dark-style .ph-items .btn-label-warning:hover {
  background: rgba(var(--pi-brand-rgb), .28); color: #F7C29A;
}
html.dark-style .ph-items .phi-del-main {
  color: #F87171; border-color: rgba(220, 53, 69, .35);
}
html.dark-style .ph-items .phi-clear { background: rgba(255, 255, 255, .10); }
html.dark-style .phi-modal .modal-header .btn-close:hover { background-color: rgba(255, 255, 255, .08); }

/* نصّ الهوية (#B85B21) مكتوب ليقرأ على أبيض — على سطح داكن تباينه ~2.3:1.
   يُفتَّح للنصوص فقط؛ التدرّجات تبقى كما هي وإلا انقلب ترتيب ألوانها.
   (نفس معالجة portfolio-file.css و portfolio-record-edit.css) */
html.dark-style .ph-items .phi-sum-num,
html.dark-style .ph-items .phi-clear:hover,
html.dark-style .ph-items .phi-toggle:hover,
html.dark-style .ph-items .phi-tool-btn:hover,
html.dark-style .ph-items .btn-outline-warning,
html.dark-style .ph-items .main-item .card-body > div:last-child > span:not(.badge),
html.dark-style .ph-items .sub-item.bg-label-github .fw-bold {
  color: #F0A874;
}
