.ed-stl-panel{margin:8px 0 6px}
.ed-stl-row{display:flex;align-items:center;gap:.75rem;padding:.35rem .5rem;background:#fafafa;border:1px solid #eee;border-radius:6px;margin:.3rem 0}
.ed-stl-row .ed-title{font-weight:600}
.ed-stl-actions a{margin-inline-start:.6rem}

.ed-stl-bucket{margin:.4rem 0 .8rem}
.ed-stl-bucket-title{font-weight:600;opacity:.75;margin:.2rem 0 .25rem}
.ed-stl-bucket-list > *{margin:.15rem 0}

/* ============================================== */
/* 🚀 الحل الأخير: الترتيب الوهمي باستخدام CSS */
/* ============================================== */

/* 1. إخفاء المهام التي تم تعيينها من مكانها الأصلي */
/* (نستخدم سمة data-ed-bucketed التي يجب أن يعيّنها كود JS عند تعيين المهمة) */
li.pm-task[data-ed-bucketed="1"] {
    display: none !important; /* أخفِ المهام التي "تم نقلها" */
}

/* 2. اظهار حقل جديد (Bucket) بعد صف القائمة الفرعية */
/* (هذا العنصر هو الذي سنستهدف داخله المهام) */
.ed-stl-row + .ed-stl-bucket {
    display: block;
    margin: 8px 0 16px 25px; /* مسافة بادئة لتبدو تابعة للقائمة الفرعية */
    border-left: 2px dashed #e9edf3;
    padding-left: 10px;
}

/* 3. استهداف المهام وعرضها داخل الـ Bucket */
/* هذا هو الجزء الصعب: نحتاج إلى استهداف المهام القريبة */
/* إذا كانت المهام تظهر مباشرة بعد الـ Bucket (وهذا هو الافتراض) */
.ed-stl-bucket + .task-group .pm-task[data-ed-bucketed="1"] {
    display: list-item !important; /* أظهر المهام المعيّنة */
    margin-left: 0 !important;
}

/* 4. جعل المهام التي لم يتم تعيينها تظهر في مكانها الأصلي (للتأكيد) */
li.pm-task:not([data-ed-bucketed]) {
    display: list-item !important;
}

.ed-sub-item .task-create-form { margin-top:8px; width:100%; }
.ed-sub-item .input-action-wrap { width:100%; }
.ed-form-ph { display:none; } /* placeholder */

st.textContent = `

  .ed-sub-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
  .ed-sub-title{background:#eef2f7;padding:4px 10px;border-radius:999px;font-weight:600}
  .ed-sub-head a{color:#0b5ed7;text-decoration:none;font-weight:600;margin-left:6px;cursor:pointer}
  .ed-sub-head a:hover{text-decoration:underline}
  ul.ed-sub-tasks{list-style:none;margin:8px 0 0;padding:0}

  /* تأكيد ظهور الفورم داخل الصندوق */
  .ed-sub-item .task-field,
  .ed-sub-item .pm-task-form,
  .ed-sub-item .input-action-wrap,
  .ed-sub-item .task-create-form{
    display:block !important;
    opacity:1 !important;
    max-height:none !important;
    height:auto !important;
    transform:none !important;
    width:50% !important;
    margin-top:8px;
  }

  .ed-form-ph{display:none}
  
  
  /* اختياري */
.ed-drawer.modal-under { z-index: 8000; pointer-events: none; }

/*********************************************/
/*************Side bar***********************/
/**********************************************/
/* === EDAMA: Sidebar instead of Drawer === */
/* .ed-layout{display:flex;gap:18px;align-items:flex-start}
.ed-main{flex:1;min-width:0}
.ed-fixed{width:420px;max-width:33vw;background:#fff;border:1px solid #e5e7eb;border-radius:12px;
          box-shadow:0 6px 22px rgba(0,0,0,.06);overflow:hidden;position:sticky;top:70px;max-height:calc(100vh - 84px)}
.ed-fixed-head{padding:12px 14px;border-bottom:1px solid #eef1f4;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ed-fixed-title{font-size:14px}
.ed-fixed-body{padding:0;overflow:auto;max-height:calc(100% - 48px)}
/* إعادة استخدام صفوف المهام نفسها */
/*.ed-task-row{padding:12px 16px;display:flex;gap:10px;align-items:center;border-bottom:1px solid #f3f4f6;cursor:pointer}
.ed-task-row:hover{background:#fafafa}
.ed-task-title{flex:1;min-width:0}
.ed-task-meta{color:#6b7280;font-size:12px;white-space:nowrap}*/


/* ===== ستايل سب ليست / السايدبار ===== */

.ed-link,
.ed-menu-btn,
.ed-add-here{
  color:#6b7280!important;
  text-decoration:underline;
  cursor:pointer;
}
.ed-link:hover,
.ed-menu-btn:hover,
.ed-add-here:hover{
  color:#374151!important;
}

/* الصندوق اللي جوّاه كل الـ sub task lists الخاصة بقائمة رئيسية واحدة */
.ed-sub-box{
  display:flex;
  flex-direction:column;
  gap:8px;

  /* 🔹 أهم سطرين: هدول اللي بدخلوا الـ Sub lists لليمين */
  margin:8px 0 14px 32px;   /* top right bottom left → 32px من اليسار */
  padding-left:14px;        /* مسافة داخلية جوّا الصندوق */

  border-left:2px solid #e6ebf0; /* خط رأسي يعمل شكل شجرة */
}

.ed-sub-item{
  background:#f8fafc;
  border:1px dashed #e3e7ea;
  border-radius:10px;
  padding:8px;
  position:relative;
}
.ed-sub-head{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.ed-sub-title{
  background:#eef2f7;
  padding:3px 9px;
  border-radius:999px;
  font-weight:600;
  font-size:12px;   /* أصغر شوي من عنوان القائمة الرئيسية */
  cursor:pointer;
}
.ed-sub-count{
  font-weight:600;
  color:#6b7280;
  font-size:11px;
}

.ed-sub-count{
  font-weight:600;
  color:#6b7280;
}
.ed-kebab{position:relative;}
.ed-menu{
  position:absolute;
  top:22px;
  right:0;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  box-shadow:0 10px 25px rgba(0,0,0,.08);
  z-index:9995;
  min-width:160px;
  padding:8px 0;
  display:none;
}
.ed-menu.open{display:block;}
.ed-menu a{
  display:block;
  padding:10px 14px;
  color:#374151;
  text-decoration:none;
}
.ed-menu a:hover{background:#f3f4f6;}
ul.ed-sub-tasks{
  list-style:none;
  margin:8px 0 0;
  padding:0;
}
.ed-sub-hidden{display:none!important;}

/* تمييز المهمة اللي جايين عليها من السايدبار */
.ed-highlight-task{
  background:#fff9c4 !important;
  box-shadow:0 0 0 2px #facc15;
  transition:background 0.4s ease;
}

/* ===== السايدبار نفسه (ألوان فاتحة) ===== */
.side_tasks{
  margin-top:120px;
  background:#F4F4F4;              /* خلفية عامة */
  border-radius:6px;
  border:1px solid #dddddd;
  overflow:hidden;
  position:relative;
  top:auto;
  align-self:auto;
}

/* الهيدر */
.side_tasks .ed-side-head{
  padding:8px 12px;
  border-bottom:1px solid #dddddd;
  font-weight:700;
  font-size:12px;
  color:#000000;                   /* خط أسود */
  background:#eaeaea;              /* درجة أغمق بسيطة */
}
.side_tasks .ed-side-title{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* جسم السايدبار */
.side_tasks .ed-side-body{
  padding:4px 0;
  max-height:calc(100vh - 120px);
  overflow:auto;
}

/* صفوف المهام في السايدبار */
.side_tasks .ed-task-row{
  padding:6px 10px;
  display:flex;
  flex-direction:column;
  gap:1px;
  cursor:pointer;
  border-bottom:1px solid #e9e9e9;
  font-size:11px;
}

/* zebra rows بألوان فاتحة */
.side_tasks .ed-task-row:nth-child(odd){
  background:#F4F4F4;              /* اللون اللي طلبته */
}
.side_tasks .ed-task-row:nth-child(even){
  background:#FAFAFA;              /* أفتح شوي */
}

.side_tasks .ed-task-row:hover{
  background:#eaeaea;              /* عند المرور بالماوس */
}

/* اسم المهمة */
.side_tasks .ed-task-title{
  font-size:11px;
  font-weight:600;
  color:#000000;                   /* أسود */
}

/* المسؤول + التاريخ */
.side_tasks .ed-task-meta{
  color:#555555;                   /* رمادي غامق */
  font-size:10px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* عناوين الليست في الداشبورد */
.pm-list-sortable .list-title,
.pm-task-list .list-title,
.pm-task-lists .list-title{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

/* ==== منيو كل تاسك في السايدبار (3 نقاط) ==== */

.side_tasks .ed-task-row-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  position:relative;
}

.side_tasks .ed-task-kebab{
  font-size:14px;
  line-height:1;
  padding:0 4px;
  cursor:pointer;
  color:#000000;
}

.side_tasks .ed-task-menu{
  position:absolute;
  top:100%;
  right:0;
  background:#ffffff;
  border:1px solid #dddddd;
  border-radius:4px;
  box-shadow:0 4px 10px rgba(0,0,0,0.10);
  padding:4px 0;
  min-width:140px;
  z-index:9999;
  display:none;
}

.side_tasks .ed-task-menu.open{
  display:block;
}

.side_tasks .ed-task-menu-item{
  font-size:11px;
  padding:4px 8px;
  color:#111111;
}

.side_tasks .ed-task-menu-item:hover{
  background:#F4F4F4;
}


/* إخفاء أول Task List بالكامل (Inbox) */
/*
.pm-task-lists > li.pm-list-sortable:first-child,
.pm-task-lists > .pm-task-list:first-child {
  display: none !important;
}
*/
/* إخفاء فورم إضافة مهمة تحت كل قائمة رئيسية */
.pm-task-lists .add-task,
.pm-task-lists form.task-create-form,
.pm-task-lists .task-field,
.pm-task-lists .pm-task-form {
  display: none !important;
}



/* تكبير فورم إضافة مهمة داخل Sub-list */
.ed-sub-item .task-field,
.ed-sub-item .pm-task-form,
.ed-sub-item .input-action-wrap {
  width: 100% !important;
  max-width: 100% !important;
}

.ed-sub-item input[type="text"],
.ed-sub-item textarea {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
/* داخل السايدبار الخاص بالمهام */
.side_tasks .ed-task-separator {
  position: relative;
  margin: 14px 0 10px;
  border-top: 1px dashed #bbb;   /* خط منقط واضح */
  height: 0;
  text-align: center;
}

/* عنوان صغير فوق الخط: "المهام المكتملة" */
.side_tasks .ed-task-separator::before {
  content: "Completed tasks";
  position: relative;
  top: -0.7em;
  padding: 0 8px;
  font-size: 11px;
  color: #666;
  background: #fff;              /* مهم لو خلفية السايدبار بيضا */
  border-radius: 10px;
  box-shadow: 0 0 0 1px #eee;    /* إطار خفيف حوالين التايتل */
}
/* شكل المهام المكتملة في السايدبار */
.side_tasks .ed-task-row.ed-task-completed .ed-task-title {
  opacity: 0.7;
  text-decoration: line-through;
  font-style: italic;
}

/* نخلي الميتا كمان أخفّ شوي */
.side_tasks .ed-task-row.ed-task-completed .ed-task-meta {
  opacity: 0.6;
}
