* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --brand: #CC1F27;
  --priority-teal: #0F6E56;
  --brand-dark: #a01820;
  --brand-light: rgba(204,31,39,0.12);
  --header-bg: #000000;
  --nav-bg: #000000;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg-soft: #f9fafb;
  --bg-card: #ffffff;
  --active-blue: #2563eb;
  --prospect-gray: #9ca3af;
  --at-risk-red: #CC1F27;
  --shadow: 0 4px 20px rgba(0,0,0,0.12);
  --sidebar-w: 300px;
  --popup-w: clamp(360px, 28vw, 640px);
  --color-background-primary: #ffffff;
  --color-background-secondary: #f9fafb;
  --color-background-danger: #fef2f2;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-danger: #dc2626;
  --color-border-secondary: #d1d5db;
  --color-border-tertiary: #e5e7eb;
  --color-border-danger: #fca5a5;
  --border-radius-md: 6px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; height:100vh; display:flex; flex-direction:column; overflow:hidden; }

/* FILTER SECTION LABELS */
.filter-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); font-weight: 500; }
.filter-label-row { margin-bottom: 4px; }

/* HEADER */
/* header { ... } block and .header-center / .header-tab rules were removed
   with the index.html chrome unification + sub-strip retirement. The
   .header-avatar/-user-name and .header-left/-right rules below remain in
   use inside .topbar. */
.nav-logo-lockup { display: flex; align-items: center; gap: 11px; }
.nav-wordmark { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; color: #CC0000; letter-spacing: 0.04em; white-space: nowrap; }
.header-left { display: flex; align-items: center; gap: 10px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* .topbar / .topbar-* / .site-nav / .nav-btn rules moved to site-nav.css,
   loaded by every SiteNav-using page. Rules below are index.html-specific
   header avatar affordances. */
.header-avatar-wrap { position: relative; }
.header-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #374151;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #ccc; cursor: pointer; border: none;
}
.header-avatar:hover { background: #555; }
.header-avatar-menu {
  display: none; position: absolute; top: 42px; right: 0;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); min-width: 200px; padding: 14px 16px 10px;
  z-index: 200;
}
.header-avatar-menu.open { display: block; }
.header-avatar-menu .menu-name { font-size: 13px; font-weight: 600; color: #1a1a18; }
.header-avatar-menu .menu-email { font-size: 11px; color: #888; margin-top: 2px; }
.header-avatar-menu hr { border: none; border-top: 1px solid #eee; margin: 10px 0; }
.header-avatar-menu .menu-logout {
  width: 100%; padding: 8px 0; background: none; border: none;
  color: #c0392b; font-size: 13px; font-weight: 500; cursor: pointer;
  text-align: center; border-radius: 6px; transition: background .15s;
}
.header-avatar-menu .menu-logout:hover { background: #fef2f2; }
.header-user-name { color: #9CA3AF; font-size: 12px; white-space: nowrap; }

/* SUBHEADER */
/* LAYOUT */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; flex-shrink: 0;
  z-index: 500; overflow: hidden;
}
.sidebar-tabs { display: flex; border-bottom: 2px solid var(--sidebar-border); }
.sidebar-tab {
  flex: 1; padding: 10px 0; background: none; border: none;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-bottom: 3px solid transparent;
  position: relative; top: 2px; transition: color 0.15s;
}
.sidebar-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.sidebar-filters { padding: 10px 12px; border-bottom: 1px solid var(--sidebar-border); background: var(--bg-soft); }
.search-box {
  width: 100%; padding: 7px 10px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 13px; margin-bottom: 8px; outline: none;
}
.search-box:focus { border-color: var(--brand); }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-select {
  flex: 1; min-width: 0; padding: 5px 6px; border: 1px solid #d1d5db;
  border-radius: 5px; font-size: 11px; outline: none; background: white;
  color: var(--text);
}
.filter-select:focus { border-color: var(--brand); }
.sidebar-list { flex: 1; overflow-y: auto; }
.sidebar-item {
  padding: 10px 12px; border-bottom: 1px solid var(--sidebar-border);
  cursor: pointer; transition: background 0.1s;
}
.sidebar-item:hover { background: var(--bg-soft); }
.sidebar-item.selected { background: rgba(204,31,39,0.06); border-left: 3px solid var(--brand); }
.si-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.si-sub { font-size: 11px; color: var(--text-muted); }
.si-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.tag {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.tag-active { background: #dbeafe; color: #1d4ed8; }
.tag-prospect { background: #f3f4f6; color: #6b7280; }
.tag-atrisk { background: #fee2e2; color: #991b1b; }
.tag-nocoords { background: #fef3c7; color: #92400e; }
.sidebar-count { padding: 6px 12px; font-size: 11px; color: var(--text-muted); background: var(--bg-soft); border-bottom: 1px solid var(--sidebar-border); }

/* MAP */
.map-wrap { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

/* LAYER CONTROLS */
.layer-controls {
  position: absolute; top: 80px; left: 10px; z-index: 400;
  background: white; border-radius: 8px; padding: 10px 12px;
  box-shadow: var(--shadow); min-width: 160px;
}
.layer-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px; }
.layer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: pointer; font-size: 12px; color: var(--text); user-select: none; }
.layer-item:last-child { margin-bottom: 0; }
.layer-item input[type=checkbox] { accent-color: var(--brand); width: 14px; height: 14px; cursor: pointer; }
.layer-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mode-count { font-size: 10px; color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.legend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 12px; color: var(--text); cursor: default; position: relative; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid white; box-shadow: 0 1px 4px rgba(0,0,0,0.3); flex-shrink: 0; }
.legend-label { line-height: 1.3; }
.legend-desc { color: var(--text-muted); }
.legend-row[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: #fff; color: var(--text); font-size: 12px; line-height: 1.4;
  padding: 10px; border-radius: 8px; border: 0.5px solid #d1d5db;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-width: 220px; z-index: 500; pointer-events: none; white-space: normal;
}
.layer-item input[type=radio] { accent-color: var(--brand); width: 14px; height: 14px; cursor: pointer; }
.reset-btn {
  margin-top: 10px; width: 100%; padding: 6px; background: var(--brand);
  color: white; border: none; border-radius: 5px; font-size: 11px;
  font-weight: 600; cursor: pointer; letter-spacing: 0.04em;
}
.reset-btn:hover { background: var(--brand-dark); }
.wp-collapsed { display: none !important; }

/* POPUP PANEL */
.popup-panel {
  position: absolute; top: 10px; right: 10px; width: var(--popup-w);
  max-height: calc(100% - 20px); background: white; border-radius: 10px;
  box-shadow: var(--shadow); z-index: 600; display: flex; flex-direction: column;
  overflow: hidden; display: none;
}
.popup-panel.visible { display: flex; }
.popup-header {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0; position: relative;
}
.popup-close {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px;
  border-radius: 50%; border: 1px solid #e5e7eb; background: white;
  color: var(--text-muted); font-size: 14px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.popup-close:hover { background: #f3f4f6; }
.popup-record-type { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 3px; }
.popup-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; padding-right: 30px; }
.popup-parent { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.popup-action-banners { display: flex; flex-direction: column; }
.reactivation-banner {
  background: var(--priority-teal); color: #fff; padding: 10px 20px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 12px; transition: background 0.15s;
}
.reactivation-banner:hover { background: #0d5f4c; }
.atrisk-banner {
  margin: 8px 0 0; padding: 5px 10px; background: #fee2e2; border-radius: 5px;
  color: #991b1b; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.popup-body { flex: 1; overflow-y: auto; padding: 0; }
.popup-tab-bar {
  display: flex; border-bottom: 2px solid var(--sidebar-border);
  flex-shrink: 0; padding: 0 12px; background: white;
}
.popup-tab {
  flex: 1; padding: 9px 4px; font-size: 11px; font-weight: 600;
  text-align: center; color: var(--text-muted); cursor: pointer;
  border: none; background: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.popup-tab:hover { color: var(--text); }
.popup-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.popup-tab-content { display: none; padding: 14px 16px; }
.popup-tab-content.active { display: block; }
.stat-row { display: flex; gap: 8px; margin-bottom: 12px; }
.stat-tile {
  flex: 1; background: var(--bg-soft); border-radius: 7px; padding: 8px 10px;
  text-align: center; border: 1px solid var(--sidebar-border);
}
.stat-val { font-size: 18px; font-weight: 700; color: var(--text); }
.stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.info-section { margin-bottom: 14px; }
.info-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px;
  padding-bottom: 4px; border-bottom: 1px solid var(--sidebar-border);
}
.info-row { display: flex; gap: 8px; font-size: 12px; margin-bottom: 5px; align-items: flex-start; }
.info-icon { color: var(--text-light); flex-shrink: 0; width: 14px; text-align: center; margin-top: 1px; }
.info-val { color: var(--text); flex: 1; }
.info-val a { color: var(--brand); text-decoration: none; }
.info-val a:hover { text-decoration: underline; }
.no-orders-warn {
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 5px;
  padding: 6px 10px; color: #92400e; font-size: 11px; font-weight: 600;
  margin-bottom: 10px;
}
.contact-chips { display: flex; flex-direction: column; gap: 6px; }
.contact-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--bg-soft); border: 1px solid var(--sidebar-border);
  border-radius: 7px; cursor: pointer; transition: all 0.15s;
}
.contact-chip:hover { border-color: var(--brand); background: var(--brand-light); }
.contact-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.contact-chip-name { font-size: 12px; font-weight: 600; color: var(--text); }
.contact-chip-title { font-size: 11px; color: var(--text-muted); }
.no-data { font-size: 12px; color: var(--text-muted); font-style: italic; }
.account-link-item {
  padding: 8px 10px; background: var(--bg-soft); border: 1px solid var(--sidebar-border);
  border-radius: 7px; margin-bottom: 6px; cursor: pointer; transition: all 0.15s;
}
.account-link-item:hover { border-color: var(--brand); }
.account-link-name { font-size: 12px; font-weight: 600; color: var(--text); }
.account-link-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* LEGEND */

/* SALES CHART */
.sales-chart-wrap { margin-top: 4px; }
.sales-bar-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px; font-size: 11px;
}
.sales-bar-label { width: 58px; flex-shrink: 0; color: var(--text-muted); text-align: right; font-size: 10px; }
.sales-bar-track { flex: 1; background: #f3f4f6; border-radius: 3px; height: 14px; position: relative; overflow: hidden; }
.sales-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #a01820, #CC1F27);
  transition: width 0.4s ease;
}
.sales-bar-val { width: 64px; flex-shrink: 0; color: var(--text); font-size: 10px; text-align: right; }
.sales-quarter-tiles { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.sales-q-tile {
  flex: 1; min-width: 0; background: var(--bg-soft); border: 1px solid var(--sidebar-border);
  border-radius: 6px; padding: 6px 8px; text-align: center;
}
.sales-q-val { font-size: 13px; font-weight: 700; color: var(--text); }
.sales-q-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 1px; }
.sales-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; background: var(--brand-light); border-radius: 6px;
  border: 1px solid rgba(204,31,39,0.2); margin-bottom: 10px;
}
.sales-total-label { font-size: 11px; font-weight: 600; color: var(--brand); }
.sales-total-val { font-size: 15px; font-weight: 700; color: var(--brand); }

/* VISIT NOTES */
.notes-form { margin-bottom: 10px; }
.trello-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; margin-bottom: 8px; padding: 5px 8px;
  border-radius: 5px; background: var(--bg-soft);
  border: 1px solid var(--sidebar-border);
}
.trello-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.trello-dot.linked { background: #10b981; }
.trello-dot.unlinked { background: #f59e0b; }
.trello-dot.loading { background: #9ca3af; animation: pulse-dot 1s infinite; }
.trello-dot.error { background: var(--brand); }
/* ACTIVITY TYPE BADGES */
.activity-type-selector { display: flex; gap: 6px; margin-bottom: 8px; }
.activity-type-btn {
  flex: 1; padding: 5px 4px; border: 1.5px solid var(--sidebar-border);
  border-radius: 6px; background: var(--bg-soft); color: var(--text-muted);
  font-size: 11px; font-weight: 600; cursor: pointer; text-align: center;
  transition: all 0.15s;
}
.activity-type-btn.active {
  border-color: var(--brand); background: var(--brand-light); color: var(--brand);
}
.activity-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.05em;
}
.activity-badge.call_email { background: #dbeafe; color: #1d4ed8; }
.activity-badge.in_person_visit { background: #d1fae5; color: #065f46; }
.activity-badge.other_note { background: #f3f4f6; color: #6b7280; }
.note-card-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }

@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.3} }
.notes-textarea {
  width: 100%; min-height: 72px; padding: 8px 10px;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 12px; font-family: inherit; resize: vertical;
  outline: none; color: var(--text); line-height: 1.5;
  transition: border-color 0.15s;
}
.notes-textarea:focus { border-color: var(--brand); }
.notes-form-row { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.notes-date-input {
  flex: 1; padding: 5px 8px; border: 1px solid #d1d5db;
  border-radius: 5px; font-size: 11px; outline: none; color: var(--text);
}
.notes-date-input:focus { border-color: var(--brand); }
.notes-save-btn {
  padding: 5px 14px; background: var(--brand); color: white;
  border: none; border-radius: 5px; font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.notes-save-btn:hover { background: var(--brand-dark); }
.notes-list { display: flex; flex-direction: column; gap: 7px; }
.note-card {
  background: #fffbf0; border: 1px solid #fde68a;
  border-radius: 7px; padding: 9px 11px; position: relative;
}
.note-card-date {
  font-size: 10px; font-weight: 700; color: #92400e;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}
.note-card-text { font-size: 12px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }
.note-card-delete {
  position: absolute; top: 7px; right: 8px;
  background: none; border: none; color: #d1a940; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px;
  opacity: 0.6; transition: opacity 0.15s;
}
.note-card-delete:hover { opacity: 1; color: var(--brand); }
.notes-empty { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ACTIVITY PILLS */
.activity-pills { display: flex; gap: 6px; margin-bottom: 12px; }
.activity-pill {
  padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--text); color: var(--text);
  background: none; transition: all 0.15s; display: flex; align-items: center; gap: 5px;
}
.activity-pill:hover { border-color: var(--brand); color: var(--brand); }
.activity-pill.active { background: var(--brand); border-color: var(--brand); color: white; }
.activity-pill .pill-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px; font-size: 10px;
  font-weight: 700; padding: 0 5px;
  background: rgba(0,0,0,0.12); color: inherit;
}
.activity-pill.active .pill-count { background: rgba(255,255,255,0.3); }
.activity-pill-newtask {
  padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1.5px dashed var(--text-muted); color: var(--text-muted);
  background: none; transition: all 0.15s; margin-left: auto;
}
.activity-pill-newtask:hover { border-color: var(--brand); color: var(--brand); }
.activity-pill-newtask.active { background: var(--brand); border-color: var(--brand); border-style: solid; color: white; }
.activity-view { display: none; }
.activity-view.active { display: block; }

/* TASK CARDS */
.task-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: white; border-radius: 7px; border: 1.5px solid var(--sidebar-border);
  margin-bottom: 6px; transition: border-color 0.15s;
}
.task-card.overdue { border-color: #dc2626; border-left: 4px solid #dc2626; }
.task-card.due-soon { border-color: #f59e0b; border-left: 4px solid #f59e0b; }
.task-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--bg-soft); border: 1px solid var(--sidebar-border);
}
.task-card.overdue .task-icon { background: #fef2f2; border-color: #fca5a5; }
.task-card.due-soon .task-icon { background: #fffbeb; border-color: #fcd34d; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 12px; font-weight: 600; color: var(--text); }
.task-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 8px; }
.task-complete-btn {
  padding: 4px 10px; background: #059669; color: white; border: none;
  border-radius: 5px; font-size: 10px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background 0.15s; flex-shrink: 0;
}
.task-complete-btn:hover { background: #047857; }
.tasks-empty { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 8px 0; }

/* NEW TASK FORM */
.new-task-form { display: flex; flex-direction: column; gap: 8px; }
.new-task-input {
  width: 100%; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 12px; font-family: inherit; outline: none; color: var(--text);
  transition: border-color 0.15s;
}
.new-task-input:focus { border-color: var(--brand); }
.new-task-row { display: flex; gap: 8px; }
.new-task-row > * { flex: 1; }
.new-task-select {
  padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: 11px; outline: none; color: var(--text); background: white;
  cursor: pointer;
}
.new-task-select:focus { border-color: var(--brand); }
.new-task-save {
  width: 100%; padding: 8px; background: var(--brand); color: white;
  border: none; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.new-task-save:hover { background: var(--brand-dark); }

/* REPORT BUTTON */
.report-btn {
  padding: 5px 12px; background: var(--brand); color: white;
  border: none; border-radius: 5px; font-size: 11px; font-weight: 600;
  cursor: pointer; letter-spacing: 0.04em; margin-right: 10px;
  transition: background 0.15s; white-space: nowrap;
}
.report-btn:hover { background: var(--brand-dark); }

/* REPORT MODAL */
.report-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 2000; display: none; align-items: center; justify-content: center;
}
.report-modal-overlay.open { display: flex; }
.report-modal {
  background: white; border-radius: 10px; width: 860px; max-width: 95vw;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden;
}
.report-modal-header {
  background: var(--header-bg); border-bottom: 3px solid var(--brand);
  padding: 14px 20px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.report-modal-logo { height: 32px; object-fit: contain; }
.report-modal-title { color: white; font-size: 14px; font-weight: 700; }
.report-modal-subtitle { color: #888; font-size: 11px; }
.report-modal-controls {
  padding: 14px 20px; border-bottom: 1px solid var(--sidebar-border);
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--bg-soft); flex-shrink: 0;
}
.report-ctrl-group { display: flex; flex-direction: column; gap: 4px; }
.report-ctrl-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.report-date-input {
  padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: 12px; outline: none; color: var(--text);
}
.report-date-input:focus { border-color: var(--brand); }
.report-action-btn {
  padding: 7px 16px; border-radius: 5px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.report-action-btn.primary { background: var(--brand); color: white; }
.report-action-btn.primary:hover { background: var(--brand-dark); }
.report-action-btn.secondary { background: #f3f4f6; color: var(--text); border: 1px solid #d1d5db; }
.report-action-btn.secondary:hover { background: #e5e7eb; }
.report-action-btn.trello { background: #0052cc; color: white; }
.report-action-btn.trello:hover { background: #003d99; }
.report-modal-body { flex: 1; overflow-y: auto; padding: 0; }
.report-modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--sidebar-border);
  display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0;
  background: var(--bg-soft);
}
.report-close-btn {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: #888; font-size: 18px; cursor: pointer;
}

/* REPORT CONTENT (inside modal and print) */
.report-content { padding: 24px 28px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.report-print-header {
  display: none; /* shown only in print */
  border-bottom: 3px solid #CC1F27; padding-bottom: 14px; margin-bottom: 20px;
}
.report-meta { margin-bottom: 24px; }
.report-meta h1 { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.report-meta p { font-size: 13px; color: #6b7280; }
.report-state-group { margin-bottom: 28px; }
.report-state-heading {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: #CC1F27; border-bottom: 2px solid #CC1F27; padding-bottom: 5px; margin-bottom: 14px;
}
.report-account-card {
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px;
}
.report-account-name { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 2px; }
.report-account-meta { font-size: 11px; color: #6b7280; margin-bottom: 10px; }
.report-account-meta span { margin-right: 12px; }
.report-note { border-left: 3px solid #CC1F27; padding: 8px 12px; margin-bottom: 7px; background: white; border-radius: 0 5px 5px 0; }
.report-note-date { font-size: 10px; font-weight: 700; color: #CC1F27; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.report-note-text { font-size: 12px; color: #374151; line-height: 1.5; white-space: pre-wrap; }
.report-empty { text-align: center; padding: 40px; color: #9ca3af; font-size: 13px; font-style: italic; }
.report-status-bar {
  padding: 8px 20px; font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--sidebar-border); background: white; text-align: center;
}

/* PRINT STYLES - handled by printReport() opening a fresh window */
@media print {
  body > * { display: none !important; }
}

/* ── MOBILE RESPONSIVE ──────────────────────────────────────────────────── */
/* Triggered by JS adding .mobile to <body> based on actual body width      */

/* Mobile-only elements hidden by default */
.mobile-menu-btn {
  display: none; align-items: center; justify-content: center;
  position: absolute; top: 10px; left: 10px; z-index: 400;
  width: 36px; height: 36px; border-radius: 8px;
  background: white; border: none; color: var(--text);
  font-size: 20px; cursor: pointer; flex-shrink: 0;
  box-shadow: var(--shadow);
}
.mobile-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1999; opacity: 0; transition: opacity 0.25s;
}
.mobile-overlay.visible { display: block; opacity: 1; }
.sidebar-close-btn {
  display: none; align-items: center; justify-content: center;
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--sidebar-border); background: white;
  color: var(--text-muted); font-size: 14px; cursor: pointer; z-index: 10;
}
.mobile-report-btn-wrap { display: none; }

/* .mobile class applied by JS when body width <= 768px */
body.mobile .mobile-menu-btn { display: flex; }
body.mobile .mobile-overlay { display: none; } /* shown via .visible */
body.mobile .mobile-overlay.visible { display: block; opacity: 1; }
body.mobile .sidebar-close-btn { display: flex; }
body.mobile .mobile-report-btn-wrap {
  display: block; padding: 8px 12px;
  border-bottom: 1px solid var(--sidebar-border); background: var(--bg-soft);
}

body.mobile .header-text { display: none; }
body.mobile .header-title { display: none; }
body.mobile .report-btn { display: none; }
body.mobile .header-right { display: none; }

body.mobile .app-body { position: relative; }
body.mobile .sidebar {
  position: fixed; top: 0; left: -100%; width: 88%;  max-width: 320px;
  height: 100%; z-index: 2000;
  transition: left 0.3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}
body.mobile .sidebar.mobile-open { left: 0; }

body.mobile .layer-controls {
  top: auto; bottom: 100px; left: 10px;
  padding: 8px 10px; min-width: 140px;
}
body.mobile .mobile-menu-btn { display: flex; }
body.mobile .leaflet-top.leaflet-left { left: 54px; }
body.mobile .layer-item { font-size: 11px; }

/* ── Mobile sidebar enhancements ── */
.mobile-accounts-fab {
  display: none; position: fixed; bottom: 24px; left: 16px; z-index: 1500;
  padding: 10px 18px; border-radius: 24px; border: none;
  background: #1a1a18; color: #fff; font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  display: none; align-items: center; gap: 8px;
}
.mobile-accounts-fab .fab-badge {
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; min-width: 20px; text-align: center;
}
body.mobile .mobile-accounts-fab { display: flex; }

body.mobile .sidebar { width: 92%; max-width: 340px; padding-top: 48px; }
body.mobile .sidebar-item { padding: 14px 12px; min-height: 56px; }
body.mobile .si-name { font-size: 14px; }
body.mobile .si-sub { font-size: 12px; }
body.mobile .sidebar-tab { min-height: 44px; font-size: 14px; }
body.mobile .search-box { font-size: 16px !important; /* prevent iOS zoom */ }
body.mobile .sidebar-filters select { min-height: 44px; font-size: 14px; }
body.mobile .filter-label { font-size: 12px; }

/* Sticky search on mobile */
.mobile-search-wrap {
  display: none; position: sticky; top: 0; z-index: 5;
  background: var(--sidebar-bg, #fff); padding: 8px 12px;
  border-bottom: 1px solid var(--sidebar-border);
}
.mobile-search-wrap .search-box { width: 100%; padding-right: 32px; }
body.mobile .mobile-search-wrap { display: block; }
body.mobile #filters-accounts .search-box,
body.mobile #filters-contacts .search-box { display: none; }

/* Search clear button */
.search-clear-btn {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted, #6B7280);
  font-size: 16px; cursor: pointer; display: none; padding: 4px;
}
.search-clear-btn.visible { display: block; }

/* Reset filters button */
.mobile-reset-filters {
  display: none; width: 100%; padding: 10px; margin-top: 8px;
  border-radius: 6px; border: 1px solid var(--sidebar-border);
  background: var(--bg-soft, #F8F9FA); color: var(--text-muted, #6B7280);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.mobile-reset-filters:hover { border-color: var(--brand); color: var(--brand); }
body.mobile .mobile-reset-filters { display: block; }

/* Collapsible filters on mobile */
.mobile-filters-toggle {
  display: none; padding: 10px 12px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 1px solid var(--sidebar-border);
  background: var(--bg-soft); user-select: none;
}
.mobile-filters-toggle::after { content: ' ▾'; }
.mobile-filters-toggle.expanded::after { content: ' ▴'; }
body.mobile .mobile-filters-toggle { display: block; }
body.mobile .sidebar-filters.mobile-collapsed { display: none !important; }

body.mobile .popup-panel {
  position: fixed !important;
  top: auto !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  width: 100% !important; max-height: 90vh !important;
  border-radius: 18px 18px 0 0 !important;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  display: flex !important;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
}
body.mobile .popup-panel.visible { transform: translateY(0); height: 90vh; }
body.mobile .popup-panel.peek { transform: translateY(0); height: 45vh; }
body.mobile .popup-panel.dragging { transition: none !important; }

/* Drag handle */
.sheet-drag-handle {
  display: none; padding: 16px 0 10px; cursor: grab;
  flex-shrink: 0; touch-action: none;
}
.sheet-drag-handle .handle-bar {
  width: 56px; height: 5px; border-radius: 3px; background: #6B7280; margin: 0 auto;
  transition: background 0.15s;
}
.sheet-drag-handle:active .handle-bar,
.sheet-drag-handle:hover .handle-bar { background: #374151; }
body.mobile .sheet-drag-handle { display: block; }
body.mobile .popup-panel::before { display: none; }

body.mobile .popup-header { padding-top: 8px; }
body.mobile .popup-body { -webkit-overflow-scrolling: touch; }

/* Sheet overlay */
.sheet-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 599; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
body.mobile .sheet-overlay { display: block; }
body.mobile .sheet-overlay.active { opacity: 1; pointer-events: auto; }

/* Mobile popup tab bar — scrollable */
body.mobile .popup-tab-bar {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; flex-wrap: nowrap;
}
body.mobile .popup-tab-bar::-webkit-scrollbar { display: none; }
body.mobile .popup-tab { white-space: nowrap; min-height: 44px; font-size: 13px; flex-shrink: 0; }

body.mobile .report-modal { width: 100vw !important; max-height: 100vh !important; border-radius: 0 !important; }
body.mobile .report-modal-controls { flex-direction: column; }
body.mobile .report-ctrl-group { width: 100%; }
body.mobile .report-date-input { width: 100%; }

/* ── PHOTOS — grid, thumbnails, lightbox, upload ── */
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 0; }
.photos-empty { text-align: center; padding: 24px; color: #9CA3AF; font-size: 12px; grid-column: 1 / -1; }
.photo-thumb { border-radius: 6px; overflow: hidden; cursor: pointer; background: #F3F4F6; aspect-ratio: 1; position: relative; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb-date { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.55); color: #fff; font-size: 9px; padding: 2px 6px; }
.photo-uploading { display: flex; align-items: center; justify-content: center; background: #F3F4F6; aspect-ratio: 1; border-radius: 6px; }
.photo-spinner { width: 20px; height: 20px; border: 2px solid #E5E7EB; border-top-color: var(--brand); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.photo-add-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px dashed #D1D5DB; background: #F9FAFB; font-size: 12px; font-weight: 600; color: #6B7280; cursor: pointer; font-family: inherit; }
.photo-add-btn:hover { border-color: #9CA3AF; color: #111827; }
.photo-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 99998; display: flex; align-items: center; justify-content: center; }
.photo-lb-content { position: relative; max-width: 90vw; max-height: 90vh; }
.photo-lb-content img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; }
.photo-lb-close { position: absolute; top: -12px; right: -12px; width: 28px; height: 28px; border-radius: 50%; border: none; background: #fff; color: #111; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.photo-lb-info { text-align: center; color: rgba(255,255,255,0.5); font-size: 11px; margin-top: 8px; }
.note-photos { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.note-photo-thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; cursor: pointer; }
.note-photo-more { font-size: 10px; color: #6B7280; font-weight: 600; }
.modal-photo-slots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.modal-photo-thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; }
.modal-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.modal-photo-add { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #6B7280; cursor: pointer; margin-bottom: 8px; }
.modal-photo-add:hover { color: #111827; }

/* Leaflet dot markers — behavioral tier palette */
.dot-critical { background: #DC2626; border: 2px solid white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.dot-watch { background: #EAB308; border: 2px solid white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.dot-steady { background: #2563EB; border: 2px solid white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.dot-dormant { background: #93B4D9; border: 2px solid white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.3); opacity: 0.55; }
.dot-cold { background: #9CA3AF; border: 2px solid white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.dot-newrequest { background: #F59E0B; border: 2px solid white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.dot-selected { box-shadow: 0 0 0 3px var(--brand), 0 1px 4px rgba(0,0,0,0.3) !important; }
.dot-priority-wrap { position: relative; width: 20px; height: 20px; border-radius: 50%; background: var(--priority-teal); display: flex; align-items: center; justify-content: center; }
.dot-priority-wrap > div { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }

@keyframes quoteP {
  0%   { transform: scale(1);   opacity: 0.85; }
  100% { transform: scale(2.4); opacity: 0;    }
}

/* ── MOBILE MAP + CONTROLS POLISH ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .leaflet-container { touch-action: manipulation; }

  /* Itinerary panel — bottom sheet overlay on mobile */
  .itinerary-panel {
    width: 100% !important; border-left: none !important;
    position: fixed !important; left: 0; right: 0; bottom: 0;
    z-index: 8001; max-height: 85vh !important; height: 85vh;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1) !important;
    overflow: hidden !important;
  }
  /* Override the inline display:flex — panel hidden by transform, not display */
  .itinerary-panel[style] { display: flex !important; }
  .itinerary-panel.mobile-sheet-open { transform: translateY(0) !important; }

  /* Panel scroll area */
  .panel-scroll { overflow-y: auto !important; -webkit-overflow-scrolling: touch; }

  /* Tasks panel — stack the 3-column grid into a single column on mobile so cards aren't crushed */
  .wp-tasks-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .wp-tasks-section { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid #E5E7EB; }

}
@media (max-width: 768px) {

  /* Call grid: single column on mobile instead of 5 columns */
  .call-day-grid { grid-template-columns: 1fr !important; }
  .call-day-col { border-right: none; border-bottom: 1px solid #E5E7EB; }
  .call-grid-wrap { overflow-y: auto; max-height: none; flex-shrink: 1; }

  /* Floating plan button */
  .mobile-plan-fab {
    position: fixed; bottom: 80px; left: 16px; z-index: 1500;
    padding: 10px 18px; border-radius: 24px; border: none;
    background: #1a1a18; color: #fff; font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: flex; align-items: center; gap: 8px;
  }

  /* Sheet overlay for plan panel */
  .plan-sheet-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 8000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
  }
  .plan-sheet-overlay.active { opacity: 1; pointer-events: auto; }

  /* Mobile day picker for tap-to-assign */
  .mobile-day-picker {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9500;
    background: #fff; border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    padding: 16px 20px 24px; transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  }
  .mobile-day-picker.open { transform: translateY(0); }
  .mobile-day-picker-title { font-size: 14px; font-weight: 600; color: #111827; margin-bottom: 12px; }
  .mobile-day-picker-btns { display: flex; flex-direction: column; gap: 6px; }
  .mobile-day-btn {
    padding: 14px 16px; border-radius: 10px; border: 1px solid #E5E7EB;
    background: #fff; font-family: 'DM Sans', sans-serif; font-size: 14px;
    font-weight: 500; color: #111827; cursor: pointer; text-align: left;
  }
  .mobile-day-btn:hover { background: #F3F4F6; }
  .mobile-day-picker-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3);
    z-index: 9499; opacity: 0; pointer-events: none; transition: opacity 0.3s;
  }
  .mobile-day-picker-overlay.open { opacity: 1; pointer-events: auto; }

  /* Larger zoom controls */
  .leaflet-control-zoom a {
    width: 40px !important; height: 40px !important;
    line-height: 40px !important; font-size: 20px !important;
  }

  /* Legend — collapsed by default on mobile */
  .layer-controls { display: none !important; }
  #wp-map-legend { display: none !important; }
  .leaflet-control-zoom { display: none !important; }
  .reset-btn { display: none !important; }

  /* My Tasks FAB — hide on mobile (accessible from hamburger menu) */
  #my-tasks-fab { display: none !important; }

  /* Move accounts FAB up to avoid crowding with Jarvis */
  .mobile-accounts-fab { bottom: 24px !important; }
  .mobile-plan-fab { display: none !important; }

  /* Mobile sub-headers (week plan + map mode) */
  #wp-mobile-subheader, #map-mobile-subheader { background:#f8f8f6; border-bottom:0.5px solid #e0e0d8; padding:7px 10px; flex-direction:column; gap:5px; }
  #wp-mobile-hint { font-size:10px; color:#6B7280; text-align:center; display:block; }
  #wp-mobile-search-row, #map-mobile-search-row { display:flex; align-items:center; gap:6px; position:relative; }
  #wp-search-results, #map-search-results { display:none; position:absolute; top:100%; left:0; right:0; background:#fff; border:1px solid #e5e7eb; border-radius:0 0 8px 8px; max-height:260px; overflow-y:auto; z-index:500; box-shadow:0 4px 12px rgba(0,0,0,0.1); }
  .wp-search-result-item { padding:10px 12px; font-size:13px; color:#111; border-bottom:0.5px solid #f3f4f6; cursor:pointer; font-family:'DM Sans',sans-serif; }
  .wp-search-result-item:active { background:#f3f4f6; }
  .wp-search-result-sub { font-size:10px; color:#6B7280; margin-top:1px; }
  #wp-mobile-search-wrap, #map-mobile-search-wrap { flex:1; background:white; border:0.5px solid #d1d5db; border-radius:8px; padding:5px 10px; display:flex; align-items:center; gap:6px; }
  #wp-mobile-search, #map-mobile-search { border:none; outline:none; flex:1; font-size:16px; background:transparent; color:#111; }
  #wp-legend-btn, #map-legend-btn { display:flex; align-items:center; gap:5px; padding:5px 12px; height:34px; flex-shrink:0; background:rgba(17,24,39,0.08); border:1px solid #9CA3AF; border-radius:20px; font-size:12px; font-weight:600; color:#374151; cursor:pointer; white-space:nowrap; font-family:'DM Sans',sans-serif; }
  #wp-legend-btn.active, #map-legend-btn.active { background:#111827; border-color:#374151; color:white; }
  #wp-legend-btn svg, #map-legend-btn svg { width:14px; height:14px; flex-shrink:0; }
  #wp-new-account-btn, #map-new-account-btn {
    display:flex; align-items:center; gap:5px;
    padding:5px 10px; height:34px; flex-shrink:0;
    background:#fff;
    border:1.5px dashed #CC0000;
    border-radius:20px;
    font-size:12px; font-weight:700; line-height:1;
    color:#CC0000;
    cursor:pointer; white-space:nowrap;
    font-family:'DM Sans',sans-serif;
  }
  /* Narrow viewports (iPhone SE 375px, ~360px Androids): hide the "New"
     label so the + icon alone fits without pushing the cluster off-screen.
     Above 400px, full label shows. */
  @media (max-width: 400px) {
    #wp-new-account-btn .label,
    #map-new-account-btn .label { display: none; }
  }

  /* Note form — full-width on mobile */
  .notes-textarea { font-size: 16px !important; min-height: 100px; }
  .notes-save-btn { min-height: 44px; font-size: 14px; }
  .activity-type-btn { min-height: 40px; font-size: 13px; }
  .notes-date-input { min-height: 40px; font-size: 14px; }
}

/* ── Mobile legend overlay ── */
#mobile-legend-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:8600; align-items:flex-start; justify-content:center; padding-top:140px; }
#mobile-legend-overlay.open { display:flex; }
#mobile-legend-card { background:white; border-radius:12px; padding:14px; width:calc(100% - 40px); max-width:320px; border:0.5px solid #e5e7eb; }
#mobile-legend-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; font-size:12px; font-weight:500; color:#111; }
#mobile-legend-header button { background:none; border:none; font-size:12px; color:#9CA3AF; cursor:pointer; }
.mobile-legend-section-label { font-size:9px; font-weight:500; text-transform:uppercase; letter-spacing:0.06em; color:#9CA3AF; margin-bottom:6px; }
.mobile-legend-items { display:flex; flex-direction:column; gap:5px; }
.mobile-legend-row { display:flex; align-items:center; gap:8px; font-size:11px; color:#374151; }
.ml-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; display:inline-block; }

/* ── Mobile week plan tab strip ── */
#wp-mobile-tab-strip { display:none; position:fixed; bottom:0; left:0; right:0; height:48px; background:#111827; border-top:1px solid #374151; z-index:9500; flex-direction:row; }
#wp-mobile-tab-strip.visible { display:flex; }
#wp-mobile-tab-strip.above-jarvis-nav { bottom: 48px; }
/* Field Mode lock: the Itinerary/Map strip only belongs above the Jarvis bottom
   nav when the user is on the Week tab. The .above-jarvis-nav class is added
   by jarvisNavSwitch('week') and only then. If state ever drifts (e.g., a
   stray switchTopTab('weekplan') from URL or a downstream call), this rule
   keeps the strip hidden so it can't cover the Jarvis/Map/Week nav. */
body.field-mode #wp-mobile-tab-strip:not(.above-jarvis-nav) { display: none !important; }
.wp-mobile-tab { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-size:11px; font-weight:500; color:#6B7280; background:none; border:none; cursor:pointer; position:relative; }
.wp-mobile-tab svg { color:#9CA3AF; }
.wp-mobile-tab.active { color:#ffffff; }
.wp-mobile-tab.active svg { color:#DC2626; }
.wp-mobile-tab.active::after { content:''; position:absolute; bottom:0; left:50%; transform:translateX(-50%); width:20px; height:2px; background:#DC2626; border-radius:1px; }

/* ── LOGIN SCREEN ────────────────────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  height: 100vh; background: #000;
  font-family: 'DM Sans', sans-serif;
}
#login-screen.hidden { display: none; }

#login-nav {
  background: #000; height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; flex-shrink: 0; z-index: 1000;
  border-bottom: 1px solid #111;
}
.login-nav-left { display: flex; align-items: center; gap: 10px; }
.login-nav-wordmark { font-size: 13px; font-weight: 700; color: #CC0000; letter-spacing: 0.04em; }
.login-nav-right { display: flex; align-items: center; gap: 8px; }

#login-hero {
  display: grid; grid-template-columns: 1fr 1fr;
  flex: 1; min-height: 0;
}

#login-map-panel { position: relative; overflow: hidden; }
#login-map { position: absolute; inset: 0; }
#login-map .leaflet-tile-pane { filter: brightness(0.32) saturate(0.35) hue-rotate(185deg); }
#login-map .leaflet-control-container,
#login-map .leaflet-control-attribution { display: none !important; }

#login-map-legend {
  position: absolute; top: 14px; right: 14px; z-index: 500;
  display: flex; gap: 10px;
}
.login-leg { display: flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.35); }
.login-leg-dot { width: 6px; height: 6px; border-radius: 50%; }
.login-leg-dot.red { background: #CC0000; }
.login-leg-dot.cyan { background: #00d4ff; }

#login-overlay-text {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 32px 36px;
  background: linear-gradient(transparent, rgba(0,0,0,0.97) 55%);
  z-index: 500; pointer-events: none;
}
.login-eyebrow {
  font-size: 15px; font-weight: 700; color: #CC0000;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px;
}
.login-headline { font-size: clamp(1.6rem, 3.5vw, 2.75rem); font-weight: 700; color: #fff; line-height: 1.15; margin-bottom: 8px; }
.login-subtext { font-size: 18px; color: rgba(255,255,255,0.38); line-height: 1.5; }

#login-right {
  background: #0d1117; display: flex; align-items: center; justify-content: center;
  padding: 32px; border-left: 1px solid rgba(255,255,255,0.05);
}
#login-box {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(0,212,255,0.12);
  border-radius: 10px; padding: 28px 26px; width: 100%; max-width: 300px;
}
.lf-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 5px; }
.lf-conf { display: flex; align-items: center; gap: 5px; margin-bottom: 20px; }
.lf-conf-dot { width: 5px; height: 5px; border-radius: 50%; background: #CC0000; flex-shrink: 0; }
.lf-conf-text { font-size: 8.5px; font-weight: 700; color: #CC0000; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.lf-label { display: block; font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
#login-box input[type="email"],
#login-box input[type="password"] {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px; height: 34px; margin-bottom: 12px; padding: 0 10px;
  color: #fff; font-size: 12px; font-family: 'DM Sans', sans-serif; outline: none;
}
#login-box input:focus { border-color: rgba(0,212,255,0.35); }
#engine-btn {
  width: 100%; height: 36px; background: #CC0000; border: none; border-radius: 5px;
  color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.02em; font-family: 'DM Sans', sans-serif; transition: background 0.15s;
}
#engine-btn:hover { background: #aa0000; }
#login-error { font-size: 11px; color: #ff6b6b; margin-top: 8px; min-height: 16px; text-align: center; }
.login-shake { animation: loginShake 0.4s ease; }
@keyframes loginShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(6px)} }

#login-feat-bar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #000; border-top: 1px solid #151515; flex-shrink: 0;
}
.login-feat { padding: 32px 28px; border-right: 1px solid #151515; }
.login-feat:last-child { border-right: none; }
.login-feat-title { font-size: 21px; font-weight: 700; color: rgba(255,255,255,0.65); margin-bottom: 7px; display: flex; align-items: center; gap: 9px; }
.login-feat-desc { font-size: 17px; color: rgba(255,255,255,0.3); line-height: 1.55; }
.rdot { width: 9px; height: 9px; border-radius: 50%; background: #CC0000; flex-shrink: 0; }

@keyframes pinPulse {
  0% { transform: translate(-50%,-50%) scale(1); opacity: 0.9; }
  100% { transform: translate(-50%,-50%) scale(4); opacity: 0; }
}

@media (max-width: 768px) {
  #login-screen { overflow-y: auto; }
  #login-hero { grid-template-columns: 1fr; flex: none; }
  #login-map-panel { height: 220px; min-height: 220px; }
  #login-overlay-text { padding: 16px 20px; }
  .login-eyebrow { font-size: 10px; margin-bottom: 6px; }
  .login-headline { font-size: 1.4rem; }
  .login-subtext { font-size: 13px; }
  #login-right {
    background: #111; padding: 20px 16px;
    border: none; border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
  }
  #login-box {
    background: none; border: none; border-radius: 0;
    padding: 0; max-width: 100%;
  }
  #login-feat-bar { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; border-top: 1px solid #151515; }
  .login-feat {
    background: #161616; border-radius: 8px; border-right: none; border-bottom: none;
    padding: 14px 14px;
  }
  .login-feat:last-child { border-right: none; }
  .login-feat-title { font-size: 13px; margin-bottom: 4px; gap: 6px; }
  .login-feat-desc { font-size: 11px; }
  .rdot { width: 7px; height: 7px; }
}

/* ── WEEKLY REPORT PRINT STYLES ─────────────────────────────────────── */
  body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; color:#111827; background:white; padding:0; }
  .report-header { background:#1a1a1a; border-bottom:3px solid #CC1F27; padding:14px 28px; display:flex; align-items:center; gap:16px; }
  .report-header img { height:40px; object-fit:contain; }
  .report-header-text .title { font-size:15px; font-weight:700; color:#ffffff; }
  .report-header-text .sub { font-size:11px; color:#888; margin-top:2px; text-transform:uppercase; letter-spacing:0.06em; }
  .report-header-text .range { font-size:11px; color:#aaa; margin-top:4px; }
  .state-group { margin:20px 28px 24px; }
  .state-heading { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:#CC1F27; border-bottom:2px solid #CC1F27; padding-bottom:5px; margin-bottom:12px; }
  .account-card { background:#f9fafb; border:1px solid #e5e7eb; border-radius:6px; padding:12px 14px; margin-bottom:10px; page-break-inside:avoid; }
  .account-name { font-size:13px; font-weight:700; color:#111827; margin-bottom:3px; }
  .account-meta { font-size:11px; color:#6b7280; margin-bottom:8px; }
  .account-meta span { margin-right:12px; }
  .note { border-left:3px solid #CC1F27; padding:7px 10px; margin-bottom:6px; background:white; border-radius:0 4px 4px 0; }
  .note-date { font-size:10px; font-weight:700; color:#CC1F27; text-transform:uppercase; letter-spacing:0.04em; margin-bottom:3px; }
  .note-text { font-size:12px; color:#374151; line-height:1.5; white-space:pre-wrap; }

/* ─── PRIORITY TARGET PANEL ─────────────────────────────────────────────── */
.pt-active {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--color-background-secondary);
  border-radius: var(--border-radius-md);
  border: 0.5px solid var(--color-border-tertiary);
}

.pt-active-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-active-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.pt-category-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--border-radius-md);
  background: #faeeda;
  color: #854f0b;
  font-weight: 500;
}

.pt-active-notes {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.pt-remove-btn {
  align-self: flex-start;
  background: none;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  color: var(--color-text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.pt-remove-btn:hover {
  border-color: var(--color-border-danger);
  color: var(--color-text-danger);
  background: var(--color-background-danger);
}

.pt-star {
  font-size: 16px;
  color: var(--color-text-secondary);
  line-height: 1;
}

.pt-star--on {
  color: #f9a825;
}

.pt-collapsed {
  padding: 4px 0;
}

.pt-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 0;
}

.pt-trigger:hover .pt-trigger-label {
  color: var(--color-text-primary);
}

.pt-trigger-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pt-trigger-cta {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.pt-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--color-background-secondary);
  border-radius: var(--border-radius-md);
  border: 0.5px solid var(--color-border-tertiary);
}

.pt-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pt-select {
  flex: 1;
  padding: 6px 8px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  font-size: 13px;
  background: var(--color-background-primary);
  color: var(--color-text-primary);
}

.pt-flag-btn {
  padding: 6px 14px;
  background: #f9a825;
  border: none;
  border-radius: var(--border-radius-md);
  color: #633806;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.pt-flag-btn:hover {
  background: #f57f17;
}

.pt-notes-input {
  width: 100%;
  padding: 6px 8px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  font-size: 13px;
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  box-sizing: border-box;
}

.pt-cancel {
  font-size: 11px;
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: right;
}

.pt-cancel:hover {
  color: var(--color-text-primary);
}

/* ── Jarvis Context (Priority tab) ── */
.jarvis-context-section { margin-top: 16px; }
.jarvis-context-divider { border-top: 1px solid var(--color-border-secondary); margin-bottom: 12px; }
.jarvis-context-label { display: block; font-size: 11px; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.jarvis-context-label::before { content: "\2726"; color: #0891B2; margin-right: 5px; }
.jarvis-context-textarea { width: 100%; padding: 8px 10px; border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-md); font-size: 13px; font-family: inherit; line-height: 1.5; background: var(--color-background-primary); color: var(--color-text-primary); resize: vertical; box-sizing: border-box; }
.jarvis-context-textarea:focus { border-color: var(--brand); outline: none; }
.jarvis-context-status { display: inline-block; font-size: 11px; margin-top: 4px; height: 14px; }
.jarvis-context-saved { color: #16A34A; }
.jarvis-context-error { color: #DC2626; }

/* ═══════════════════════════════════════════════════════════════════════════
   WEEK PLAN — MODE TRANSITIONS (data-mode on <html>)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --mode-dur: 380ms;
  --mode-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Map wrap mode transition ── */
.map-wrap {
  transition: width var(--mode-dur) var(--mode-ease),
              opacity var(--mode-dur) var(--mode-ease),
              flex var(--mode-dur) var(--mode-ease);
}
[data-mode="call"] .map-wrap {
  width: 0 !important; flex: 0 !important; opacity: 0; overflow: hidden;
}
[data-mode="travel"] .map-wrap {
  opacity: 1;
}
.wp-days-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.wp-day-grid {
  flex: 1; display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0; border-right: 1px solid #E5E7EB; overflow-y: auto;
}

/* ── Itinerary Panel ── */
.itinerary-panel {
  display: flex; flex-direction: column; overflow: hidden;
  position: relative;
  background: #ffffff; border-left: 1px solid #E5E7EB;
  transition: width var(--mode-dur) var(--mode-ease);
  flex-shrink: 0;
  font-family: 'DM Sans', sans-serif;
}
[data-mode="travel"] .itinerary-panel {
  width: 35vw; min-width: 320px; max-width: 560px;
}
[data-mode="call"] .itinerary-panel {
  width: 100% !important; max-width: 100% !important; border-left: none;
}
.panel-header { padding: 14px 18px 12px; border-bottom: 1px solid #E5E7EB; flex-shrink: 0; position: relative; }
.wp-week-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.wp-nav-arrow {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid #E5E7EB;
  background: #fff; font-size: 14px; color: #111827; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.wp-nav-arrow:hover { background: #F3F4F6; }
.wp-nav-arrow:disabled { color: #D1D5DB; cursor: not-allowed; background: #F9FAFB; }
.wp-week-center { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.panel-week-label { font-size: 16px; font-weight: 700; color: #111827; }
.wp-week-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.wp-week-badge.badge-current { background: #DCFCE7; color: #15803D; }
.wp-week-badge.badge-future { background: #EFF6FF; color: #1D4ED8; }
.wp-week-badge.badge-past { background: #F3F4F6; color: #9CA3AF; }
.wp-week-dropdown {
  position: absolute; left: 18px; right: 18px; top: 48px; z-index: 20;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 200px; overflow-y: auto;
}
.wp-week-option {
  padding: 8px 12px; font-size: 12px; cursor: pointer; display: flex;
  align-items: center; justify-content: space-between;
}
.wp-week-option:hover { background: #F3F4F6; }
.wp-week-option.active { background: #EFF6FF; font-weight: 700; }
.wp-readonly-banner {
  background: #F3F4F6; color: #6B7280; font-size: 11px; font-weight: 600;
  text-align: center; padding: 4px 0; border-radius: 4px; margin-bottom: 6px;
}
.panel-week-meta { display: flex; align-items: center; justify-content: space-between; }
.panel-week-sub { font-size: 12px; color: #6B7280; }

/* ── Mode Toggle Button ── */
.mode-toggle {
  display: flex; align-items: center; gap: 7px;
  border: none; border-radius: 8px; padding: 6px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background 0.2s, color 0.2s; white-space: nowrap;
  position: relative; overflow: hidden;
  background: #111827; color: #ffffff;
}
[data-mode="travel"] .mode-toggle .toggle-travel-label { display: flex; align-items: center; gap: 6px; }
[data-mode="travel"] .mode-toggle .toggle-call-label { display: none; }
[data-mode="call"] .mode-toggle .toggle-call-label { display: flex; align-items: center; gap: 6px; }
[data-mode="call"] .mode-toggle .toggle-travel-label { display: none; }
.mode-toggle::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.25); opacity: 0; transition: opacity 0.3s;
}
.mode-toggle.flash::after { opacity: 1; }

/* ── Switch Banner ── */
.switch-banner {
  position: absolute; top: 52px; left: 0; right: 0; z-index: 50;
  background: #111827; color: #ffffff;
  font-size: 12px; font-weight: 600; text-align: center; padding: 8px;
  transform: translateY(-100%); transition: transform 0.25s ease;
  pointer-events: none; font-family: 'DM Sans', sans-serif;
}
.switch-banner.visible { transform: translateY(0); }

/* ── Panel Scroll ── */
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; }

/* ── TRAVEL VIEW: vertical day list ── */
.travel-view { display: block; min-height: 0; flex: 1; }
[data-mode="call"] .travel-view { display: none; }

.day-section { border-bottom: 1px solid #E5E7EB; }
.day-header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 10px; position: sticky; top: 0;
  background: #ffffff; z-index: 10; border-bottom: 1px solid #E5E7EB;
}
.day-label { font-size: 14px; font-weight: 700; color: #111827; }
.day-label.today { color: #2563EB; }
.day-date-label { font-size: 12px; color: #6B7280; margin-left: 6px; font-weight: 400; }
.day-date-label.today { color: #2563EB; }
.add-stop-btn {
  padding: 5px 13px; border-radius: 7px; border: 1.5px solid #E5E7EB;
  background: #ffffff; color: #111827; font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.add-stop-btn:hover { border-color: #111827; }
.stop-list { padding: 4px 18px; display: flex; flex-direction: column; gap: 2px; }

/* ── Travel stop cards ── */
.stop-done, .stop-anchor, .stop-pending { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.stop-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
  font-size: 13px; font-weight: 700;
}
.icon-done { background: #16A34A; color: #ffffff; }
.icon-anchor { background: #111827; color: #ffffff; font-size: 14px; }
.icon-pending { border: 2px solid #E5E7EB; background: #ffffff; }
.stop-name { font-size: 13px; font-weight: 700; color: #111827; margin-bottom: 0; }
.stop-done .stop-name { text-decoration: line-through; color: #9CA3AF; }
.stop-sub { font-size: 11px; color: #6B7280; margin-bottom: 0; }
.stop-note-preview { font-size: 11px; color: #16A34A; font-style: italic; line-height: 1.3; }

/* ── Stop note read-only modal ── */
.sn-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
/* Mobile: itinerary bottom sheet sits at z-index 8001, so the stop-note
   modal has to stack above it or tapping "Note logged — tap to view" does
   nothing visible. */
body.mobile .sn-overlay { z-index: 8500; }
@media (max-width: 768px) { .sn-overlay { z-index: 8500; } }
.sn-panel {
  background: #fff; border-radius: 12px; width: 90vw; max-width: 480px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18); overflow: hidden;
}
.sn-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #E5E7EB;
}
.sn-title { font-size: 14px; font-weight: 700; color: #111827; }
.sn-close {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid #E5E7EB;
  background: #fff; font-size: 14px; color: #6B7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sn-close:hover { border-color: #111827; color: #111827; }
.sn-body { padding: 16px; max-height: 400px; overflow-y: auto; }
.sn-textarea {
  width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid #E5E7EB;
  border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 13px;
  line-height: 1.6; color: #111827; resize: vertical; outline: none;
  margin-top: 6px;
}
.sn-textarea:focus { border-color: #2563EB; }
.sn-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px;
}
.sn-save-status { font-size: 11px; font-weight: 600; }
.sn-save-btn {
  padding: 6px 16px; border-radius: 6px; border: none; background: #111827;
  color: #fff; font-family: 'DM Sans', sans-serif; font-size: 12px;
  font-weight: 700; cursor: pointer;
}
.sn-save-btn:hover { background: #374151; }
.stop-remove {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid #E5E7EB;
  background: #ffffff; color: #6B7280; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.stop-remove:hover { border-color: #DC2626; color: #DC2626; }
.anchor-content { flex: 1; }
.anchor-sub { font-size: 11px; color: #6B7280; margin-bottom: 0; display: flex; align-items: center; gap: 8px; }
.log-btn {
  padding: 3px 8px; border-radius: 20px; border: 1px solid #E5E7EB;
  background: #ffffff; font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 600; color: #111827; cursor: pointer; white-space: nowrap;
}
.log-btn:hover { border-color: #111827; }
.pending-content { flex: 1; }
.pending-task { font-size: 11px; color: #6B7280; margin-bottom: 0; display: inline; }
.pending-actions { display: inline-flex; gap: 4px; margin-left: 8px; }
.pending-meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.log-visit-btn, .skip-stop-btn {
  padding: 3px 8px; border-radius: 20px; border: 1px solid #E5E7EB;
  background: #ffffff; font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 600; color: #111827; cursor: pointer; white-space: nowrap;
}
.log-visit-btn:hover { border-color: #111827; }
.skip-stop-btn:hover { border-color: #DC2626; color: #DC2626; }
.brief-stop-btn {
  padding: 3px 8px; border-radius: 20px; border: 1px solid #BFDBFE;
  background: #EFF6FF; font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 600; color: #2563EB; cursor: pointer; white-space: nowrap;
}
.brief-stop-btn:hover { background: #DBEAFE; border-color: #93C5FD; }

/* ── Manager-suggested stop card ── */
.wp-stop-suggested {
  font-size: 10px; color: #92400E; margin-top: 3px; line-height: 1.4;
}
.wp-stop-actions { display: flex; gap: 6px; margin-top: 8px; }
.wp-accept-btn {
  flex: 1; padding: 4px 0; border-radius: 5px; border: 1.5px solid #16A34A;
  background: #F0FDF4; color: #15803D; font-family: var(--font, 'DM Sans', sans-serif);
  font-size: 10px; font-weight: 700; cursor: pointer;
}
.wp-accept-btn:hover { background: #DCFCE7; }
.wp-dismiss-btn {
  flex: 1; padding: 4px 0; border-radius: 5px; border: 1.5px solid #E5E7EB;
  background: white; color: #6B7280; font-family: var(--font, 'DM Sans', sans-serif);
  font-size: 10px; font-weight: 700; cursor: pointer;
}
.wp-dismiss-btn:hover { border-color: #DC2626; color: #DC2626; }

/* ── Inline note form ── */
.note-form-section {
  margin: 0 18px 10px; background: #F8F9FA; border: 1px solid #E5E7EB;
  border-radius: 10px; overflow: hidden;
}
.note-form-header {
  padding: 8px 12px; border-bottom: 1px solid #E5E7EB;
  font-size: 10px; font-weight: 700; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.note-form-acct { padding: 6px 12px 0; font-size: 13px; font-weight: 700; color: #111827; }
.note-textarea {
  display: block; width: 100%; padding: 10px 12px; border: none;
  border-top: 1px solid #E5E7EB; font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: #111827; resize: none; background: #ffffff;
  line-height: 1.5; margin-top: 6px;
}
.note-textarea:focus { outline: none; }
.note-form-footer {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-top: 1px solid #E5E7EB; background: #F8F9FA;
}
.type-select {
  padding: 5px 8px; border-radius: 6px; border: 1.5px solid #E5E7EB;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: #111827;
  background: #ffffff; cursor: pointer;
}
.cancel-btn {
  padding: 6px 14px; border-radius: 7px; border: 1.5px solid #E5E7EB;
  background: #ffffff; font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 600; color: #111827; cursor: pointer;
}
.save-note-btn {
  padding: 6px 14px; border-radius: 7px; border: none;
  background: #111827; color: #ffffff; font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
}

/* ── Nearby strip ── */
.nearby-strip {
  margin: 0 18px 10px; background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: 10px; padding: 10px 12px;
}
.nearby-title {
  font-size: 10px; font-weight: 700; color: #1D4ED8;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.nearby-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nearby-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 20px; background: #ffffff;
  border: 1px solid #BFDBFE; font-size: 12px; font-weight: 600;
  color: #111827; cursor: pointer;
}
.nearby-chip:hover { border-color: #2563EB; }
.chip-sub { font-weight: 400; color: #6B7280; font-size: 11px; }
.chip-task { color: #2563EB; font-size: 11px; }
.empty-day-msg { padding: 10px 18px 14px; font-size: 12px; color: #9CA3AF; font-style: italic; }

/* ── Drag-and-drop ── */
.day-section.drag-over, .unscheduled-section.drag-over {
  background: #EFF6FF; outline: 2px dashed #2563EB; outline-offset: -2px;
}
.stop-drag-handle {
  cursor: grab; color: #C4C9D1; font-size: 14px; line-height: 1;
  padding: 0 2px; user-select: none; flex-shrink: 0; align-self: center;
}
.stop-drag-handle:active { cursor: grabbing; }
[draggable="true"] { transition: opacity 0.15s; }
[draggable="true"].dragging { opacity: 0.35; }

/* ── Recommendations section ── */
.recs-section { padding: 14px 18px; border-top: 1px solid #E5E7EB; }
.recs-title {
  font-size: 10px; font-weight: 700; color: #1D4ED8;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.rec-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid #E5E7EB; border-radius: 8px; margin-bottom: 6px;
  background: #fff; cursor: pointer; transition: border-color 0.15s;
}
.rec-card:hover { border-color: #2563EB; }
.rec-card-name { font-size: 13px; font-weight: 600; color: #111827; flex: 1; }
.rec-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}
.rec-tag-critical { background: #FEE2E2; color: #DC2626; }
.rec-tag-watch { background: #FEF9C3; color: #A16207; }
.rec-tag-reorder { background: #DCFCE7; color: #15803D; }
.rec-tag-priority { background: #EDE9FE; color: #5B4FCF; }
.rec-tag-nearby { background: #EFF6FF; color: #2563EB; }
.rec-actions {
  display: flex; align-items: center; gap: 6px; padding: 6px 0 2px;
  flex-wrap: wrap;
}
.rec-actions select {
  padding: 3px 6px; border: 1px solid #D1D5DB; border-radius: 6px;
  font-size: 11px; font-family: 'DM Sans', sans-serif;
}
.rec-actions button {
  padding: 4px 10px; border-radius: 6px; border: none; font-size: 11px;
  font-weight: 700; font-family: 'DM Sans', sans-serif; cursor: pointer;
}
.rec-add-day { background: #111827; color: #fff; }
.rec-add-unsched { background: #F3F4F6; color: #374151; border: 1px solid #D1D5DB !important; }

/* ── Unscheduled bucket ── */
.unscheduled-section { padding: 14px 18px; border-top: 1px solid #E5E7EB; min-height: 60px; }
.unscheduled-title {
  font-size: 10px; font-weight: 700; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.unscheduled-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid #E5E7EB; border-radius: 8px; margin-bottom: 6px;
  background: #F9FAFB;
}
.unscheduled-card .stop-name { font-size: 13px; font-weight: 600; color: #111827; flex: 1; }

/* ── Map label overrides for week plan overlay ── */
.map-label {
  background: #fff; border: 1.5px solid rgba(0,0,0,0.15); border-radius: 6px;
  padding: 3px 8px; font-family: 'DM Sans', sans-serif; font-size: 12px;
  font-weight: 600; color: #111827; white-space: nowrap;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}
.map-label.visited { background: #166534; color: #fff; border-color: #166534; }
.map-label.anchor-lbl { background: #111827; color: #fff; border-color: #111827; }
.map-label.atrisk { background: #991B1B; color: #fff; border-color: #991B1B; }

/* Leaflet popup overrides for week plan */
.leaflet-popup-content-wrapper { border-radius: 10px !important; border: 1px solid #E5E7EB !important; box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important; }
.leaflet-popup-tip-container { display: none; }

/* ── CALL VIEW ── */
.call-view { display: none; flex-direction: column; }
[data-mode="call"] .call-view { display: flex; }

.call-week-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; background: #FFFBEB; border-bottom: 1px solid #FDE68A;
  font-size: 11px; font-weight: 700; color: #92400E; flex-shrink: 0;
}
.call-week-badge {
  background: #FEF3C7; border: 1px solid #FDE68A; border-radius: 20px;
  padding: 3px 10px; font-size: 10px; font-weight: 700; color: #92400E;
}

/* ── Call 5-column grid ── */
.call-grid-wrap { flex-shrink: 0; border-bottom: 2px solid #E5E7EB; }
.call-day-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.call-day-col { border-right: 1px solid #E5E7EB; display: flex; flex-direction: column; background: #F8F9FA; }
.call-day-col:last-child { border-right: none; }
.call-day-header { padding: 10px 12px 8px; background: #ffffff; border-bottom: 1px solid #E5E7EB; position: sticky; top: 0; z-index: 2; }
.call-day-name { font-weight: 700; font-size: 11px; color: #111827; text-transform: uppercase; letter-spacing: 0.5px; }
.call-day-date { font-size: 10px; color: #6B7280; margin-top: 1px; }
.call-stop-count { font-size: 10px; color: #6B7280; margin-top: 2px; }
.call-stops { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 5px; min-height: 100px; }

/* ── Call stop cards ── */
.call-card {
  background: #ffffff; border-radius: 7px; padding: 8px 9px;
  cursor: pointer; border: 1px solid #E5E7EB; transition: box-shadow 0.15s;
  position: relative;
}
.call-card > .stop-remove { position: absolute; top: 6px; right: 6px; }
.call-card:hover { box-shadow: 0 2px 7px rgba(0,0,0,0.08); }
.call-card.cc-done { border-left: 3px solid #16A34A !important; }
.call-card.cc-suggested { border-left: 3px solid #D97706 !important; background: #FFFBEB; }
.call-card.cc-skipped { opacity: 0.5; }
.cc-name { font-size: 11px; font-weight: 600; color: #111827; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-card.cc-done .cc-name { text-decoration: line-through; color: #9CA3AF; }
.call-card.cc-skipped .cc-name { text-decoration: line-through; color: #9CA3AF; }
.call-card.cc-suggested .cc-name { color: #92400E; }
.cc-meta { font-size: 9px; color: #6B7280; }
.call-card.cc-suggested .cc-meta { color: #92400E; }
.cc-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.cc-tag { font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: 20px; }
.cct-suggested { background: #FEF3C7; color: #92400E; }
.cct-skipped { background: #F3F4F6; color: #9CA3AF; }
.cct-attempted { background: #FEF3C7; color: #92400E; }
.cct-awaiting { font-size: 9px; color: #92400E; display: block; margin-top: 2px; }
.call-add-btn {
  margin: 0 6px 8px; padding: 6px; border-radius: 7px;
  border: 1.5px dashed #E5E7EB; background: transparent; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 600;
  color: #6B7280; text-align: center; width: calc(100% - 12px);
}
.call-add-btn:hover { border-color: #111827; color: #111827; background: #ffffff; }
.call-sections { flex: 1; overflow-y: auto; }

/* ── Unscheduled section ── */
.unscheduled-section { background: #ffffff; border-bottom: 1px solid #E5E7EB; }
.unscheduled-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: #FFFBEB; border-bottom: 1px solid #FDE68A;
}
.unscheduled-title { font-size: 12px; font-weight: 700; color: #92400E; }
.unscheduled-sub { font-size: 10px; color: #B45309; margin-top: 2px; }
.add-call-btn {
  padding: 6px 14px; border-radius: 6px; background: #ffffff;
  border: 1.5px solid #D97706; color: #D97706; font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.unscheduled-cards { display: flex; gap: 10px; padding: 12px 18px; flex-wrap: wrap; }
.unsched-card {
  background: #F8F9FA; border: 1px solid #E5E7EB; border-radius: 9px;
  padding: 9px 12px; cursor: grab; min-width: 180px;
  position: relative;
}
.unsched-card > .stop-remove { position: absolute; top: 6px; right: 6px; }
.unsched-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: #9CA3AF; }
.unsched-name { font-size: 12px; font-weight: 600; color: #111827; margin-bottom: 2px; }
.unsched-meta { font-size: 10px; color: #6B7280; }
.unsched-meta.at-risk { color: #DC2626; font-weight: 600; }
.drag-hint { font-size: 9px; color: #9CA3AF; margin-top: 5px; }

/* ── Suggestions ── */
.suggestions-section { background: #F8F9FA; padding: 14px 18px 18px; }
.suggestions-title { font-size: 12px; font-weight: 700; color: #111827; margin-bottom: 3px; }
.suggestions-sub { font-size: 10px; color: #6B7280; margin-bottom: 10px; }
.suggestion-cards { display: flex; flex-direction: column; gap: 6px; }
.suggestion-card {
  background: #ffffff; border: 1px solid #E5E7EB; border-radius: 9px;
  padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.suggestion-card.sgr-mgr { border-left: 3px solid #D97706 !important; background: #FFFBEB; }
.sg-name { font-size: 12px; font-weight: 600; color: #111827; margin-bottom: 4px; }
.suggestion-card.sgr-mgr .sg-name { color: #92400E; }
.ctx-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.ctx { font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.ctx-atrisk { background: #FEE2E2; color: #DC2626; }
.ctx-days { background: #F3F4F6; color: #6B7280; }
.ctx-task { background: #EFF6FF; color: #1D4ED8; }
.ctx-mgr { background: #FEF3C7; color: #92400E; }
.add-sg-btn {
  padding: 6px 14px; border-radius: 6px; background: #ffffff;
  border: 1.5px solid #E5E7EB; color: #111827; font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.add-sg-btn:hover { border-color: #111827; }

/* ── Call note modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 800; font-family: 'DM Sans', sans-serif; }
.modal-overlay.hidden { display: none; }
/* Mobile: the itinerary bottom sheet sits at z-index 8001, so the visit/call
   note modal has to stack above it or the rep sees nothing when opening it
   from the week plan. */
body.mobile .modal-overlay { z-index: 8500; }
@media (max-width: 768px) { .modal-overlay { z-index: 8500; } }
.modal-box { background: #ffffff; border-radius: 12px; width: 430px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow: hidden; }
.modal-header { padding: 16px 18px 14px; border-bottom: 1px solid #E5E7EB; display: flex; align-items: flex-start; justify-content: space-between; }
.modal-acct { font-weight: 700; font-size: 15px; color: #111827; }
.modal-ctx { font-size: 11px; color: #6B7280; margin-top: 2px; }
.modal-close { width: 28px; height: 28px; border-radius: 6px; border: none; background: #E5E7EB; color: #111827; cursor: pointer; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.modal-body { overflow-y: auto; padding: 16px 18px; }
.field-label { font-size: 10px; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; }
.type-row { display: flex; gap: 6px; margin-bottom: 12px; }
.type-btn { flex: 1; padding: 7px 4px; border-radius: 7px; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700; text-align: center; }
.type-btn.unselected { background: #ffffff; border: 2px solid #374151; color: #111827; }
.type-btn.selected { background: #111827; color: #ffffff; border: 2px solid #111827; }
.modal-textarea { width: 100%; border: 2px solid #374151; border-radius: 8px; padding: 10px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #111827; resize: none; background: #ffffff; line-height: 1.5; margin-bottom: 10px; }
.modal-textarea:focus { outline: none; border-color: #111827; }
.modal-date { width: 100%; border: 2px solid #374151; border-radius: 7px; padding: 7px 10px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #111827; background: #ffffff; margin-bottom: 10px; }
.notice { display: flex; align-items: center; gap: 6px; border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; font-size: 11px; }
.notice-green { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }
.notice-amber { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.modal-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.modal-save { flex: 1; padding: 9px; border-radius: 7px; border: none; cursor: pointer; background: #16A34A; color: #ffffff; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700; }
.modal-save:hover { opacity: 0.9; }
.modal-save.amber { background: #D97706; }
.modal-skip { padding: 9px 14px; border-radius: 7px; cursor: pointer; background: #ffffff; border: 2px solid #374151; color: #111827; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700; }
.hist-divider { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hist-divider span { font-size: 10px; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
.hist-divider::before, .hist-divider::after { content: ''; flex: 1; height: 1px; background: #E5E7EB; }
.hist-item { padding: 8px 0 8px 10px; border-left: 2px solid #D1D5DB; margin-bottom: 8px; }
.hist-meta { font-size: 10px; color: #6B7280; margin-bottom: 3px; }
.hist-text { font-size: 12px; color: #111827; line-height: 1.45; }

/* ── Panel Footer ── */
.panel-footer {
  padding: 10px 18px; border-top: 1px solid #E5E7EB; background: #ffffff;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.autosave-txt { font-size: 11px; color: #6B7280; }
.saved-btn {
  padding: 6px 18px; border-radius: 7px; border: 1.5px solid #E5E7EB;
  background: #ffffff; font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 700; color: #111827; cursor: default;
}

/* ── Confirm dialog ── */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 900; font-family: 'DM Sans', sans-serif; }
.confirm-overlay.hidden { display: none; }
.confirm-box { background: #ffffff; border-radius: 12px; padding: 24px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.confirm-title { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.confirm-body { font-size: 13px; color: #6B7280; line-height: 1.55; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-cancel { padding: 8px 18px; border-radius: 7px; border: 1.5px solid #E5E7EB; background: #ffffff; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; color: #111827; }
.confirm-proceed { padding: 8px 18px; border-radius: 7px; border: none; background: #111827; color: #ffffff; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; }


/* ═══════════════════════════════════════════════════════════════════════════
   CALL LIST VIEW
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   PAST REVIEWS MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.pr-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.pr-panel {
  background: #F8F9FA; border-radius: 14px; width: 95vw; max-width: 900px;
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.pr-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: #fff; border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0; position: sticky; top: 0; z-index: 10;
}
.pr-header-left { display: flex; align-items: center; gap: 12px; }
.pr-header-left a { color: #6B7280; font-size: 12px; text-decoration: none; font-weight: 600; }
.pr-header-left a:hover { color: #111827; }
.pr-title { font-size: 15px; font-weight: 700; color: #111827; }
.pr-header-right { display: flex; align-items: center; gap: 10px; }
.pr-filter {
  padding: 4px 10px; border: 1px solid #E5E7EB; border-radius: 6px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: #111827; background: #fff;
}
.pr-close {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid #E5E7EB;
  background: #fff; font-size: 16px; color: #6B7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pr-close:hover { border-color: #111827; color: #111827; }
.pr-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

/* Rep selector cards (manager) */
.pr-rep-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.pr-rep-card {
  flex: 1; min-width: 220px; background: #fff; border: 2px solid #E5E7EB;
  border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: all 0.15s;
}
.pr-rep-card:hover { border-color: #9CA3AF; }
.pr-rep-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pr-rep-initials {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.pr-rep-name { font-weight: 700; font-size: 14px; color: #111827; }
.pr-rep-territory { font-size: 11px; color: #6B7280; }

/* Ongoing context */
.pr-context-band {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 16px;
}
.pr-context-label {
  font-size: 10px; font-weight: 700; color: #6B7280; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px;
}
.pr-context-content { font-size: 13px; line-height: 1.6; color: #111827; }
.pr-context-content p { margin-bottom: 8px; }

/* Week cards */
.pr-week-card {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 10px;
  margin-bottom: 10px; overflow: hidden;
}
.pr-week-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; user-select: none; transition: background 0.1s;
}
.pr-week-header:hover { background: #F9FAFB; }
.pr-week-range { font-size: 13px; font-weight: 700; color: #111827; }
.pr-week-pills { display: flex; align-items: center; gap: 8px; }
.pr-week-type-pill {
  font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.pr-pill-travel { background: #EFF6FF; color: #1D4ED8; }
.pr-pill-call { background: #F0FDF4; color: #15803D; }
.pr-chevron { color: #9CA3AF; font-size: 12px; transition: transform 0.15s; }
.pr-chevron.open { transform: rotate(90deg); }
.pr-week-body { display: none; padding: 0 16px 16px; }
.pr-week-body.open { display: block; }

/* Section labels inside expanded week */
.pr-section-label {
  font-size: 10px; font-weight: 700; color: #6B7280; text-transform: uppercase;
  letter-spacing: 0.5px; margin: 14px 0 8px; display: flex; align-items: center; gap: 6px;
}
.pr-section-label:first-child { margin-top: 0; }

/* Mini grid for week activity */
.pr-mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.pr-mini-col-header {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: #6B7280; margin-bottom: 4px;
}
.pr-mini-card {
  background: #F8F9FA; border-radius: 6px; padding: 6px 8px; border: 1px solid #E5E7EB;
  border-left-width: 1px; font-size: 10px; margin-bottom: 4px;
}
.pr-mini-card.mc-anchor { border-left: 3px solid #111827 !important; }
.pr-mini-card.mc-done { border-left: 3px solid #16A34A !important; }
.pr-mini-card.mc-mgr { border-left: 3px solid #D97706 !important; background: #FFFBEB; }
.pr-mini-card.mc-skipped { opacity: 0.5; }
.pr-mini-card-name {
  font-weight: 600; color: #111827; margin-bottom: 1px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-size: 10px;
}
.pr-mini-card.mc-done .pr-mini-card-name,
.pr-mini-card.mc-skipped .pr-mini-card-name { text-decoration: line-through; color: #9CA3AF; }
.pr-mini-card.mc-mgr .pr-mini-card-name { color: #92400E; }
.pr-mini-card-city { font-size: 8px; color: #6B7280; }
.pr-mini-tag {
  font-size: 7px; font-weight: 700; padding: 1px 4px; border-radius: 10px;
  margin-top: 2px; display: inline-block;
}
.pr-mt-anchor { background: #111827; color: #fff; }
.pr-mt-done { background: #DCFCE7; color: #15803D; }
.pr-mt-mgr { background: #FEF3C7; color: #92400E; }
.pr-mt-skipped { background: #F3F4F6; color: #9CA3AF; }
.pr-empty-day { font-size: 10px; color: #9CA3AF; padding: 6px 8px; }

/* Manager notes read-only */
.pr-notes-content { font-size: 13px; line-height: 1.6; color: #111827; }
.pr-notes-content p { margin-bottom: 8px; }
.pr-notes-empty { font-size: 12px; color: #9CA3AF; font-style: italic; }

/* My Notes rich text editor (in modal and itinerary panel) */
.pr-rte-wrap { border: 1px solid #E5E7EB; border-radius: 8px; overflow: hidden; margin-top: 6px; }
.pr-rte-toolbar {
  display: flex; gap: 2px; padding: 4px 8px; border-bottom: 1px solid #E5E7EB; background: #F9FAFB;
}
.pr-rte-btn {
  padding: 3px 8px; border-radius: 4px; border: none; background: transparent;
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 11px; color: #111827; font-weight: 600;
}
.pr-rte-btn:hover { background: #E5E7EB; }
.pr-rte-sep { width: 1px; background: #E5E7EB; margin: 2px 4px; }
.pr-rte-content {
  padding: 10px 12px; min-height: 80px; font-size: 13px; line-height: 1.5;
  color: #111827; outline: none; font-family: 'DM Sans', sans-serif;
}
.pr-save-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.pr-save-dot.saved { background: #16A34A; }
.pr-save-dot.saving { background: #D97706; animation: prPulse 0.8s ease-in-out infinite alternate; }
@keyframes prPulse { from { opacity: 1; } to { opacity: 0.4; } }
.pr-save-label { font-size: 10px; color: #6B7280; margin-left: 4px; }

/* ── My Notes in itinerary panel ── */
.wp-my-notes-section { padding: 14px 18px 96px; border-top: 1px solid #E5E7EB; }
.wp-my-notes-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.wp-my-notes-label {
  font-size: 10px; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: 0.5px;
}
.wp-my-notes-save { display: flex; align-items: center; }

/* ── Contacts tab ── */
.ct-card {
  border: 1px solid #E5E7EB; border-radius: 8px; padding: 10px 12px;
  margin-bottom: 6px; background: #fff;
}
.ct-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ct-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #E5E7EB;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #6B7280; flex-shrink: 0;
}
.ct-card-info { flex: 1; min-width: 0; }
.ct-name { font-size: 13px; font-weight: 700; color: #111827; }
.ct-title { font-size: 11px; color: #6B7280; }
.ct-inactive-badge {
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
  background: #F3F4F6; color: #9CA3AF; margin-left: 4px;
}
.ct-edit-btn {
  padding: 3px 8px; border-radius: 20px; border: 1px solid #E5E7EB;
  background: #fff; font-size: 10px; font-weight: 600; color: #6B7280;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.ct-edit-btn:hover { border-color: #111827; color: #111827; }
.ct-card-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.ct-link {
  font-size: 11px; color: #2563EB; text-decoration: none;
  display: inline-flex; align-items: center; gap: 3px;
}
.ct-link:hover { text-decoration: underline; }
.ct-notes { font-size: 11px; color: #6B7280; margin-top: 4px; line-height: 1.4; }
.ct-card-footer { margin-top: 6px; }
.ct-toggle-btn {
  padding: 2px 8px; border-radius: 20px; border: 1px solid #E5E7EB;
  background: #fff; font-size: 9px; font-weight: 600; color: #9CA3AF;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.ct-toggle-btn:hover { border-color: #DC2626; color: #DC2626; }
.ct-add-btn {
  display: block; width: 100%; padding: 8px; border-radius: 8px;
  border: 1.5px dashed #E5E7EB; background: transparent;
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600;
  color: #6B7280; cursor: pointer; margin-top: 8px; text-align: center;
}
.ct-add-btn:hover { border-color: #111827; color: #111827; }
.ct-form {
  border: 1px solid #E5E7EB; border-radius: 8px; padding: 12px;
  margin-top: 8px; background: #F9FAFB;
}
.ct-form-title { font-size: 12px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.ct-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ct-input {
  width: 100%; padding: 6px 8px; border: 1px solid #E5E7EB; border-radius: 6px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: #111827;
  outline: none; margin-bottom: 6px;
}
.ct-input:focus { border-color: #2563EB; }
.ct-textarea { min-height: 50px; resize: vertical; }
.ct-form-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.ct-cancel-btn {
  padding: 5px 12px; border-radius: 6px; border: 1px solid #E5E7EB;
  background: #fff; font-family: 'DM Sans', sans-serif; font-size: 11px;
  font-weight: 600; color: #6B7280; cursor: pointer;
}
.ct-save-btn {
  padding: 5px 12px; border-radius: 6px; border: none;
  background: #111827; font-family: 'DM Sans', sans-serif; font-size: 11px;
  font-weight: 600; color: #fff; cursor: pointer;
}
.ct-save-btn:hover { background: #374151; }

/* ── OPEN ACTIVITY (account popup) ───────────────────────────────────────── */
.popup-open-activity {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.popup-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 7px;
}
.oa-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.oa-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.oa-pill-order { background: #EFF6FF; color: #1D4ED8; }
.oa-pill-quote { background: #F5F3FF; color: #5B21B6; }
.oa-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 6px 0 4px;
}
.oa-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.oa-item:last-child { border-bottom: none; }
.oa-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.oa-item-desc {
  font-size: 12px;
  color: var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.oa-item-status {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.oa-status-order { background: #EFF6FF; color: #1D4ED8; }
.oa-status-quote { background: #F5F3FF; color: #5B21B6; }
.oa-item-total {
  font-size: 12px;
  font-weight: 700;
  color: var(--body);
  flex-shrink: 0;
}
.oa-loading { font-size: 11px; color: var(--muted); padding: 4px 0; }
.oa-error   { font-size: 11px; color: var(--error);  padding: 4px 0; }

/* ── SALES TAB TOGGLE & OPEN ACTIVITY TABLE ──────────────────────────────── */
.sales-tab-toggle { display: flex; gap: 6px; margin-bottom: 14px; }
.sales-toggle-btn { flex: 1; padding: 6px 10px; border-radius: 6px; border: 1.5px solid var(--border); background: var(--white); font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.sales-toggle-btn.active { background: var(--body); color: var(--white); border-color: var(--body); }
.oa-badge { background: var(--red); color: white; border-radius: 10px; padding: 1px 6px; font-size: 10px; font-weight: 700; margin-left: 4px; }
.sales-toggle-btn.active .oa-badge { background: rgba(255,255,255,0.25); }
.oa-section { margin-bottom: 16px; }
.oa-section-header { font-size: 11px; font-weight: 700; color: var(--body); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.oa-count { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; font-size: 10px; color: var(--muted); font-weight: 600; }
.oa-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.oa-table th { text-align: left; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.oa-table td { padding: 6px 6px; border-bottom: 1px solid var(--bg); color: var(--body); vertical-align: top; font-size: 11px; }
.oa-table tr:last-child td { border-bottom: none; }

/* ─── Task Complete Modal ─────────────────────────────────────────────────── */
.task-complete-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  font-family: 'DM Sans', sans-serif;
}
.task-complete-modal {
  background: #fff; width: 400px; max-width: 92vw; border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18); padding: 24px;
}
.task-complete-modal .tcm-header {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px;
}
.task-complete-modal .tcm-title { font-size: 14px; font-weight: 700; color: #111827; }
.task-complete-modal .tcm-acct { font-size: 11px; color: #6B7280; margin-top: 2px; }
.task-complete-modal .tcm-close {
  width: 28px; height: 28px; border-radius: 6px; border: none; background: #E5E7EB;
  color: #111827; cursor: pointer; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.task-complete-modal .tcm-due-bar {
  font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px; margin-bottom: 12px;
}
.task-complete-modal .tcm-due-bar.overdue { background: #FCEBEB; color: #A32D2D; }
.task-complete-modal .tcm-due-bar.future { background: var(--bg, #f5f5f3); color: #374151; }
.task-complete-modal .tcm-label { font-size: 11px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.task-complete-modal .tcm-select {
  width: 100%; padding: 8px 10px; border: 1px solid #D1D5DB; border-radius: 6px;
  font-size: 13px; font-family: 'DM Sans', sans-serif; margin-bottom: 12px; background: #fff;
}
.task-complete-modal .tcm-textarea {
  width: 100%; border: 1px solid #D1D5DB; border-radius: 6px; padding: 10px;
  font-size: 13px; font-family: 'DM Sans', sans-serif; resize: none; height: 80px;
  box-sizing: border-box; margin-bottom: 12px;
}
.task-complete-modal .tcm-textarea:focus { outline: none; border-color: #111827; }
.task-complete-modal .tcm-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
}
.task-complete-modal .tcm-error {
  font-size: 11px; color: #DC2626; margin-right: auto;
}
.task-complete-modal .tcm-cancel {
  background: transparent; border: 1px solid #D1D5DB; border-radius: 6px;
  padding: 6px 14px; font-size: 12px; cursor: pointer; color: #374151;
  font-family: 'DM Sans', sans-serif;
}
.task-complete-modal .tcm-submit {
  background: #1a1a18; color: #fff; border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: opacity 0.15s;
}
.task-complete-modal .tcm-submit:disabled { opacity: 0.4; cursor: default; }

/* ═══════════════════════════════════════════════════════════════════════════════
   Slide-in stop detail panel — shared by travel + home week
   ═══════════════════════════════════════════════════════════════════════════════ */
#wp-travel-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
#wp-stop-detail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 20;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
#wp-stop-detail.open {
  transform: translateX(0);
}

.wpsd-head { background: var(--header-bg); padding: 10px 14px; flex-shrink: 0; }
.wpsd-back { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 12px; cursor: pointer; padding: 0 0 6px; display: block; font-family: inherit; }
.wpsd-back:hover { color: #fff; }
.wpsd-title { font-size: 13px; font-weight: 600; color: #fff; }
.wpsd-subtitle { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }
.wpsd-jarvis-ctx { font-size: 10px; color: rgba(255,120,80,0.75); margin-top: 5px; display: none; }
.wpsd-jarvis-ctx.visible { display: block; }

.wpsd-tabs { display: flex; background: var(--bg-soft); border-bottom: 1px solid var(--color-border-tertiary); flex-shrink: 0; }
.wpsd-tab { flex: 1; text-align: center; font-size: 12px; padding: 8px 0; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; }
.wpsd-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.wpsd-body { flex: 1; overflow-y: auto; padding: 12px 14px; font-size: 12px; }
.wpsd-contact { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.wpsd-avatar { width: 30px; height: 30px; border-radius: 50%; background: #E6F1FB; color: #185FA5; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wpsd-contact-name { font-weight: 600; color: var(--text); font-size: 12px; }
.wpsd-contact-detail { font-size: 11px; color: var(--text-light); line-height: 1.6; }
.wpsd-hist-entry { padding: 8px 0; border-bottom: 1px solid #f2f2f2; cursor: pointer; }
.wpsd-hist-date { font-size: 10px; color: var(--text-light); margin-bottom: 2px; }
.wpsd-hist-text { font-size: 11px; color: var(--text); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wpsd-hist-entry.expanded .wpsd-hist-text { -webkit-line-clamp: unset; display: block; }
.wpsd-hist-expand { font-size: 10px; color: var(--brand); margin-top: 2px; }
.wpsd-prep-area { width: 100%; font-size: 12px; border: 1px solid var(--sidebar-border); border-radius: 5px; padding: 8px; resize: none; font-family: inherit; min-height: 100px; color: var(--text); box-sizing: border-box; }
.wpsd-prep-hint { font-size: 10px; color: var(--text-light); margin-top: 4px; }

.wpsd-actions { padding: 10px 14px; border-top: 1px solid var(--color-border-tertiary); flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
.wpsd-act-primary { background: #16A34A; color: #fff; border: none; border-radius: 5px; padding: 8px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.wpsd-act-primary:hover { filter: brightness(0.9); }
.wpsd-act { background: #fff; color: var(--text-muted); border: 1px solid var(--color-border-secondary); border-radius: 5px; padding: 7px; font-size: 11px; cursor: pointer; font-family: inherit; }
.wpsd-act:hover { background: var(--bg-soft); }

.stop-card-row.wpsd-active { border-left: 3px solid var(--brand) !important; background: #fafafa; }

@media (max-width: 768px) {
  body:not(.field-mode) #wp-stop-detail { display: none !important; }
  /* Reserve space for the field-mode nav stack:
     wp-mobile-tab-strip (48px) + jarvis-bottom-nav (48px) + iOS safe-area */
  body.field-mode #wp-stop-detail {
    height: calc(100% - 96px - env(safe-area-inset-bottom, 0px));
  }
}
