/* ─────────────────────────────────────────────────────────────
   Concentus Dashboard
   File:    styles--components-tasks-additions.css
   Version: 2026-05-06 v5
   Batch:   BF
   Build:   BUILD_TIMESTAMP

   BF additions vs BD v4:
   - .tasks-help-icon — small "?" button next to the card title.
   - .tasks-helptip — body-anchored multi-section explainer popover,
     same visual pattern as .idate-helptip (Important Dates). Cloned
     here under the tasks- prefix to keep card-level CSS isolated;
     a future pass can factor both into a shared `.card-helptip` if
     a third card adopts this pattern.
   - .tasks-helptip-video — gradient video tutorial CTA at the bottom
     of the tooltip; opens the Box-hosted walkthrough in a new tab.

   BD additions vs BA-lite v3:
   - .tasks-checklist-callout — yellow callout block above the
     completion banner. Holds heading, subtitle, items list, footer-strip.
   - .tasks-checklist-callout.complete — green-tinted variant for the
     post-completion auto-jump state.
   - .tasks-checklist-items + .tasks-checklist-checkbox + .tasks-checklist-required
     — checklist item rendering (3 status states + required-asterisk).
   - .tasks-checklist-footer-strip — bottom strip inside callout that
     holds the read-only message + Refresh task button (only visible
     in B-fresh state).
   - .tasks-checklist-refresh-btn — orange-bordered refresh button
     with spin animation when active.
   - .tasks-btn-pending — grey "Waiting for Salesforce…" disabled state.
   - .tasks-btn-disabled-readonly — grey disabled state for Save button
     during read-only mode.
   - .tasks-btn-complete-sf — navy "↗ Continue in Salesforce" variant.
   - Disabled field styling for the read-only state during B-fresh.

   BA-lite v3 (carryover): completion banner; footer wrap; close-task link;
     completed-done button state; discard-changes overlay.
   ───────────────────────────────────────────────────────────── */

/* All variables and rules are scoped under .tasks-card (or .tasks-card descendant
   selectors) to prevent collisions with other cards. The grid-template variable is
   set on the .tasks-card element itself by JS, so column resize/reorder are
   isolated to this card. */

.tasks-card {
  --tasks-col-checkbox: 38px;
  --tasks-col-subject: 1fr;
  --tasks-col-contact: 220px;
  --tasks-col-status: 110px;
  --tasks-col-working: 100px;
  --tasks-col-checkin: 100px;
  --tasks-col-due: 100px;
  --tasks-col-owner: 140px;
  --tasks-col-delegatedby: 140px;
  --tasks-col-actions: 44px;
  --tasks-grid-template: var(--tasks-col-checkbox) var(--tasks-col-subject) var(--tasks-col-contact) var(--tasks-col-working) var(--tasks-col-checkin) var(--tasks-col-due) var(--tasks-col-actions);

  --tasks-row-hover: #f8fafc;
  --tasks-row-selected: #eef4ff;
  --tasks-pill-bg: #eef2ff;
  --tasks-pill-text: #3730a3;
}

.tasks-card .hidden { display: none !important; }

/* ── Card header — live-dot and count-chip removed in AZ ────────────────
   The card header is now just title + meta. No status/count adornments. */

/* ── View tabs ────────────────────────────────────────────────────────── */
.tasks-card .tasks-view-tabs {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fff; padding: 0 18px; gap: 4px;
}
.tasks-card .tasks-view-tab {
  background: transparent; border: none;
  color: #6b7280; font-size: 13px; font-weight: 600;
  padding: 12px 14px; cursor: pointer; font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.tasks-card .tasks-view-tab:hover { color: #00247f; }
.tasks-card .tasks-view-tab.active { color: #00247f; border-bottom-color: #00247f; }
.tasks-card .tasks-view-tab .tasks-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 6px;
  background: #f3f4f6; color: #6b7280;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.tasks-card .tasks-view-tab.active .tasks-tab-count { background: #00247f; color: #fff; }

/* ── Controls bar (filter pills + search + new + cols) ────────────────── */
.tasks-card .tasks-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fafbff;
}
.tasks-card .tasks-filter-pills { display: flex; gap: 6px; }
.tasks-card .tasks-pill {
  background: #fff; border: 1px solid var(--border, #e5e7eb); color: #6b7280;
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit;
}
.tasks-card .tasks-pill:hover { border-color: #00247f; color: #00247f; }
.tasks-card .tasks-pill.active { background: #00247f; color: #fff; border-color: #00247f; }
.tasks-card .tasks-pill .tasks-pill-count { background: rgba(255,255,255,0.25); padding: 1px 6px; border-radius: 999px; font-size: 10.5px; }
.tasks-card .tasks-pill:not(.active) .tasks-pill-count { background: #f3f4f6; color: #6b7280; }
.tasks-card .tasks-controls-right { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }

/* ── Search ───────────────────────────────────────────────────────────── */
.tasks-card .tasks-search-wrap { position: relative; }
.tasks-card .tasks-search {
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  padding: 6px 28px 6px 30px; font-size: 12.5px; width: 220px;
  outline: none; transition: border 0.15s; font-family: inherit;
}
.tasks-card .tasks-search:focus { border-color: #00247f; }
.tasks-card .tasks-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #6b7280; padding: 3px 6px;
  font-size: 16px; line-height: 1; border-radius: 3px;
  font-family: inherit;
}
.tasks-card .tasks-search-clear:hover { color: #dc2626; background: #fee2e2; }
.tasks-card .tasks-search-wrap::before {
  content: ''; position: absolute; left: 9px; top: 50%; width: 14px; height: 14px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain; pointer-events: none;
}

/* ── New Task button ──────────────────────────────────────────────────── */
.tasks-card .tasks-new-btn {
  background: #db9523; color: #fff; border: none; border-radius: 8px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: background 0.15s; font-family: inherit;
}
.tasks-card .tasks-new-btn:hover { background: #b87a18; }

/* ── Columns popover button ───────────────────────────────────────────── */
.tasks-card .tasks-cols-btn {
  background: #fff; color: #6b7280; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; padding: 6px 8px; cursor: pointer;
  transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.tasks-card .tasks-cols-btn:hover { border-color: #00247f; color: #00247f; }
.tasks-card .tasks-cols-btn.open { background: #00247f; color: #fff; border-color: #00247f; }

/* Refresh button (AZ) — same shape as cols btn for visual consistency */
.tasks-card .tasks-refresh-btn {
  background: #fff; color: #6b7280; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; padding: 6px 8px; cursor: pointer;
  display: inline-flex; align-items: center; font-family: inherit;
  transition: all 0.15s;
}
.tasks-card .tasks-refresh-btn:hover { border-color: #00247f; color: #00247f; }
.tasks-card .tasks-refresh-btn:disabled { opacity: 0.5; cursor: wait; }
.tasks-card .tasks-refresh-btn.spinning svg { animation: tasksSpin 0.7s linear infinite; }
@keyframes tasksSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.tasks-card .tasks-cols-popover {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 50; display: none; min-width: 240px;
}
.tasks-card .tasks-cols-popover.open { display: block; }
.tasks-card .tasks-cols-popover-title {
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.tasks-card .tasks-cols-popover-title em { font-style: normal; color: #00247f; text-transform: none; font-size: 11.5px; }
.tasks-card .tasks-cols-popover label {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 12.5px; cursor: pointer; color: #1a1a1a;
}
.tasks-card .tasks-cols-popover label.locked { color: #6b7280; cursor: not-allowed; }
.tasks-card .tasks-cols-popover label .tasks-locked-tag { margin-left: auto; font-size: 10px; color: #6b7280; font-style: italic; }
.tasks-card .tasks-cols-popover input[type=checkbox] { accent-color: #00247f; cursor: pointer; }
.tasks-card .tasks-cols-popover input[type=checkbox]:disabled { cursor: not-allowed; }
.tasks-card .tasks-cols-reset {
  display: block; width: 100%;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border, #e5e7eb);
  background: none; border-left: none; border-right: none; border-bottom: none;
  color: #3185fc; font-size: 11.5px; cursor: pointer; text-align: center; font-family: inherit;
}
.tasks-card .tasks-cols-reset:hover { text-decoration: underline; }

/* ── Bulk action bar ──────────────────────────────────────────────────── */
.tasks-card .tasks-bulk-bar {
  display: none; align-items: center; gap: 10px;
  padding: 9px 18px; background: #1a3a8c; color: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb); font-size: 12.5px;
}
.tasks-card .tasks-bulk-bar.show { display: flex; }
.tasks-card .tasks-bulk-count { font-weight: 700; }
.tasks-card .tasks-bulk-actions { display: flex; gap: 8px; align-items: center; }
.tasks-card .tasks-bulk-btn {
  background: rgba(255,255,255,0.15); color: #fff;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 6px;
  padding: 5px 11px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; font-family: inherit;
}
.tasks-card .tasks-bulk-btn:hover { background: rgba(255,255,255,0.28); }
.tasks-card .tasks-bulk-clear {
  margin-left: auto; background: transparent; color: rgba(255,255,255,0.85);
  border: none; cursor: pointer; font-size: 12px; font-family: inherit;
  text-decoration: underline;
}
.tasks-card .tasks-bulk-clear:hover { color: #fff; }
.tasks-card .tasks-bulk-dropdown { position: relative; }
.tasks-card .tasks-bulk-popover {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; color: #1a1a1a;
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 50; display: none; min-width: 240px;
}
.tasks-card .tasks-bulk-popover.open { display: block; }
.tasks-card .tasks-bulk-popover label {
  display: block; font-size: 11px; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px;
}
.tasks-card .tasks-bulk-popover select,
.tasks-card .tasks-bulk-popover input[type=date] {
  width: 100%; border: 1px solid var(--border, #e5e7eb); border-radius: 6px;
  padding: 6px 9px; font-size: 12.5px; margin-bottom: 8px;
  font-family: inherit; outline: none;
}
.tasks-card .tasks-bulk-apply {
  background: #00247f; color: #fff; border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  width: 100%; font-family: inherit;
}
.tasks-card .tasks-bulk-apply:hover { background: #1a3a8c; }

/* ── Table header ─────────────────────────────────────────────────────── */
.tasks-card .tasks-table-header {
  display: grid; grid-template-columns: var(--tasks-grid-template);
  align-items: center; background: #fafbff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.5px; user-select: none;
}
.tasks-card .tasks-th { position: relative; padding: 9px 12px; display: flex; align-items: center; gap: 6px; }
.tasks-card .tasks-th:first-child { padding-left: 18px; padding-right: 0; }
.tasks-card .tasks-th-grip { color: #c0c4cc; cursor: grab; display: inline-flex; align-items: center; flex-shrink: 0; }
.tasks-card .tasks-th-grip:hover { color: #00247f; }
.tasks-card .tasks-th-grip:active { cursor: grabbing; }
.tasks-card .tasks-th-label { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: color 0.15s; }
.tasks-card .tasks-th-label:hover { color: #00247f; }
.tasks-card .tasks-th-label.sorted { color: #00247f; }
.tasks-card .tasks-sort-arrow { display: inline-block; width: 0; height: 0; margin-left: 1px; opacity: 0.85; }
.tasks-card .tasks-sort-arrow.asc { border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid currentColor; }
.tasks-card .tasks-sort-arrow.desc { border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.tasks-card .tasks-th-resize { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 5; }
.tasks-card .tasks-th-resize:hover, .tasks-card .tasks-th-resize.dragging { background: #3185fc; opacity: 0.4; }

body.tasks-col-resizing { cursor: col-resize !important; }
body.tasks-col-resizing * { cursor: col-resize !important; user-select: none !important; }
body.tasks-col-dragging { cursor: grabbing !important; }

.tasks-card .tasks-th.dragging-col { opacity: 0.4; }
.tasks-card .tasks-th.drop-before::before { content: ''; position: absolute; left: -1px; top: 0; width: 3px; height: 100%; background: #db9523; z-index: 6; }
.tasks-card .tasks-th.drop-after::after  { content: ''; position: absolute; right: -1px; top: 0; width: 3px; height: 100%; background: #db9523; z-index: 6; }

.tasks-card .tasks-master-check { width: 17px; height: 17px; cursor: pointer; accent-color: #00247f; }

/* ── Task list / rows ─────────────────────────────────────────────────── */
.tasks-card .tasks-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 480px; overflow-y: auto;
}
.tasks-card .tasks-row {
  display: grid; grid-template-columns: var(--tasks-grid-template);
  align-items: center; padding: 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background 0.1s;
}
.tasks-card .tasks-row:hover { background: var(--tasks-row-hover); }
.tasks-card .tasks-row.selected { background: var(--tasks-row-selected); }
.tasks-card .tasks-row:hover .tasks-row-edit-btn { opacity: 1; }
.tasks-card .tasks-row > .tasks-cell { padding: 11px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-card .tasks-row > .tasks-cell:first-child { padding-left: 18px; padding-right: 0; }
.tasks-card .tasks-row-check { width: 17px; height: 17px; cursor: pointer; accent-color: #00247f; }

/* AZ: subject and contact links share the same blue — both are SF record hyperlinks */
.tasks-card .tasks-subject-link { font-size: 13px; font-weight: 500; color: #3185fc; text-decoration: none; cursor: pointer; }
.tasks-card .tasks-subject-link:hover { text-decoration: underline; }
.tasks-card .tasks-contact-link { color: #3185fc; text-decoration: none; font-size: 12.5px; cursor: pointer; }
.tasks-card .tasks-contact-link:hover { text-decoration: underline; }
.tasks-card .tasks-contact-link.is-account { color: #6b21a8; }
.tasks-card .tasks-none { color: #c0c4cc; font-style: italic; font-size: 12px; }

.tasks-card .tasks-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; width: fit-content;
}
.tasks-card .tasks-status-not-started { background: #f3f4f6; color: #4b5563; }
.tasks-card .tasks-status-in-progress { background: #dbeafe; color: #1e40af; }

/* AZ: date cells use default text color — every visible row is overdue or
   due-today by definition (the SOQL filter), so red+amber emphasis was just
   noise. Calendar dates render as plain text now. */
.tasks-card .tasks-date-cell { font-size: 12px; color: #1a1a1a; white-space: nowrap; }

.tasks-card .tasks-user-link { color: #1a1a1a; font-size: 12.5px; text-decoration: none; }
.tasks-card .tasks-user-link:hover { color: #00247f; text-decoration: underline; }
.tasks-card .tasks-user-link.is-me { color: #6b7280; font-style: italic; }

.tasks-card .tasks-row-edit-btn {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 5px; cursor: pointer; color: #6b7280; opacity: 0.4;
  transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center;
}
.tasks-card .tasks-row-edit-btn:hover { background: var(--tasks-pill-bg); color: #00247f; border-color: #00247f; opacity: 1 !important; }

.tasks-card .tasks-empty { text-align: center; padding: 40px 20px; color: #6b7280; font-size: 13px; }
.tasks-card .tasks-empty .tasks-emoji { font-size: 32px; margin-bottom: 8px; display: block; }

/* ── Loading state ────────────────────────────────────────────────────── */
.tasks-card .tasks-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 30px 20px; color: #6b7280; font-size: 13px;
}
.tasks-card .tasks-loading-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #e5e7eb; border-top-color: #00247f;
  animation: tasks-spin 0.8s linear infinite;
}
@keyframes tasks-spin { to { transform: rotate(360deg); } }

/* ── Modal ────────────────────────────────────────────────────────────── */
.tasks-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(2px);
}
.tasks-modal-overlay.open { display: flex; }
.tasks-modal {
  background: #fff; border-radius: 12px;
  width: 540px; max-width: calc(100vw - 40px); max-height: calc(100vh - 60px);
  overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.tasks-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border, #e5e7eb);
}
.tasks-modal-title { font-family: 'Noto Serif', Georgia, serif; font-size: 16px; color: #00247f; font-weight: 700; flex: 1; }

/* Header utility button (AZ) — Open in Salesforce moved here from footer */
.tasks-modal-utility {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f3f4f6; border: 1px solid var(--border, #e5e7eb); color: #4b5563;
  font-size: 11.5px; font-weight: 600; padding: 5px 11px;
  border-radius: 6px; cursor: pointer; text-decoration: none;
  font-family: inherit; transition: all 0.15s;
}
.tasks-modal-utility:hover { border-color: #00247f; color: #00247f; background: #fff; }
.tasks-modal-utility.hidden { display: none; }

.tasks-modal-close { background: none; border: none; font-size: 22px; color: #6b7280; cursor: pointer; line-height: 1; padding: 4px 8px; }
.tasks-modal-close:hover { color: #1a1a1a; }
.tasks-modal-body { padding: 20px; }
.tasks-field { margin-bottom: 14px; }
.tasks-field label { display: block; font-size: 11.5px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; }
.tasks-field input[type=text],
.tasks-field input[type=date],
.tasks-field select,
.tasks-field textarea {
  width: 100%; border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  padding: 8px 11px; font-size: 13px; font-family: inherit; outline: none; transition: border 0.15s;
}
.tasks-field input:focus, .tasks-field select:focus, .tasks-field textarea:focus { border-color: #00247f; }
/* AZ: textarea default 200px (was 80px) — gives notes the room they actually need */
.tasks-field textarea { min-height: 200px; resize: vertical; }
.tasks-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tasks-field-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* AZ: footer is now flat — Cancel · Save · Mark Complete, right-aligned.
   Old wrappers (.tasks-footer-left, .tasks-modal-actions) and the old
   .tasks-sf-link rule have been removed. */

/* BA-lite: footer wrap holds the button row + a sub-row for the close-task link.
   Sub-row reserves height so layout doesn't shift when link toggles visible. */
.tasks-modal-footer-wrap {
  padding: 14px 20px; border-top: 1px solid var(--border, #e5e7eb);
  background: #fafbff;
}
.tasks-modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-wrap: wrap;
}
.tasks-modal-footer-sub {
  display: flex; justify-content: flex-end;
  margin-top: 6px;
  min-height: 16px; /* reserves space so layout doesn't jump when link appears */
}
.tasks-close-task-link {
  font-size: 11.5px; color: #3185fc; text-decoration: none;
  cursor: pointer; font-weight: 500;
  visibility: hidden;
}
.tasks-close-task-link:hover { text-decoration: underline; }
.tasks-close-task-link.show { visibility: visible; }

.tasks-btn {
  border: none; border-radius: 8px; padding: 8px 16px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px;
}
.tasks-btn-primary { background: #00247f; color: #fff; }
.tasks-btn-primary:hover { background: #1a3a8c; }
.tasks-btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.tasks-btn-secondary { background: #fff; color: #1a1a1a; border: 1px solid var(--border, #e5e7eb); }
.tasks-btn-secondary:hover { border-color: #00247f; }
.tasks-btn-complete { background: #db9523; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.tasks-btn-complete:hover { background: #b87a18; }
.tasks-btn-complete.hidden { display: none; }
/* BA-lite: post-completion neutral state — Mark as Complete button replaced with
   "✓ Completed" disabled white button. Replaces the gold fill. */
.tasks-btn-complete-done {
  background: #fff; color: #6b7280;
  border: 1px solid var(--border, #e5e7eb);
  cursor: not-allowed; box-shadow: none;
}
/* BA-lite: destructive button for Discard changes confirmation */
.tasks-btn-discard { background: #dc2626; color: #fff; }
.tasks-btn-discard:hover { background: #b91c1c; }

/* BA-lite: in-modal completion banner. Hidden until JS toggles .show. */
.tasks-completion-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #f0fdf4; border: 1px solid #86efac;
  border-radius: 8px;
  font-size: 12.5px; color: #166534; line-height: 1.5;
}
.tasks-completion-banner.hidden { display: none; }
.tasks-completion-banner svg { flex-shrink: 0; margin-top: 1px; }

/* BD: Checklist callout. Yellow by default; .complete adds green-tinted variant for
   post-completion state. Sits above the green completion banner inside modal-body. */
.tasks-checklist-callout {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fffbeb; border: 1px solid #fbbf24;
  border-radius: 8px;
  font-size: 12.5px; color: #78350f; line-height: 1.5;
}
.tasks-checklist-callout.hidden { display: none; }
.tasks-checklist-callout.complete {
  background: #f0fdf4; border-color: #86efac; color: #166534;
}
.tasks-checklist-callout.complete .tasks-checklist-heading-wrap strong { color: #166534; }
.tasks-checklist-callout.complete .tasks-checklist-subtitle { color: #15803d; }
.tasks-checklist-callout.complete .tasks-checklist-checkbox { border-color: #15803d; }

.tasks-checklist-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.tasks-checklist-header svg { flex-shrink: 0; margin-top: 1px; }
.tasks-checklist-heading-wrap { flex: 1; }
.tasks-checklist-heading-wrap strong { color: #78350f; font-weight: 700; }
.tasks-checklist-subtitle {
  font-size: 11.5px; color: #92400e;
  margin-top: 2px; line-height: 1.4;
}

.tasks-checklist-items {
  padding-left: 24px; margin: 0 0 4px;
  list-style: none;
  max-height: 180px; overflow-y: auto;
}
.tasks-checklist-items li {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 0;
  font-size: 12.5px; line-height: 1.4;
  color: #1a1a1a;
}
.tasks-checklist-items li.completed { color: #6b7280; text-decoration: line-through; }
.tasks-checklist-items li.inaccessible { color: #9ca3af; font-style: italic; }

.tasks-checklist-checkbox {
  flex-shrink: 0;
  width: 14px; height: 14px;
  border: 1.5px solid #92400e; border-radius: 3px;
  background: #fff; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tasks-checklist-checkbox.checked {
  background: #059669; border-color: #059669;
}
.tasks-checklist-checkbox.checked::after {
  content: ""; width: 7px; height: 4px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg); margin-top: -2px;
}
.tasks-checklist-checkbox.locked {
  background: #f3f4f6; border-color: #d1d5db;
}
.tasks-checklist-checkbox.locked::after {
  content: "🔒"; font-size: 8px;
}
.tasks-checklist-required {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px; color: #dc2626; font-weight: 700;
}

/* BD: Footer strip inside callout. Read-only message + Refresh button.
   Only shown during B-fresh state (post-click waiting for SF). Hidden in
   pre-click and post-completion states. */
.tasks-checklist-footer-strip {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(146, 64, 14, 0.35);
}
.tasks-checklist-footer-strip.hidden { display: none; }
.tasks-checklist-footer-msg {
  flex: 1;
  font-size: 11.5px; color: #92400e;
  line-height: 1.4;
  display: flex; align-items: flex-start; gap: 6px;
}
.tasks-checklist-footer-msg svg { flex-shrink: 0; margin-top: 1px; }
.tasks-checklist-footer-msg strong { color: #78350f; font-weight: 700; }

.tasks-checklist-refresh-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid #92400e;
  color: #92400e;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 4px;
  cursor: pointer; font-family: inherit;
  flex-shrink: 0;
}
.tasks-checklist-refresh-btn:hover { background: #fef3c7; }
.tasks-checklist-refresh-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.tasks-checklist-refresh-btn.refreshing svg { animation: tasksSpin 1s linear infinite; }
/* (tasksSpin keyframes already defined elsewhere in this file for the AZ refresh button) */

/* BD: Mark as Complete arrow (↗ prefix) — shown when button is in navy "Continue in
   Salesforce" mode, hidden otherwise. Paired with hiding the .tasks-mc-check icon. */
.tasks-mc-arrow.hidden { display: none; }
.tasks-mc-check.hidden { display: none; }

/* BD: Navy "Continue in Salesforce" button variant. */
.tasks-btn-complete-sf {
  background: #00247f; color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.tasks-btn-complete-sf:hover { background: #001a5c; }

/* BD: Pending state — disabled grey "Waiting for Salesforce…" mode after the user
   has clicked Continue in Salesforce. Resolves on Refresh task. */
.tasks-btn-pending {
  background: #f3f4f6; color: #6b7280;
  border: 1px solid var(--border, #e5e7eb);
  cursor: not-allowed; box-shadow: none;
}

/* BD: Save button disabled state during read-only mode. Slightly different visual
   from a normal disabled to make clear it's intentional, not a transient. */
.tasks-btn-disabled-readonly {
  background: #f3f4f6 !important; color: #9ca3af !important;
  border: 1px solid var(--border, #e5e7eb) !important;
  cursor: not-allowed !important; box-shadow: none !important;
}

/* BD: Read-only field state during B-fresh. */
.tasks-modal-overlay .tasks-field input:disabled,
.tasks-modal-overlay .tasks-field textarea:disabled {
  background: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
  border-color: var(--border, #e5e7eb);
}

/* BA-lite: discard-changes confirmation overlay. Sits inside the modal overlay
   and covers the modal with a darker scrim + a small confirmation card.
   Component-scoped (.tasks-* prefix) so it can't bleed into other dialogs. */
.tasks-discard-confirm {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  padding: 20px;
}
.tasks-discard-confirm.hidden { display: none; }
.tasks-discard-card {
  background: #fff; border-radius: 10px;
  padding: 20px;
  max-width: 380px; width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.tasks-discard-title {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 15px; color: #00247f; font-weight: 700;
  margin-bottom: 8px;
}
.tasks-discard-body {
  font-size: 13px; color: #4b5563; line-height: 1.5;
  margin-bottom: 16px;
}
.tasks-discard-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Typeaheads ───────────────────────────────────────────────────────── */
.tasks-typeahead-wrap { position: relative; }
.tasks-typeahead-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  margin-top: 3px; max-height: 220px; overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1); z-index: 10; display: none;
}
.tasks-typeahead-results.open { display: block; }
.tasks-ta-item {
  padding: 8px 12px; cursor: pointer; font-size: 12.5px;
  border-bottom: 1px solid #f3f4f6; display: flex; align-items: center; gap: 8px;
}
.tasks-ta-item:last-child { border-bottom: none; }
.tasks-ta-item:hover { background: #eef2ff; }
.tasks-ta-item .tasks-ta-type {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.4px;
}
.tasks-ta-type-contact { background: #dbeafe; color: #1e40af; }
.tasks-ta-type-account { background: #fae8ff; color: #6b21a8; }
.tasks-ta-type-user    { background: #d1fae5; color: #065f46; }
.tasks-ta-name { flex: 1; }
.tasks-ta-empty { padding: 16px; text-align: center; color: #6b7280; font-size: 12px; }
.tasks-ta-loading { padding: 12px; text-align: center; color: #6b7280; font-size: 12px; font-style: italic; }
/* AZ: .tasks-typeahead-helper rule removed — helper text was deleted from HTML */

.tasks-input-with-clear { position: relative; }
.tasks-input-with-clear input { padding-right: 28px !important; }
.tasks-input-clear-x {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #6b7280;
  font-size: 16px; cursor: pointer; line-height: 1;
  padding: 2px 6px; border-radius: 3px;
}
.tasks-input-clear-x:hover { color: #dc2626; background: #fee2e2; }
.tasks-input-clear-x.hidden { display: none; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.tasks-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #00247f; color: #fff;
  padding: 10px 18px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; z-index: 2000;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  pointer-events: none;
}
.tasks-toast.show { transform: translateX(-50%) translateY(0); }
.tasks-toast.error { background: #dc2626; }

/* ═══════════════════════════════════════════════════════════════════
   BF: HELP "?" ICON + BODY-ANCHORED TOOLTIP
   Pattern cloned from .idate-help-icon / .idate-helptip. See header
   note for future-factor-into-shared rationale.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── HELP "?" ICON IN CARD HEADER ──────────────────────────────────── */
.tasks-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(0, 36, 127, 0.08);
  color: var(--navy);
  font-size: 10.5px;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid rgba(0, 36, 127, 0.18);
  cursor: help;
  transition: background 0.12s, border-color 0.12s;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
}
.tasks-help-icon:hover {
  background: rgba(0, 36, 127, 0.16);
  border-color: rgba(0, 36, 127, 0.32);
}

/* ─── HELP TOOLTIP (body-anchored, multi-section) ───────────────────── */
.tasks-helptip {
  display: none;
  position: fixed;
  /* left/top set at runtime */
  background: #1a2244;
  color: #f0f2f7;
  font-size: 11.5px;
  line-height: 1.55;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  width: 320px;
  max-width: calc(100vw - 24px);
  z-index: 1100;
  text-align: left;
  overflow: hidden;
}
.tasks-helptip.on { display: block; }

/* Arrow tail */
.tasks-helptip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: var(--arrow-x, 24px);
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #1a2244;
  pointer-events: none;
}
.tasks-helptip.tasks-helptip-flip-up::before {
  top: auto;
  bottom: -6px;
  border-bottom: none;
  border-top: 6px solid #1a2244;
}

.tasks-helptip-title {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: white;
}
.tasks-helptip-body { padding: 12px 14px; }
.tasks-helptip-section { margin-bottom: 11px; }
.tasks-helptip-section:last-of-type { margin-bottom: 11px; }
.tasks-helptip-h {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
}
.tasks-helptip-section p {
  font-size: 11.5px;
  line-height: 1.5;
  margin: 0 0 5px;
}
.tasks-helptip-section p:last-child { margin-bottom: 0; }
.tasks-helptip-section strong { color: white; font-weight: 600; }
.tasks-helptip-section em {
  color: #ffd47a;
  font-style: normal;
  font-weight: 500;
}

/* Video tutorial link */
.tasks-helptip-video {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(72, 124, 255, 0.10);
  border: 1px solid rgba(72, 124, 255, 0.22);
  border-radius: 6px;
  color: #c0d0fa;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  transition: background 0.15s;
}
.tasks-helptip-video:hover {
  background: rgba(72, 124, 255, 0.18);
  color: #d0deff;
}
.tasks-helptip-video span { flex: 1; }
.tasks-helptip-video-arrow { opacity: 0.6; flex-shrink: 0; }

/* Dark mode parity */
body.dark .tasks-help-icon {
  background: rgba(255, 255, 255, 0.07);
  color: #c0d0fa;
  border-color: rgba(255, 255, 255, 0.15);
}
body.dark .tasks-help-icon:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}
