:root {
  --wpjmap-todo-bg: rgba(255, 255, 255, 0.75);
  --wpjmap-todo-bg-2: rgba(255, 255, 255, 0.55);
  --wpjmap-todo-border: rgba(15, 23, 42, 0.10);
  --wpjmap-todo-text: rgba(15, 23, 42, 0.92);
  --wpjmap-todo-muted: rgba(15, 23, 42, 0.62);
  --wpjmap-todo-shadow: 0 18px 55px rgba(2, 6, 23, 0.08);
  --wpjmap-todo-radius: 18px;
  --wpjmap-todo-radius-sm: 12px;
  --wpjmap-todo-gap: 12px;
  --wpjmap-todo-focus: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.wpjmap-todo {
  margin-top: 22px;
  border: 1px solid var(--wpjmap-todo-border);
  border-radius: var(--wpjmap-todo-radius);
  background: var(--wpjmap-todo-bg);
  box-shadow: var(--wpjmap-todo-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.wpjmap-todo * {
  box-sizing: border-box;
}

.wpjmap-todo__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 10px;
}

.wpjmap-todo__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--wpjmap-todo-text);
}

.wpjmap-todo__subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--wpjmap-todo-muted);
}

.wpjmap-todo__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.wpjmap-todo__btn {
  border: 1px solid var(--wpjmap-todo-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--wpjmap-todo-text);
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}

.wpjmap-todo__btn:hover {
  background: rgba(255, 255, 255, 0.92);
}

.wpjmap-todo__btn:active {
  transform: translateY(1px);
}

.wpjmap-todo__btn:focus-visible {
  outline: none;
  box-shadow: var(--wpjmap-todo-focus);
}

.wpjmap-todo__btn--primary {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
}

.wpjmap-todo__btn--primary:hover {
  background: rgba(59, 130, 246, 0.18);
}

.wpjmap-todo__btn--ghost {
  background: rgba(255, 255, 255, 0.35);
}

.wpjmap-todo__btn--danger {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
}

.wpjmap-todo__btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.wpjmap-todo__btn--soft {
  border-color: rgba(100, 116, 139, 0.20);
  background: rgba(100, 116, 139, 0.08);
}

.wpjmap-todo__btn.is-disabled,
.wpjmap-todo.is-loading .wpjmap-todo__btn,
.wpjmap-todo.is-loading input,
.wpjmap-todo.is-loading select {
  opacity: 0.65;
  pointer-events: none;
}

/* Tools bar */
.wpjmap-todo__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 14px;
}

.wpjmap-todo__toolsleft,
.wpjmap-todo__toolsright {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wpjmap-todo__search {
  position: relative;
}

.wpjmap-todo__search input {
  width: min(360px, 55vw);
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--wpjmap-todo-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--wpjmap-todo-text);
  font-size: 13px;
}

.wpjmap-todo__search input:focus-visible {
  outline: none;
  box-shadow: var(--wpjmap-todo-focus);
}

.wpjmap-todo__searchicon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  font-size: 14px;
  pointer-events: none;
}

.wpjmap-todo__seg {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--wpjmap-todo-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  gap: 4px;
}

.wpjmap-todo__seg button {
  border: 0;
  background: transparent;
  color: var(--wpjmap-todo-muted);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
}

.wpjmap-todo__seg button[aria-pressed="true"] {
  background: rgba(15, 23, 42, 0.07);
  color: var(--wpjmap-todo-text);
}

.wpjmap-todo__seg button:focus-visible {
  outline: none;
  box-shadow: var(--wpjmap-todo-focus);
}

/* Composer */
.wpjmap-todo__composer {
  display: flex;
  gap: var(--wpjmap-todo-gap);
  align-items: center;
  padding: 0 18px 16px;
}

.wpjmap-todo__field {
  min-width: 140px;
}

.wpjmap-todo__field--grow {
  flex: 1;
  min-width: 240px;
}

.wpjmap-todo input[type="text"],
.wpjmap-todo select {
  width: 100%;
  border: 1px solid var(--wpjmap-todo-border);
  border-radius: 999px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--wpjmap-todo-text);
  font-size: 13px;
}

.wpjmap-todo select {
  padding-right: 32px;
}

.wpjmap-todo input[type="text"]:focus-visible,
.wpjmap-todo select:focus-visible {
  outline: none;
  box-shadow: var(--wpjmap-todo-focus);
}

/* Meta bar */
.wpjmap-todo__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 0;
  color: var(--wpjmap-todo-muted);
  font-size: 12.5px;
}

.wpjmap-todo__count strong {
  color: var(--wpjmap-todo-text);
  font-weight: 600;
}

/* List */
.wpjmap-todo__list {
  list-style: none;
  margin: 0;
  padding: 14px 14px 16px;
}

.wpjmap-todo__empty {
  margin: 0 18px 18px;
  padding: 16px;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  border-radius: var(--wpjmap-todo-radius-sm);
  background: rgba(255, 255, 255, 0.4);
  color: var(--wpjmap-todo-muted);
  font-size: 13px;
}

.wpjmap-todo__item {
  display: grid;
  grid-template-columns: 26px 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  margin: 0 0 10px;
  border: 1px solid var(--wpjmap-todo-border);
  border-radius: var(--wpjmap-todo-radius-sm);
  background: rgba(255, 255, 255, 0.7);
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}

.wpjmap-todo__item:hover {
  background: rgba(255, 255, 255, 0.88);
}

.wpjmap-todo__item.is-dragging {
  opacity: 0.72;
  transform: scale(0.995);
}

.wpjmap-todo__item.is-drop-target {
  border-color: rgba(59, 130, 246, 0.35);
}

.wpjmap-todo__drag {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.65);
  cursor: grab;
  user-select: none;
}

.wpjmap-todo__drag:active {
  cursor: grabbing;
}

/* Checkbox */
.wpjmap-todo__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.wpjmap-todo__check input {
  position: absolute;
  opacity: 0;
}

.wpjmap-todo__checkui {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  background: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wpjmap-todo__check input:focus-visible + .wpjmap-todo__checkui {
  outline: none;
  box-shadow: var(--wpjmap-todo-focus);
}

.wpjmap-todo__check input:checked + .wpjmap-todo__checkui {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.14);
}

.wpjmap-todo__check input:checked + .wpjmap-todo__checkui:before {
  content: "✓";
  font-size: 12px;
  line-height: 1;
  color: rgba(15, 23, 42, 0.85);
}

/* Content */
.wpjmap-todo__content {
  min-width: 0;
}

.wpjmap-todo__line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wpjmap-todo__task {
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--wpjmap-todo-text);
  font-weight: 520;
}

.wpjmap-todo__meta2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.wpjmap-todo__byline {
  font-size: 12.5px;
  color: var(--wpjmap-todo-muted);
}

/* Chips */
.wpjmap-todo__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: var(--wpjmap-todo-text);
  font-size: 12px;
  line-height: 1;
}

.wpjmap-todo__chip--urgency {
  cursor: pointer;
  user-select: none;
}

.wpjmap-todo__chip--urgency:focus-visible {
  outline: none;
  box-shadow: var(--wpjmap-todo-focus);
}

.wpjmap-todo__chip--urgency[data-u="low"] {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.08);
}

.wpjmap-todo__chip--urgency[data-u="normal"] {
  border-color: rgba(100, 116, 139, 0.22);
  background: rgba(100, 116, 139, 0.08);
}

.wpjmap-todo__chip--urgency[data-u="high"] {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.10);
}

.wpjmap-todo__chip--urgency[data-u="critical"] {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.10);
}

.wpjmap-todo__chipdot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.65;
}

/* Row actions */
.wpjmap-todo__rowactions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.wpjmap-todo__icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--wpjmap-todo-border);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.75);
  transition: background 160ms ease, transform 120ms ease;
}

.wpjmap-todo__icon:hover {
  background: rgba(255, 255, 255, 0.85);
}

.wpjmap-todo__icon:active {
  transform: translateY(1px);
}

.wpjmap-todo__icon:focus-visible {
  outline: none;
  box-shadow: var(--wpjmap-todo-focus);
}

.wpjmap-todo__icon[data-todo-delete] {
  border-color: rgba(239, 68, 68, 0.22);
}

.wpjmap-todo__icon[data-todo-delete]:hover {
  background: rgba(239, 68, 68, 0.10);
}

/* Completed */
.wpjmap-todo__item.is-completed {
  opacity: 0.72;
}

.wpjmap-todo__item.is-completed .wpjmap-todo__task {
  text-decoration: line-through;
  color: rgba(15, 23, 42, 0.62);
}

/* Inline editor */
.wpjmap-todo__edit {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.wpjmap-todo__edit input[type="text"] {
  border-radius: 12px;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.85);
}

.wpjmap-todo__edit .wpjmap-todo__btn {
  padding: 9px 10px;
}

/* Toasts */
.wpjmap-toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
}

.wpjmap-toast {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.10);
  color: var(--wpjmap-todo-text);
  font-size: 13px;
  max-width: min(420px, 80vw);
  animation: wpjmap-toast-in 160ms ease-out;
}

.wpjmap-toast--error {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.10);
}

.wpjmap-toast.is-leaving {
  animation: wpjmap-toast-out 220ms ease-in forwards;
}

@keyframes wpjmap-toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes wpjmap-toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(10px);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 820px) {
  .wpjmap-todo__header {
    flex-direction: column;
    align-items: stretch;
  }

  .wpjmap-todo__tools {
    flex-direction: column;
    align-items: stretch;
  }

  .wpjmap-todo__search input {
    width: 100%;
  }

  .wpjmap-todo__composer {
    flex-direction: column;
    align-items: stretch;
  }

  .wpjmap-todo__field {
    min-width: 0;
  }

  .wpjmap-todo__item {
    grid-template-columns: 26px 28px 1fr;
  }

  .wpjmap-todo__rowactions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 8px;
  }
}
/* Inline editor (used by JS) */
.wpjmap-todo__inline {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.wpjmap-todo__inlineinput {
  flex: 1;
  min-width: 220px;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  background: rgba(255, 255, 255, 0.85) !important;
}

.wpjmap-todo__inlineactions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
/* ------------------------------------------------------------------
   THEME OVERRIDE SAFETY
   Prevent host theme accent color from leaking into To-Do UI
------------------------------------------------------------------- */

/* Text selection inside todo should look neutral */
.wpjmap-todo ::selection {
  background: rgba(0, 122, 255, 0.18) !important;
  color: inherit !important;
}

/* Reset aggressive theme styles */
.wpjmap-todo button,
.wpjmap-todo [role="tab"],
.wpjmap-todo a {
  background: none !important;
  color: inherit !important;
}

/* ------------------------------------------------------------------
   FILTERS (All / Active / Completed)
------------------------------------------------------------------- */

.wpjmap-todo__filter {
  background: #f3f4f6 !important;
  color: #374151 !important;
}

.wpjmap-todo__filter.is-active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
}

/* ------------------------------------------------------------------
   TASK TEXT (removes green highlight)
------------------------------------------------------------------- */

.wpjmap-todo__text {
  background: transparent !important;
  color: #111827 !important;
}

.wpjmap-todo__item.is-completed .wpjmap-todo__text {
  color: #6b7280 !important;
}

/* ------------------------------------------------------------------
   APPLICANT CHIP (right-hand green pill)
------------------------------------------------------------------- */

.wpjmap-todo__byline {
  background: #eef2ff !important;   /* subtle indigo */
  color: #3730a3 !important;
  border: 1px solid #c7d2fe !important;
}

.wpjmap-todo__byline:hover {
  background: #e0e7ff !important;
}

/* ------------------------------------------------------------------
   URGENCY CHIPS
------------------------------------------------------------------- */

.wpjmap-todo__chip--urgency[data-u="low"] {
  background: #ecfeff !important;
  color: #155e75 !important;
}

.wpjmap-todo__chip--urgency[data-u="normal"] {
  background: #f3f4f6 !important;
  color: #374151 !important;
}

.wpjmap-todo__chip--urgency[data-u="high"] {
  background: #fff7ed !important;
  color: #9a3412 !important;
}

.wpjmap-todo__chip--urgency[data-u="critical"] {
  background: #fef2f2 !important;
  color: #991b1b !important;
}

/* ------------------------------------------------------------------
   INLINE EDIT INPUT (prevents green glow/fill)
------------------------------------------------------------------- */

.wpjmap-todo__inlineinput {
  background: #ffffff !important;
  color: #111827 !important;
  border: 2px solid #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* ------------------------------------------------------------------
   AUTOCOMPLETE DROPDOWN
------------------------------------------------------------------- */

.wpjmap-todo__suggestions {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}

.wpjmap-todo__suggestion.is-active {
  background: #eff6ff !important;
  color: #1e3a8a !important;
}

/* ------------------------------------------------------------------
   CLEAR COMPLETED BUTTON
------------------------------------------------------------------- */

.wpjmap-todo__clear {
  background: #f9fafb !important;
  color: #374151 !important;
  border: 1px solid #e5e7eb !important;
}

.wpjmap-todo__clear:hover {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fecaca !important;
}
/* --- Autocomplete: anchor + overlay, no layout shifting --- */
.wpjmap-todo__field {
  position: relative !important;
}

.wpjmap-todo__suggestions {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  margin: 0 !important;
}

/* Ensure theme doesn't tint saved values */
.wpjmap-todo__text {
  background: transparent !important;
  color: #111827 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.wpjmap-todo__text:hover {
  text-decoration: underline !important;
}

.wpjmap-todo__byline {
  background: #eef2ff !important;
  color: #3730a3 !important;
  border: 1px solid #c7d2fe !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-weight: 600 !important;
}
.wpjmap-todo__byline:hover {
  background: #e0e7ff !important;
}

/* Filters: All / Active / Completed */
.wpjmap-todo__filter {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  padding: 6px 10px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.wpjmap-todo__filter.is-active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22) !important;
}

/* -------------------------------------------------------------
   Embedded WPJM User Emails "Triggers" (inside pipelines page)
-------------------------------------------------------------- */
.wpjmap-email-triggers {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.wpjmap-email-triggers__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.wpjmap-email-triggers__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
	display: none;
}

.wpjmap-email-triggers__sub {
  margin: 0;
  font-size: 13px;
  opacity: 0.7;
	display: none;
}

/* Hide WPJMUE header + nav when embedded here */
.wpjmap-email-triggers .wpjmue-emails-header,
.wpjmap-email-triggers .wpjmue-emails-nav {
  display: none !important;
}

/* Remove extra padding around the WPJMUE panel if needed */
.wpjmap-email-triggers .wpjmue-emails-panel {
  padding-top: 0 !important;
}
