/* ============ تسک و یادداشت — آبنر v19 ============ */

body.theme-glass { --glass-rgba: 255, 255, 255; }
body.theme-dark  { --glass-rgba: 15, 23, 42; }
body.theme-light { --glass-rgba: 255, 252, 245; }

/* ============================================================
   کادر اصلی تسک
============================================================ */
#abnerTaskModule {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 16px !important;
  border-radius: 24px !important;
  gap: 10px !important;
  isolation: isolate !important;
}

#abnerTaskModule input,
#abnerTaskModule textarea {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: inherit !important;
  color: #ffffff !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
#abnerTaskModule input::placeholder { color: rgba(255, 255, 255, 0.5) !important; }

/* ---------- تب‌ها ---------- */
#abnerTaskModule .task-tabs {
  display: flex !important;
  gap: 4px !important;
  padding: 4px !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 14px !important;
  flex-shrink: 0 !important;
}
#abnerTaskModule .tab-btn {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: none !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.72) !important;
  padding: 8px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  transition: all 0.2s !important;
}
#abnerTaskModule .tab-btn:hover { color: #fff !important; }
#abnerTaskModule .tab-btn.active {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35) !important;
}
#abnerTaskModule .tab-btn svg { flex-shrink: 0 !important; }

/* ---------- نوار اکشن ---------- */
#abnerTaskModule .task-action-bar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  width: 100% !important;
}
#abnerTaskModule .task-action-bar .min-icon-btn {
  flex: 1 1 0 !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 11px !important;
  color: rgba(255, 255, 255, 0.85) !important;
  transition: all 0.2s !important;
  padding: 0 !important;
  cursor: pointer !important;
  min-width: 0 !important;
}
#abnerTaskModule .task-action-bar .min-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}
#abnerTaskModule .task-action-bar .min-icon-btn.active {
  background: #3b82f6 !important;
  color: #fff !important;
  border-color: transparent !important;
}
#abnerTaskModule .task-action-bar .min-icon-btn svg {
  width: 17px !important;
  height: 17px !important;
}

/* ---------- لیست تسک‌ها ---------- */
#abnerTaskModule .task-scroll-area {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  min-height: 0 !important;
  padding: 2px !important;
  transition: filter 0.3s ease !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent !important;
}
#abnerTaskModule .task-scroll-area::-webkit-scrollbar { width: 5px; }
#abnerTaskModule .task-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}
#abnerTaskModule .task-scroll-area.is-hidden {
  filter: blur(9px) !important;
  pointer-events: none !important;
  user-select: none !important;
}
#abnerTaskModule:has(.task-scroll-area.is-hidden) .task-new-input-wrap {
  filter: blur(9px) !important;
  pointer-events: none !important;
}

/* ---------- حالت خالی ---------- */
#abnerTaskModule .task-empty-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 30px 12px !important;
  text-align: center !important;
  margin: auto !important;
}
#abnerTaskModule .tes-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 72px !important;
  height: 72px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  margin-bottom: 4px !important;
}
#abnerTaskModule .tes-title {
  font-size: 14.5px !important;
  font-weight: 800 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  margin-bottom: 6px !important;
}
#abnerTaskModule .tes-sub {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  margin-top: 4px !important;
}
#abnerTaskModule .tes-suggestions {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
#abnerTaskModule .tes-suggestions li {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.72) !important;
  cursor: pointer !important;
  padding: 3px 8px !important;
  border-radius: 8px !important;
  transition: all 0.15s !important;
}
#abnerTaskModule .tes-suggestions li:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

/* ============================================================
   🎯 آیتم تسک — با position relative برای دکمه‌های absolute
============================================================ */
#abnerTaskModule .task-item {
  position: relative !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.2s !important;
  width: 100% !important;
  box-sizing: border-box !important;
  direction: rtl !important;
}
#abnerTaskModule .task-item:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

#abnerTaskModule .task-item .ti-main {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  direction: rtl !important;
}

/* دکمه چک — ثابت */
#abnerTaskModule .ti-check {
  flex-shrink: 0 !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 7px !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  background: transparent !important;
  color: #fff !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 1px !important;
  transition: all 0.2s !important;
  padding: 0 !important;
}
#abnerTaskModule .ti-check:hover { border-color: #3b82f6 !important; }
#abnerTaskModule .task-item.completed .ti-check {
  background: #22c55e !important;
  border-color: #22c55e !important;
}
#abnerTaskModule .task-item.completed .ti-title {
  text-decoration: line-through !important;
  opacity: 0.55 !important;
}
#abnerTaskModule .task-item.completed .ti-desc { opacity: 0.5 !important; }

/* محتوا — کل عرض */
#abnerTaskModule .task-item .ti-main .ti-content {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  direction: rtl !important;
  text-align: right !important;
  box-sizing: border-box !important;
}

#abnerTaskModule .ti-title {
  display: block !important;
  width: 100% !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #fff !important;
  word-break: break-word !important;
  line-height: 1.4 !important;
  text-align: right !important;
  box-sizing: border-box !important;
}

#abnerTaskModule .ti-desc {
  display: block !important;
  width: 100% !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.62) !important;
  line-height: 1.5 !important;
  word-break: break-word !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: right !important;
  margin-top: 2px !important;
  box-sizing: border-box !important;
}

/* ============================================================
   🎯 دکمه‌های action — absolute در گوشه چپ بالا
   (دیگه از جریان flex خارجن و جا نمی‌گیرن)
============================================================ */
#abnerTaskModule .ti-action {
  position: absolute !important;
  top: 8px !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 7px !important;
  border: none !important;
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
  opacity: 0 !important;
  padding: 0 !important;
  z-index: 5 !important;
  flex-shrink: 0 !important;
}
#abnerTaskModule .ti-action[data-act="delete"] { left: 8px !important; }
#abnerTaskModule .ti-action[data-act="edit"]   { left: 36px !important; }
#abnerTaskModule .ti-action[data-act="pin"]    { left: 8px !important; }

#abnerTaskModule .task-item:hover .ti-action { opacity: 1 !important; }
#abnerTaskModule .ti-action:hover {
  background: rgba(239, 68, 68, 0.85) !important;
  color: #fff !important;
}
#abnerTaskModule .ti-action[data-act="edit"]:hover {
  background: rgba(59, 130, 246, 0.85) !important;
  color: #fff !important;
}
#abnerTaskModule .note-item .ti-action[data-act="pin"]:hover {
  background: rgba(59, 130, 246, 0.85) !important;
  color: #fff !important;
}
#abnerTaskModule .note-item.pinned {
  border-color: rgba(59, 130, 246, 0.4) !important;
  background: rgba(59, 130, 246, 0.06) !important;
}

/* ============================================================
   🎯 بج‌ها — تمام عرض، از راست، wrap طبیعی
============================================================ */
#abnerTaskModule .ti-content .ti-badges {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  text-align: right !important;
  direction: rtl !important;
  padding: 0 !important;
  margin: 6px 0 0 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow: visible !important;
}

#abnerTaskModule .ti-content .ti-badges > .ti-badge {
  display: inline-flex !important;
  vertical-align: middle !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 3px 7px !important;
  border-radius: 7px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 0 4px 4px !important;
  border: 1px solid transparent !important;
  box-sizing: border-box !important;
  text-align: right !important;
  transition: transform 0.15s ease !important;
  position: static !important;
  float: none !important;
}
#abnerTaskModule .ti-content .ti-badges > .ti-badge:hover {
  transform: translateY(-1px);
}

#abnerTaskModule .ti-content .ti-badges > .ti-badge > .ti-dot {
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}
#abnerTaskModule .ti-content .ti-badges > .ti-badge > svg {
  width: 10px !important;
  height: 10px !important;
  flex-shrink: 0 !important;
}
#abnerTaskModule .ti-content .ti-badges > .ti-badge > .ti-badge-x {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0 2px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  font-size: 11px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}
#abnerTaskModule .ti-content .ti-badges > .ti-badge > .ti-badge-x:hover {
  background: rgba(239, 68, 68, 0.6) !important;
}

/* رنگ‌های بج */
#abnerTaskModule .ti-badge.prio {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.88) !important;
}
#abnerTaskModule .ti-badge.due {
  color: #93c5fd !important;
  background: rgba(59, 130, 246, 0.15) !important;
}
#abnerTaskModule .ti-badge.due.past {
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}
#abnerTaskModule .ti-badge.tag {
  background: color-mix(in srgb, var(--tag-color) 20%, transparent) !important;
  color: var(--tag-color) !important;
}
#abnerTaskModule .ti-badge.recur {
  color: #a78bfa !important;
  background: rgba(167, 139, 250, 0.15) !important;
}
#abnerTaskModule .ti-badge.time {
  color: #93c5fd !important;
  background: rgba(59, 130, 246, 0.15) !important;
}
#abnerTaskModule .ti-badge.board {
  background: color-mix(in srgb, var(--board-color) 20%, transparent) !important;
  color: var(--board-color) !important;
}

/* ============================================================
   ورودی جدید
============================================================ */
#abnerTaskModule .task-new-input-wrap {
  flex-shrink: 0 !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
#abnerTaskModule .task-new-input-wrap .tn-inputs {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  width: 100% !important;
  align-items: stretch !important;
}
#abnerTaskModule input.tn-title {
  display: block !important;
  width: 100% !important;
  padding: 4px 0 !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #fff !important;
  line-height: 1.4 !important;
}
#abnerTaskModule .tn-desc {
  display: block !important;
  width: 100% !important;
  padding: 2px 0 !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.72) !important;
  line-height: 1.4 !important;
  resize: none !important;
  overflow-y: auto !important;
  max-height: 80px !important;
  min-height: 18px !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
#abnerTaskModule .tn-desc::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
#abnerTaskModule .tn-desc::placeholder { color: rgba(255, 255, 255, 0.32) !important; }
#abnerTaskModule .task-new-input-wrap .tn-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
  flex-wrap: wrap !important;
}
#abnerTaskModule .task-new-input-wrap .tn-icon {
  width: auto !important;
  min-width: 32px !important;
  height: 32px !important;
  padding: 0 10px !important;
  gap: 5px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
  flex-shrink: 0 !important;
}
#abnerTaskModule .task-new-input-wrap .tn-icon:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}
#abnerTaskModule .task-new-input-wrap .tn-icon.active {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
  color: #3b82f6 !important;
}
#abnerTaskModule .task-new-input-wrap .tn-icon .tn-label {
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  font-family: inherit;
}
#abnerTaskModule .task-new-input-wrap .tn-icon svg { flex-shrink: 0; }
#abnerTaskModule .task-new-input-wrap .tn-submit {
  margin-inline-start: auto !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  border: none !important;
  background: #3b82f6 !important;
  color: #fff !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
  padding: 0 !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
  flex-shrink: 0 !important;
}
#abnerTaskModule .task-new-input-wrap .tn-submit:hover {
  background: #2563eb !important;
  transform: scale(1.05) !important;
}

/* ============================================================
   Inline Popover
============================================================ */
.tasks-inline-popover {
  position: fixed;
  padding: 12px;
  border-radius: 16px;
  background: rgba(var(--glass-rgba, 255, 255, 255), var(--glass-opacity, 0.28)) !important;
  backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  border: 1px solid var(--dash-glass-border, rgba(255, 255, 255, 0.28)) !important;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  z-index: 9999999;
  direction: rtl;
  color: #f8fafc;
  animation: ddIn 0.18s ease;
  transform: translateZ(0);
  isolation: isolate;
  max-width: calc(100vw - 20px);
  width: 320px;
}
@keyframes ddIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ip-title {
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ip-list { display: flex; flex-direction: column; gap: 2px; }
.ip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  text-align: right;
  width: 100%;
}
.ip-item:hover { background: rgba(255, 255, 255, 0.12); }
.ip-item.active { background: rgba(59, 130, 246, 0.25); color: #fff; }
.ip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.ip-tag-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.ip-tag-list::-webkit-scrollbar { width: 5px; }
.ip-tag-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
.ip-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.ip-tag-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}
.ip-tag-row.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.4);
}
.ip-tag-del {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ip-tag-row:hover .ip-tag-del { opacity: 1; }
.ip-tag-del:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.ip-tag-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-align: right;
}
.ip-tag-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.ip-tag-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s;
}
.ip-tag-add-row:focus-within {
  border-color: rgba(59, 130, 246, 0.6);
  border-style: solid;
  background: rgba(59, 130, 246, 0.08);
}
.ip-tag-add-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.ip-tag-add-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}
.ip-tag-add-input::placeholder { color: rgba(255, 255, 255, 0.4); }

/* ============================================================
   Time Picker
============================================================ */
.time-picker-popover { width: 280px !important; padding: 14px 12px 12px; }
.tp-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.tp-label {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
}
.tp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
  height: 180px;
  margin-bottom: 12px;
}
.tp-cols::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 36px;
  margin-top: -18px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  border-top: 1px solid rgba(59, 130, 246, 0.4);
  border-bottom: 1px solid rgba(59, 130, 246, 0.4);
  pointer-events: none;
  z-index: 1;
}
.tp-col {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.tp-col::-webkit-scrollbar { display: none; }
.tp-scroll {
  padding: 72px 0;
  display: flex;
  flex-direction: column;
}
.tp-item {
  height: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.15s, font-size 0.15s;
  position: relative;
  z-index: 2;
  user-select: none;
}
.tp-item.active { color: #fff; font-size: 21px; }
.tp-item:hover { color: rgba(255, 255, 255, 0.75); }
.tp-actions { display: flex; gap: 8px; }
.tp-confirm {
  flex: 1;
  padding: 11px;
  border-radius: 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.tp-confirm:hover { background: #2563eb; }
.tp-clear {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}
.tp-clear:hover { background: rgba(239, 68, 68, 0.15); }

/* ============================================================
   Date Picker
============================================================ */
.date-picker-popover { width: 360px !important; padding: 14px 12px 12px; }
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  direction: ltr;
}
.dp-nav {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  transform: scaleX(-1);
}
.dp-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}
.dp-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 8px;
}
.dp-wd {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
  padding: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 12px;
}
.dp-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.dp-cell.dp-empty { cursor: default; pointer-events: none; }
.dp-cell:hover:not(.dp-empty) { background: rgba(255, 255, 255, 0.12); }
.dp-cell.dp-today {
  color: #60a5fa;
  font-weight: 900;
  box-shadow: inset 0 0 0 1.5px #3b82f6;
}
.dp-cell.dp-selected {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.45);
}
.dp-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dp-btn {
  flex: 1;
  min-width: 80px;
  padding: 9px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.dp-btn-today {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.dp-btn-today:hover { background: rgba(255, 255, 255, 0.16); }
.dp-btn-clear {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.dp-btn-clear:hover { background: rgba(239, 68, 68, 0.25); }
.dp-btn-confirm {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.dp-btn-confirm:hover { background: #2563eb; }

/* ============================================================
   Panel Popovers
============================================================ */
.task-panel-pop {
  min-width: 240px !important;
  padding: 6px !important;
  border-radius: 14px !important;
  background: rgba(var(--glass-rgba, 255, 255, 255), var(--glass-opacity, 0.28)) !important;
  backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  border: 1px solid var(--dash-glass-border, rgba(255, 255, 255, 0.28)) !important;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  direction: rtl !important;
  color: #f8fafc !important;
  transform: translateZ(0);
}
.task-panel-pop .tp-more-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
  text-align: right !important;
  width: 100% !important;
}
.task-panel-pop .tp-more-item:hover { background: rgba(255, 255, 255, 0.12) !important; }
.task-panel-pop .tp-more-item.danger { color: #fca5a5 !important; }
.task-panel-pop .tp-more-item.danger:hover { background: rgba(239, 68, 68, 0.18) !important; }
.task-panel-pop .tp-divider {
  height: 1px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  margin: 4px 6px !important;
}
.task-panel-pop .tp-checkbox {
  width: 18px !important;
  height: 18px !important;
  border-radius: 6px !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  background: transparent !important;
  position: relative !important;
  flex-shrink: 0 !important;
}
.task-panel-pop .tp-checkbox.checked {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
}
.task-panel-pop .tp-checkbox.checked::after {
  content: '' !important;
  position: absolute !important;
  left: 4px !important;
  top: 1px !important;
  width: 6px !important;
  height: 10px !important;
  border: solid #fff !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
}
.task-panel-pop .tp-radio {
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  flex-shrink: 0 !important;
  position: relative !important;
}
.task-panel-pop .tp-radio.active { border-color: #3b82f6 !important; }
.task-panel-pop .tp-radio.active::after {
  content: '' !important;
  position: absolute !important;
  inset: 3px !important;
  border-radius: 50% !important;
  background: #3b82f6 !important;
}
.task-panel-pop .tp-section {
  padding: 8px 6px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.task-panel-pop .tp-section:last-of-type { border-bottom: none !important; }
.task-panel-pop .tp-section-title {
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  padding: 4px 6px 6px !important;
}
.task-panel-pop .tp-chip-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
}
.task-panel-pop .tp-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 5px 10px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-family: inherit !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.task-panel-pop .tp-chip:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}
.task-panel-pop .tp-chip.active {
  background: #3b82f6 !important;
  border-color: transparent !important;
  color: #fff !important;
}
.task-panel-pop .tp-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}
.task-panel-pop .tp-clear-btn {
  margin: 6px !important;
  padding: 8px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}

/* ============================================================
   Recurring Modal
============================================================ */
.recurring-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  background: rgba(10, 15, 30, 0.35) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  animation: recFadeInReal 0.2s ease;
}
.recurring-overlay.hidden { display: none !important; }
@keyframes recFadeInReal { from { opacity: 0; } to { opacity: 1; } }
.recurring-modal {
  width: 100%;
  max-width: 500px;
  max-height: 95vh;
  overflow: visible !important;
  padding: 22px 20px 18px;
  border-radius: 24px;
  background: rgba(var(--glass-rgba, 255, 255, 255), var(--glass-opacity, 0.28)) !important;
  backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  border: 1px solid var(--dash-glass-border, rgba(255, 255, 255, 0.28)) !important;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc;
  direction: rtl;
  animation: recScaleIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  transform: translateZ(0);
  scrollbar-width: none !important;
}
.recurring-modal::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
@keyframes recScaleIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.recurring-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  color: #fff;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.recurring-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.recurring-row-col {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.recurring-label {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.recurring-interval-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.ri-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-family: inherit;
  padding: 0;
}
.ri-btn:hover { background: rgba(255, 255, 255, 0.15); }
.ri-input {
  width: 40px;
  text-align: center;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  outline: none;
}
.recurring-dropdown {
  position: relative;
  flex: 1;
  min-width: 100px;
}
.rd-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  gap: 8px;
}
.rd-trigger:hover { background: rgba(255, 255, 255, 0.14); }
.rd-trigger svg { opacity: 0.75; flex-shrink: 0; }
.rd-menu {
  position: fixed;
  padding: 6px;
  border-radius: 14px;
  background: rgba(var(--glass-rgba, 255, 255, 255), var(--glass-opacity, 0.28)) !important;
  backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  border: 1px solid var(--dash-glass-border, rgba(255, 255, 255, 0.28)) !important;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: none !important;
  overflow: visible !important;
  transform: translateZ(0);
}
.rd-menu.hidden { display: none !important; }
.rd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  text-align: right;
  width: 100%;
}
.rd-item:hover { background: rgba(255, 255, 255, 0.14); }
.rd-item.active { background: rgba(59, 130, 246, 0.3); color: #fff; }
.recurring-divider {
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  margin: 6px 0;
}
.recur-weekdays {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.recur-pill-day {
  padding: 10px 6px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}
.recur-pill-day:hover { background: rgba(255, 255, 255, 0.14); }
.recur-pill-day.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.45);
}
.recur-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.recur-pill-num {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}
.recur-pill-num:hover { background: rgba(255, 255, 255, 0.14); }
.recur-pill-num.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.45);
}
.recur-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.recur-pill-month {
  padding: 10px 6px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.recur-pill-month:hover { background: rgba(255, 255, 255, 0.14); }
.recur-pill-month.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.45);
}
.recurring-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.recur-btn-cancel,
.recur-btn-confirm {
  flex: 1;
  padding: 11px;
  border-radius: 13px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.recur-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.recur-btn-cancel:hover { background: rgba(255, 255, 255, 0.16); }
.recur-btn-confirm {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
}
.recur-btn-confirm:hover { background: #2563eb; }
.recurring-actions.has-clear {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.recurring-actions.has-clear .recur-btn-confirm {
  grid-column: span 2;
  order: -1;
}
.recur-btn-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border-radius: 13px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  transition: all 0.2s;
}
.recur-btn-clear:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

/* ============================================================
   Edit Task Modal
============================================================ */
.edit-task-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  background: rgba(10, 15, 30, 0.35) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  animation: editFadeIn 0.2s ease;
}
.edit-task-overlay.hidden { display: none !important; }
@keyframes editFadeIn { from { opacity: 0; } to { opacity: 1; } }
.edit-task-modal {
  width: 100%;
  max-width: 520px;
  max-height: 95vh;
  padding: 22px 20px 18px;
  border-radius: 24px;
  background: rgba(var(--glass-rgba, 255, 255, 255), var(--glass-opacity, 0.28)) !important;
  backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 16px)) saturate(180%) !important;
  border: 1px solid var(--dash-glass-border, rgba(255, 255, 255, 0.28)) !important;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc;
  direction: rtl;
  position: relative;
  animation: editScaleIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  transform: translateZ(0);
  overflow-y: auto;
  scrollbar-width: none;
}
.edit-task-modal::-webkit-scrollbar { display: none; width: 0; height: 0; }
@keyframes editScaleIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.edit-task-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}
.edit-task-close:hover { background: rgba(239, 68, 68, 0.6); color: #fff; }
.edit-task-title {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  color: #fff;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.edit-task-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.edit-task-title-input,
.edit-task-desc-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 12px;
  padding: 11px 14px;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.edit-task-title-input::placeholder,
.edit-task-desc-input::placeholder { color: rgba(255, 255, 255, 0.45); }
.edit-task-title-input:focus,
.edit-task-desc-input:focus {
  border-color: rgba(59, 130, 246, 0.6) !important;
  background: rgba(255, 255, 255, 0.14) !important;
}
.edit-task-desc-input {
  resize: none !important;
  min-height: 80px;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: none;
}
.edit-task-desc-input::-webkit-scrollbar { display: none; width: 0; height: 0; }
.edit-task-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 0;
  margin-bottom: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.edit-task-toolbar .tn-icon {
  width: auto !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 10px !important;
  gap: 5px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
  flex-shrink: 0 !important;
}
.edit-task-toolbar .tn-icon:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}
.edit-task-toolbar .tn-icon.active {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
  color: #3b82f6 !important;
}
.edit-task-toolbar .tn-icon .tn-label {
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  font-family: inherit;
}
.edit-task-toolbar .tn-icon svg { flex-shrink: 0; }
.edit-task-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.edit-task-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border-radius: 13px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.edit-task-btn-delete {
  flex: 0 0 auto;
  min-width: 100px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.edit-task-btn-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}
.edit-task-btn-save {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}
.edit-task-btn-save:hover { background: #2563eb; }

/* ============================================================
   Undo Toast
============================================================ */
.abner-undo-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 99999999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 340px;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(var(--glass-rgba, 255, 255, 255), var(--glass-opacity, 0.15)) !important;
  backdrop-filter: blur(var(--dash-blur-px, 20px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 20px)) saturate(180%) !important;
  border: 1px solid var(--dash-glass-border, rgba(255, 255, 255, 0.28)) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  direction: rtl;
  pointer-events: none;
}
.abner-undo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.undo-toast-message {
  flex: 1;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.undo-toast-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.undo-toast-action:hover {
  background: rgba(59, 130, 246, 0.32);
  color: #fff;
}
.undo-toast-action svg { flex-shrink: 0; }
.undo-toast-key {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ============================================================
   Sync Status Badge
============================================================ */
.sync-status-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.sync-status-badge.visible { display: inline-flex; }
.sync-status-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fbbf24;
  animation: syncPulse 1.2s infinite;
}
@keyframes syncPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============================================================
   تم لایت
============================================================ */
body.theme-light #abnerTaskModule .tab-btn { color: rgba(42, 31, 20, 0.65) !important; }
body.theme-light #abnerTaskModule .tab-btn.active { color: #fff !important; }
body.theme-light #abnerTaskModule .task-tabs { background: rgba(0, 0, 0, 0.06) !important; }
body.theme-light #abnerTaskModule .task-action-bar .min-icon-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: rgba(42, 31, 20, 0.75) !important;
}
body.theme-light #abnerTaskModule .tes-title { color: #2a1f14 !important; }
body.theme-light #abnerTaskModule .tes-sub { color: rgba(42, 31, 20, 0.6) !important; }
body.theme-light #abnerTaskModule .tes-suggestions li { color: rgba(42, 31, 20, 0.7) !important; }
body.theme-light #abnerTaskModule .ti-title { color: #2a1f14 !important; }
body.theme-light #abnerTaskModule .ti-desc { color: rgba(42, 31, 20, 0.65) !important; }
body.theme-light #abnerTaskModule .task-item {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
body.theme-light #abnerTaskModule .ti-check {
  border-color: rgba(0, 0, 0, 0.25) !important;
  color: #2a1f14 !important;
}
body.theme-light #abnerTaskModule .ti-action {
  color: #2a1f14 !important;
  background: rgba(255, 255, 255, 0.85) !important;
}
body.theme-light #abnerTaskModule input.tn-title,
body.theme-light #abnerTaskModule .tn-desc { color: #2a1f14 !important; }
body.theme-light #abnerTaskModule input.tn-title::placeholder { color: rgba(42, 31, 20, 0.4) !important; }
body.theme-light #abnerTaskModule .tn-desc::placeholder { color: rgba(42, 31, 20, 0.3) !important; }
body.theme-light #abnerTaskModule .task-new-input-wrap {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
body.theme-light #abnerTaskModule .tn-icon {
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: rgba(42, 31, 20, 0.7) !important;
}
body.theme-light #abnerTaskModule .ti-badge.prio {
  background: rgba(100, 116, 139, 0.12) !important;
  color: #475569 !important;
}
body.theme-light #abnerTaskModule .ti-badge.due,
body.theme-light #abnerTaskModule .ti-badge.time {
  background: rgba(37, 99, 235, 0.1) !important;
  color: #2563eb !important;
}
body.theme-light #abnerTaskModule .ti-badge.recur {
  background: rgba(124, 58, 237, 0.1) !important;
  color: #7c3aed !important;
}
body.theme-light .tasks-inline-popover {
  background: rgba(255, 252, 245, var(--glass-opacity, 0.28)) !important;
  border-color: rgba(120, 90, 50, 0.22) !important;
  color: #2a1f14 !important;
}
body.theme-light .ip-title { color: rgba(42, 31, 20, 0.65); border-bottom-color: rgba(0, 0, 0, 0.08); }
body.theme-light .ip-item { color: #2a1f14; }
body.theme-light .ip-item:hover { background: rgba(0, 0, 0, 0.06); }
body.theme-light .ip-tag-row:hover { background: rgba(0, 0, 0, 0.05); }
body.theme-light .ip-tag-name { color: #2a1f14; }
body.theme-light .ip-tag-del { color: rgba(0, 0, 0, 0.4); }
body.theme-light .ip-tag-add-row { border-color: rgba(0, 0, 0, 0.2); background: rgba(0, 0, 0, 0.02); }
body.theme-light .ip-tag-add-input { color: #2a1f14; }
body.theme-light .ip-tag-add-input::placeholder { color: rgba(42, 31, 20, 0.4); }
body.theme-light .tp-label { color: rgba(42, 31, 20, 0.7); }
body.theme-light .tp-item { color: rgba(42, 31, 20, 0.35); }
body.theme-light .tp-item.active { color: #2a1f14; }
body.theme-light .dp-title { color: #2a1f14; text-shadow: none; }
body.theme-light .dp-nav {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #2a1f14;
}
body.theme-light .dp-wd { color: rgba(42, 31, 20, 0.55); }
body.theme-light .dp-cell { color: #2a1f14; }
body.theme-light .dp-cell:hover:not(.dp-empty) { background: rgba(0, 0, 0, 0.06); }
body.theme-light .dp-cell.dp-today { color: #2563eb; }
body.theme-light .dp-btn-today {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #2a1f14;
}
body.theme-light .task-panel-pop {
  background: rgba(255, 252, 245, var(--glass-opacity, 0.28)) !important;
  border-color: rgba(120, 90, 50, 0.22) !important;
  color: #2a1f14 !important;
}
body.theme-light .task-panel-pop .tp-more-item:hover { background: rgba(0, 0, 0, 0.06) !important; }
body.theme-light .task-panel-pop .tp-section { border-color: rgba(0, 0, 0, 0.08) !important; }
body.theme-light .task-panel-pop .tp-section-title { color: rgba(42, 31, 20, 0.6) !important; }
body.theme-light .task-panel-pop .tp-divider { background: rgba(0, 0, 0, 0.1) !important; }
body.theme-light .task-panel-pop .tp-checkbox,
body.theme-light .task-panel-pop .tp-radio { border-color: rgba(0, 0, 0, 0.3) !important; }
body.theme-light .task-panel-pop .tp-chip {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: rgba(42, 31, 20, 0.8) !important;
}
body.theme-light .recurring-modal {
  background: rgba(255, 252, 245, var(--glass-opacity, 0.28)) !important;
  border-color: rgba(120, 90, 50, 0.22) !important;
  color: #2a1f14 !important;
}
body.theme-light .recurring-title {
  color: #2a1f14;
  border-bottom-color: rgba(0, 0, 0, 0.1);
  text-shadow: none;
}
body.theme-light .recurring-label { color: #2a1f14; text-shadow: none; }
body.theme-light .recurring-divider { border-top-color: rgba(0, 0, 0, 0.12); }
body.theme-light .recurring-interval-wrap,
body.theme-light .rd-trigger {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #2a1f14;
}
body.theme-light .ri-btn { color: #2a1f14; }
body.theme-light .ri-btn:hover { background: rgba(0, 0, 0, 0.06); }
body.theme-light .ri-input { color: #2a1f14; }
body.theme-light .rd-menu {
  background: rgba(255, 252, 245, var(--glass-opacity, 0.28)) !important;
  border-color: rgba(120, 90, 50, 0.22) !important;
}
body.theme-light .rd-item { color: #2a1f14; }
body.theme-light .rd-item:hover { background: rgba(0, 0, 0, 0.06); }
body.theme-light .recur-pill-day,
body.theme-light .recur-pill-num,
body.theme-light .recur-pill-month {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: #2a1f14;
}
body.theme-light .recur-btn-cancel {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #2a1f14;
}
body.theme-light .recur-btn-clear {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}
body.theme-light .edit-task-modal {
  background: rgba(255, 252, 245, var(--glass-opacity, 0.28)) !important;
  border-color: rgba(120, 90, 50, 0.22) !important;
  color: #2a1f14 !important;
}
body.theme-light .edit-task-title {
  color: #2a1f14;
  border-bottom-color: rgba(0, 0, 0, 0.1);
  text-shadow: none;
}
body.theme-light .edit-task-close {
  background: rgba(0, 0, 0, 0.06);
  color: #2a1f14;
}
body.theme-light .edit-task-title-input,
body.theme-light .edit-task-desc-input {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #2a1f14 !important;
}
body.theme-light .edit-task-title-input::placeholder,
body.theme-light .edit-task-desc-input::placeholder { color: rgba(42, 31, 20, 0.4); }
body.theme-light .edit-task-toolbar { border-color: rgba(0, 0, 0, 0.08); }
body.theme-light .edit-task-toolbar .tn-icon {
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: rgba(42, 31, 20, 0.7) !important;
}
body.theme-light .edit-task-btn-delete {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}
body.theme-light .abner-undo-toast {
  background: rgba(255, 252, 245, 0.55) !important;
  backdrop-filter: blur(var(--dash-blur-px, 20px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 20px)) saturate(180%) !important;
  border-color: rgba(120, 90, 50, 0.25) !important;
  color: #2a1f14 !important;
  box-shadow:
    0 12px 40px rgba(80, 50, 20, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
body.theme-light .undo-toast-message { text-shadow: none; }
body.theme-light .undo-toast-action {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.35);
}
body.theme-light .undo-toast-action:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #1d4ed8;
}
body.theme-light .undo-toast-key {
  background: rgba(0, 0, 0, 0.08);
  color: #2a1f14;
}

/* ============================================================
   تم دارک
============================================================ */
body.theme-dark .tasks-inline-popover,
body.theme-dark .task-panel-pop,
body.theme-dark .rd-menu {
  background: rgba(15, 23, 42, var(--glass-opacity, 0.5)) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
body.theme-dark .recurring-modal {
  background: rgba(15, 23, 42, var(--glass-opacity, 0.5)) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
body.theme-dark .edit-task-modal {
  background: rgba(15, 23, 42, var(--glass-opacity, 0.5)) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
body.theme-dark .abner-undo-toast {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
body.theme-dark #abnerTaskModule .ti-action {
  background: rgba(0, 0, 0, 0.55) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================
   موبایل
============================================================ */
@media (max-width: 1024px) {
  #abnerTaskModule { padding: 14px !important; }
  #abnerTaskModule .ti-title { font-size: 13px !important; }
  #abnerTaskModule input.tn-title { font-size: 13px !important; }
  #abnerTaskModule .task-new-input-wrap .tn-icon { min-width: 28px !important; height: 30px !important; padding: 0 8px !important; }
  #abnerTaskModule .task-new-input-wrap .tn-icon .tn-label { font-size: 10.5px; }
  #abnerTaskModule .tn-submit { width: 32px !important; height: 32px !important; min-width: 32px !important; }
  .task-panel-pop { min-width: 220px !important; max-width: calc(100vw - 20px) !important; }
  .edit-task-modal { padding: 18px 16px 14px; max-width: 460px; }
  .edit-task-title { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; }
  .edit-task-toolbar .tn-icon { min-width: 32px !important; height: 32px !important; padding: 0 8px !important; }
  .edit-task-toolbar .tn-icon .tn-label { font-size: 10.5px; }
  .abner-undo-toast { bottom: 80px; min-width: 300px; font-size: 13px; padding: 12px 14px; }
  .undo-toast-message { font-size: 13px; }
}

@media (max-width: 480px) {
  .tasks-inline-popover {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
  .date-picker-popover,
  .time-picker-popover { width: calc(100vw - 24px) !important; }
  .tp-cols { height: 160px; }
  .tp-item { height: 32px; min-height: 32px; font-size: 15px; }
  .tp-item.active { font-size: 19px; }
  .tp-scroll { padding: 64px 0; }
  .dp-cell { font-size: 11.5px; border-radius: 8px; }
  .dp-wd { font-size: 9px; }
  .dp-actions { flex-direction: column; }
  .dp-btn { min-width: 0; }
  .ip-tag-list { max-height: 180px; }
  .recurring-overlay { padding: 12px !important; align-items: flex-start !important; padding-top: 30px !important; }
  .recurring-modal { padding: 18px 14px 14px; border-radius: 20px; max-width: none; }
  .recurring-title { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; }
  .recurring-row { flex-wrap: wrap; gap: 8px; }
  .recurring-label { font-size: 12px; }
  .recur-weekdays { grid-template-columns: repeat(2, 1fr); }
  .recur-days-grid { gap: 4px; }
  .recur-pill-num { font-size: 11px; }
  .recur-pill-month { font-size: 11px; padding: 8px 4px; }
  .recur-btn-cancel, .recur-btn-confirm { font-size: 13px; padding: 10px; }
  .recurring-actions.has-clear { grid-template-columns: 1fr; }
  .recurring-actions.has-clear .recur-btn-confirm { grid-column: span 1; }
  .edit-task-overlay { padding: 10px !important; align-items: flex-start !important; padding-top: 20px !important; }
  .edit-task-modal { padding: 16px 12px 12px; border-radius: 20px; max-width: none; }
  .edit-task-title { font-size: 15px; }
  .edit-task-actions { flex-direction: column-reverse; }
  .edit-task-btn-delete { min-width: 0; width: 100%; }
  .abner-undo-toast {
    bottom: 76px;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    width: calc(100vw - 24px);
    padding: 12px;
  }
  .undo-toast-message { font-size: 13px; text-align: center; width: 100%; }
  .undo-toast-action { width: 100%; justify-content: center; }
}
