/* ========== Shared dark mode (body.dark / html.dark) — whole project ========== */
html.dark, body.dark {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  color-scheme: dark;
}
body.dark .wrap,
body.dark .page-body { color: #f1f5f9; }

body.dark .sticky-chrome {
  background: transparent !important;
  box-shadow: none !important;
}
body.dark header {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
}
body.dark .header-inner {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.35) !important;
  color: #e2e8f0 !important;
}
body.dark .site-name {
  color: #f1f5f9 !important;
  border-left-color: #475569 !important;
}
body.dark .card,
body.dark .stat-card,
body.dark .results-unified-row,
body.dark details.filter-bar,
body.dark .filter-bar,
body.dark .meeting,
body.dark .picker-row,
body.dark .zt-card,
body.dark .msg-topnav,
html.dark .msg-topnav {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.dark .picker-row label { color: #94a3b8 !important; }
body.dark .user-chip {
  background: #0f172a !important;
  color: #cbd5e1 !important;
}
body.dark .role-pill.role-admin {
  background: #422006 !important;
  color: #fbbf24 !important;
  border: 1px solid #a16207;
}
body.dark .role-pill.role-user {
  background: #334155 !important;
  color: #cbd5e1 !important;
}

/* Messaging topnav (must beat later light rules — also duplicated in messaging_topnav.php) */
body.dark .msg-topnav,
html.dark .msg-topnav {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
  box-shadow: none !important;
}
body.dark .msg-topnav a.msg-back,
html.dark .msg-topnav a.msg-back {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .msg-topnav a.msg-back:hover,
html.dark .msg-topnav a.msg-back:hover {
  background: #334155 !important;
  color: #f1f5f9 !important;
}
body.dark .msg-topnav .msg-section,
html.dark .msg-topnav .msg-section { color: #f1f5f9 !important; }
body.dark .msg-topnav .msg-crumb,
html.dark .msg-topnav .msg-crumb { color: #64748b !important; }
body.dark .msg-topnav .msg-tabs,
html.dark .msg-topnav .msg-tabs { background: #0f172a !important; }
body.dark .msg-topnav .msg-tabs a,
html.dark .msg-topnav .msg-tabs a { color: #94a3b8 !important; }
body.dark .msg-topnav .msg-tabs a:hover,
html.dark .msg-topnav .msg-tabs a:hover {
  background: #334155 !important;
  color: #f1f5f9 !important;
}
body.dark .msg-topnav .msg-tabs a.is-active,
html.dark .msg-topnav .msg-tabs a.is-active {
  background: #0c4a6e !important;
  color: #38bdf8 !important;
  box-shadow: none !important;
}

/* Tabs / links */
body.dark .tab.active,
body.dark .tabs-depts .tab.active {
  color: #38bdf8 !important;
  border-bottom-color: #38bdf8 !important;
}
body.dark .tab { color: #94a3b8 !important; }
body.dark a { color: #38bdf8; }
body.dark h1, body.dark h2, body.dark h3,
body.dark .view-breadcrumb-title { color: #f1f5f9 !important; }
body.dark .meta,
body.dark label,
body.dark .subtitle,
body.dark .view-breadcrumb-dept,
body.dark .view-breadcrumb-sub { color: #cbd5e1 !important; }

/* Filters / buttons */
body.dark .sort-label,
body.dark .date-label,
body.dark .dr-field {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .date-label input[type="date"],
body.dark .dr-field input[type="date"],
body.dark .sort-label select,
body.dark input,
body.dark select,
body.dark textarea {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
  color-scheme: dark;
}
body.dark .date-label input[type="date"],
body.dark .dr-field input[type="date"] {
  background: transparent !important;
  border-color: transparent !important;
  color: #e2e8f0 !important;
}
body.dark .date-label input[type="date"]::-webkit-calendar-picker-indicator,
body.dark .dr-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2);
  opacity: .85;
}
body.dark .btn:not(.primary) {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .btn.primary,
body.dark button.primary {
  background: #159ad6 !important;
  border-color: #159ad6 !important;
  color: #fff !important;
}

/* Tables */
body.dark table th,
body.dark .zoom-table thead th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}
body.dark table td,
body.dark .zoom-table tbody td {
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
body.dark .zoom-table.has-sticky-first thead th:first-child,
body.dark .zoom-table.has-sticky-first tbody td:first-child,
body.dark .ml-actions-cell {
  background: #1e293b !important;
}

/* Chips / results / segments */
body.dark .chip {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .chip-active, body.dark .chip.active {
  background: #0c4a6e !important;
  border-color: #159ad6 !important;
  color: #7dd3fc !important;
}
body.dark .results-tab-btn { color: #94a3b8 !important; }
body.dark .results-tab-btn[aria-selected="true"] {
  color: #38bdf8 !important;
  border-bottom-color: #38bdf8 !important;
  background: #0c4a6e !important;
}
body.dark .seg-switcher { background: #0f172a !important; border-color: #475569 !important; }
body.dark .seg-switcher-btn.active { color: #38bdf8 !important; background: #1e293b !important; }
body.dark .owner-multi-toggle,
body.dark .ssel-toggle {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}
body.dark .owner-multi-panel,
body.dark .ssel-panel {
  background: #1e293b !important;
  border-color: #475569 !important;
}
body.dark .unified-sources,
body.dark .unified-summary { color: #cbd5e1 !important; }
body.dark .empty,
body.dark .empty-row {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  background: #0f172a !important;
}

/* Bug reports page */
body.dark .filter-row button,
body.dark .dt-toggle,
body.dark .dt-in,
body.dark #bugDtClear,
body.dark .bug-status-select,
body.dark .bug-comment-attach,
body.dark .bug-desc-edit,
body.dark .bug-desc-cancel,
body.dark .lang-chip,
body.dark .pill {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .filter-row button.is-active {
  background: #159ad6 !important;
  border-color: #159ad6 !important;
  color: #fff !important;
}
body.dark .dt-toggle .dt-active-dot { color: #38bdf8 !important; }
body.dark .bug-status-select.stage-claude {
  background: #0c4a6e !important;
  border-color: #0369a1 !important;
  color: #7dd3fc !important;
}
body.dark .bug-status-select.stage-verify {
  background: #422006 !important;
  border-color: #a16207 !important;
  color: #fbbf24 !important;
}

/* Zoom teams admin */
body.dark .zt-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark .zt-note {
  background: #422006 !important;
  border-color: #a16207 !important;
  color: #fde68a !important;
}
body.dark .zt-label,
body.dark .zt-hint,
body.dark .zt-status,
body.dark .zt-empty,
body.dark .zt-managers { color: #94a3b8 !important; }
body.dark .zt-name,
body.dark .zt-emails {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .zt-del {
  background: #1e293b !important;
  border-color: #7f1d1d !important;
  color: #fca5a5 !important;
}

/* Standalone CSS variable themes */
body.dark, html.dark body {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-faint: #94a3b8;
  --line-soft: #334155;
  --accent: #159ad6;
}

body.dark ::-webkit-scrollbar-track { background: #0f172a; }
body.dark ::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

/* ---- Page-local islands (followup / leads / spend / presence / tasks / tpl) ---- */
body.dark .ful-card,
body.dark .il-table-wrap,
body.dark .pres-card,
body.dark .cs-card,
body.dark .cs-stat,
body.dark .task-card,
body.dark .tpl-card,
body.dark .tpl-owner-bar,
body.dark .preview,
body.dark .tag-popover,
body.dark .lead-rem-bell,
body.dark #yerPop,
body.dark #yerModal .box,
body.dark .__bugrep-panel {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.dark .ful-card-name,
body.dark .il-title,
body.dark .task-title,
body.dark .tpl-label { color: #f1f5f9 !important; }
body.dark .ful-empty,
body.dark .il-empty,
body.dark .ful-comment-view,
body.dark .il-count,
body.dark .il-email,
body.dark .il-location,
body.dark .task-desc,
body.dark .cs-label,
body.dark .zt-empty { color: #94a3b8 !important; }
body.dark .ful-tag-pill,
body.dark .ful-search-wrap,
body.dark .ful-filter-btn,
body.dark .ful-search-type,
body.dark .ful-search-input,
body.dark .ful-dropdown,
body.dark .cs-tabs button,
body.dark .pres-card button,
body.dark .tpl-lang-tab {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .ful-filter-btn.active,
body.dark .cs-tabs button.active,
body.dark .tpl-lang-tab.is-active {
  background: #159ad6 !important;
  border-color: #159ad6 !important;
  color: #fff !important;
}
body.dark .ful-comment-row,
body.dark .ful-search-item.is-selected,
body.dark .task-status,
body.dark .meeting-orphan,
body.dark .meeting-list-header .ml-actions-cell.meeting-orphan,
body.dark .dev-pill,
body.dark .info,
body.dark .notes,
body.dark .cs-warn,
body.dark .zp-error {
  background: #422006 !important;
  border-color: #a16207 !important;
  color: #fde68a !important;
}
body.dark .il-table-wrap th,
body.dark table.calendly-grid th,
body.dark table.cadence th {
  background: #1e293b !important;
  color: #94a3b8 !important;
}
body.dark .il-table-wrap tr:hover td { background: #263347 !important; }
body.dark .lang-tabs,
body.dark .lang-tabs button {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}
body.dark .lang-tabs button.lang-tab.is-active,
body.dark .lang-tabs button.is-active {
  background: #0c4a6e !important;
  border-color: #159ad6 !important;
  color: #38bdf8 !important;
}
body.dark .template {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.dark .gate,
body.dark .gate-login {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.5) !important;
}
body.dark .gate h1, body.dark .gate-login h2 { color: #f1f5f9 !important; }
body.dark .gate p, body.dark .gate-login p { color: #94a3b8 !important; }
body.dark .gate input {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .gate button {
  background: #159ad6 !important;
  color: #fff !important;
}
body.dark .gate .back a { color: #94a3b8 !important; }
body.dark .zp-btn, body.dark .btn {
  border-color: #475569 !important;
}
body.dark .zp-btn.is-active, body.dark .zp-btn.primary {
  background: #159ad6 !important;
  border-color: #159ad6 !important;
  color: #fff !important;
}
body.dark .stat-card .err,
body.dark .stat-card [data-err],
body.dark .dm-kpi-err { color: #f87171 !important; }

/* Beat theme-canva light hovers when dark */
body.dark.theme-canva .btn:not(.primary):hover {
  background: #475569 !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

/* Inline whites + keyword "white" used across pages / widgets */
body.dark [style*="background:#fff"],
body.dark [style*="background: #fff"],
body.dark [style*="background:#ffffff"],
body.dark [style*="background: #ffffff"],
body.dark [style*="background:#f9fafb"],
body.dark [style*="background: #f9fafb"],
body.dark [style*="background:#f8fafc"],
body.dark [style*="background:white"],
body.dark [style*="background: white"] {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}
body.dark [style*="background:#fffbeb"],
body.dark [style*="background:#fef3c7"],
body.dark [style*="background:#eef2f7"] {
  background: #422006 !important;
  color: #fde68a !important;
}
body.dark [style*="color:#6b7280"],
body.dark [style*="color:#64748b"],
body.dark [style*="color:#475569"],
body.dark [style*="color:#374151"],
body.dark [style*="color:#111827"] {
  color: #cbd5e1 !important;
}
body.dark .node,
body.dark .chip-input .chip-dropdown,
body.dark .zp-btn:not(.primary):not(.is-active),
body.dark .__bugrep-panel button.__bugrep-btn:not(.primary),
body.dark .__bugrep-panel .__bugrep-addimg,
body.dark .__bugrep-panel textarea {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
body.dark .__bugrep-panel h3,
body.dark .__bugrep-help,
body.dark .__bugrep-status,
body.dark .__bugrep-count,
body.dark .__bugrep-notify {
  color: #94a3b8 !important;
}
body.dark .__bugrep-panel h3 { color: #f1f5f9 !important; }
body.dark #yerPop .yer-item {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.dark #yerModal textarea,
body.dark #yerModal input,
body.dark #yerBody,
body.dark #yerWhen {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

/* Sales Filters — dates / time / Country / Viewing / Tag (beat light whites) */
body.dark .date-box,
body.dark .time-box {
  background: #0f172a !important;
  border-color: #475569 !important;
}
body.dark .date-box .date-label,
body.dark .date-label,
body.dark .date-presets,
body.dark .date-time,
body.dark input[type="date"],
body.dark input[type="time"],
body.dark select.date-presets,
body.dark .multi-dropdown-toggle,
body.dark .tag-filter-toggle {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
}
body.dark .date-label input[type="date"],
body.dark .date-label input[type="time"] {
  background: transparent !important;
  border-color: transparent !important;
  color: #e2e8f0 !important;
  color-scheme: dark;
}
body.dark input[type="date"]::-webkit-datetime-edit,
body.dark input[type="date"]::-webkit-datetime-edit-fields-wrapper,
body.dark input[type="date"]::-webkit-datetime-edit-text,
body.dark input[type="date"]::-webkit-datetime-edit-month-field,
body.dark input[type="date"]::-webkit-datetime-edit-day-field,
body.dark input[type="date"]::-webkit-datetime-edit-year-field,
body.dark input[type="time"]::-webkit-datetime-edit,
body.dark input[type="time"]::-webkit-datetime-edit-fields-wrapper,
body.dark input[type="time"]::-webkit-datetime-edit-hour-field,
body.dark input[type="time"]::-webkit-datetime-edit-minute-field,
body.dark input[type="time"]::-webkit-datetime-edit-ampm-field,
body.dark input[type="time"]::-webkit-datetime-edit-text {
  background: transparent !important;
  color: #e2e8f0 !important;
}
body.dark input[type="date"]::-webkit-calendar-picker-indicator,
body.dark input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2);
  opacity: .85;
}
body.dark .multi-dropdown-label,
body.dark .tag-filter-toggle #tagFilterLabel { color: #e2e8f0 !important; }
body.dark .login-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.45) !important;
  color: #e2e8f0 !important;
}
body.dark .login-card p,
body.dark .login-card label,
body.dark .login-card label span {
  color: #cbd5e1 !important;
}
body.dark .login-card a:not([style*="background:#159ad6"]):not(.btn) {
  color: #38bdf8 !important;
}
body.dark .multi-dropdown-count {
  background: #1e293b !important;
  color: #cbd5e1 !important;
}
body.dark .um-name { color: #f1f5f9 !important; }
body.dark .um-mail { color: #94a3b8 !important; }
body.dark .user-menu {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark .um-sep { background: #334155 !important; }
body.dark .um-item { color: #e2e8f0 !important; }
body.dark .um-item:hover { background: #334155 !important; }
body.dark .um-logout { color: #38bdf8 !important; }


/* Past/no-show meeting-card states (state coloring, 2026-08-23) */
body.dark .meeting.meeting-past { background: #16202e !important; }
body.dark .m-noshow-cta { background: #3f1d1d !important; color: #fca5a5 !important; border-color: #7f1d1d !important; }
body.dark .meeting-noshow .m-btn.call-lead { background: #3f1d1d !important; color: #fca5a5 !important; border-color: #b91c1c !important; }
body.dark .m-called-cta { background: #0d2a20 !important; color: #6ee7b7 !important; border-color: #065f46 !important; }
body.dark .m-premium-pill { background: #3a2e10 !important; color: #fbbf24 !important; border-color: #92400e !important; }
body.dark .meeting.meeting-premium { background: #26211a !important; border-color: #92400e !important; }
