/* Shared across every routed view (Activity Log, Prospect List, Prospect Map, Engagement Hub).
   One copy instead of four -- the "Mark Not Interested" bug earlier (missing CSS in 2 of 4
   copy-pasted files) is exactly the class of bug this file exists to prevent. */

/* ===================== Theme tokens (light default / dark override) =====================
   Every recurring brand color across all 6 CSS sources (this file, the 4 view-*.css files,
   and index.html's own <style> block) was converted from a literal hex/rgba value to one of
   these 6 tokens -- rgb(var(--c-x)) in place of a bare hex, rgba(var(--c-x), N) in place of
   rgba(33,30,25,N)-style opacity variants. That's what makes the dark-mode toggle (Settings ->
   Dark mode, wired in saevo-shared.js) actually repaint the whole app: it just flips these 6
   variables via [data-theme="dark"] on <html>, and every rule built on them follows for free,
   with no per-selector dark-mode CSS needed anywhere else.
   --c-ink and --c-cream intentionally swap roles in dark mode (ink goes light, cream goes
   near-black) rather than just darkening in place -- that's what makes a low-opacity
   rgba(var(--c-ink), 0.15) hairline border correctly become a faint LIGHT line on a dark
   surface instead of an invisible dark-on-dark one, with zero rule-by-rule special-casing. */
:root {
  --c-ink: 33, 30, 25;        /* was #211E19 -- primary text / hairline borders */
  --c-cream: 244, 241, 234;   /* was #F4F1EA -- page background / surface washes */
  --c-accent: 181, 86, 46;    /* was #B5562E -- primary brand accent */
  --c-accent-2: 196, 120, 79; /* was #C4784F -- secondary/lighter accent */
  --c-danger: 192, 57, 43;    /* was #C0392B -- error/destructive */
  --c-success: 62, 207, 110;  /* was #3ecf6e -- online/success */
  --c-surface: 216, 214, 210; /* was #D7D5D1/#DCDCDC -- neutral panel-on-page surfaces */
  --c-row: 242, 194, 155;     /* was #F2C29B -- peach card/row fill (activity rows, table cells,
                                 profile-id-card, notes box, kanban cards) */
}
:root[data-theme="dark"] {
  --c-ink: 237, 233, 224;
  /* Charcoal, not near-black -- was 22,20,17 (read as flat-out black). --c-surface is kept one
     clear step lighter than this so panel-on-page contrast doesn't collapse now that the page
     itself is lighter. */
  --c-cream: 38, 35, 32;
  --c-accent: 224, 130, 82;
  --c-accent-2: 214, 150, 112;
  --c-danger: 224, 100, 86;
  /* The light-mode peach (242,194,155) carried over unchanged read as glaringly bright against
     a dark page -- this is the same hue pulled way down in lightness instead. */
  --c-row: 92, 61, 40;
  --c-success: 78, 214, 128;
  --c-surface: 58, 54, 49;
}

/* Type, radius, and shadow scale -- the other half of the modernization pass alongside the
   color tokens above. --font-display is the warm serif reserved for headings/titles/big stat
   numbers (index.html's <style> loads Fraunces/Manrope from Google Fonts and sets Manrope as
   the base body font -- this variable is just the second half of that pairing, usable from any
   of the 6 CSS sources without re-declaring the font stack each time). The radius scale
   replaces what used to be an inconsistent mix of 4/6/8/10/12/14px scattered per-component. */
:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  /* Ink-tinted dark shadows -- read as real elevation against the light-mode cream page. */
  --shadow-sm: 0 1px 3px rgba(var(--c-ink), 0.12), 0 1px 2px rgba(var(--c-ink), 0.08);
  --shadow-md: 0 4px 16px rgba(var(--c-ink), 0.14), 0 2px 6px rgba(var(--c-ink), 0.08);
  --shadow-lg: 0 12px 32px rgba(var(--c-ink), 0.18), 0 4px 12px rgba(var(--c-ink), 0.1);
}

/* A dark ink-tinted shadow barely reads against an already-dark page -- ink ITSELF flips light
   in dark mode, so the light-mode shadow recipe above would render as a faint light haze
   instead of visible depth. Dark mode gets its own recipe instead: a real black shadow for
   actual cast-depth (surfaces here aren't uniformly dark, so this alone does show), plus a
   soft orange glow on top so elevated things still clearly pop the way they do in light mode. */
:root[data-theme="dark"] {
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 8px rgba(var(--c-accent), 0.18);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 18px rgba(var(--c-accent), 0.22);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 30px rgba(var(--c-accent), 0.28);
}

/* Safety net so an overscroll bounce or a flash before a view's own .bg paints never shows
   raw white behind a dark theme -- every view's .bg already carries this same color itself. */
body { background: rgb(var(--c-cream)); }

/* Task notification -- a small rounded card that slides in from the right edge, sits for 4s,
   then slides back out. Docked at the same top offset as .phone-status ("Online") so it reads
   as belonging to that same top-right strip, sitting just above the header icon-button row.
   One instance, injected once by injectTaskToast() and reused for every call to showTaskToast()
   -- see saevo-shared.js. Deliberately NOT the dashboard's own big .toast (bottom-center, built
   for the email-campaign chart specifically) -- this is its own thing, used on all 5 pages. */
.saevo-task-toast {
  position: fixed;
  top: 14px;
  right: 24px;
  z-index: 6000;
  max-width: 280px;
  background: rgb(var(--c-cream));
  border-left: 3px solid rgb(var(--c-accent));
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(var(--c-ink), 0.28);
  padding: 10px 16px 12px;
  transform: translateX(140%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
  pointer-events: none;
}
.saevo-task-toast.visible {
  transform: translateX(0);
  opacity: 1;
}
.saevo-task-toast.clickable.visible {
  pointer-events: auto;
  cursor: pointer;
}
.saevo-task-toast.clickable.visible:hover {
  box-shadow: 0 12px 32px rgba(var(--c-ink), 0.36);
}
.saevo-task-toast-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgb(var(--c-accent));
  margin-bottom: 3px;
}
.saevo-task-toast-text {
  font-size: 12.5px;
  line-height: 1.4;
  color: rgb(var(--c-ink));
}

.stage-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(var(--c-ink), 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.stage-confirm-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.stage-confirm-box {
  width: 320px;
  background: rgb(var(--c-cream));
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}
.stage-confirm-message {
  font-size: 15px;
  color: rgb(var(--c-ink));
  margin-bottom: 18px;
  line-height: 1.4;
}
.stage-confirm-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(var(--c-ink),0.75);
  cursor: pointer;
}
.stage-confirm-toggle-row input { cursor: pointer; }
.stage-confirm-warning {
  font-size: 11.5px;
  color: rgb(var(--c-accent));
  margin: 8px 0 0;
  display: none;
}
.stage-confirm-warning.visible { display: block; }
.stage-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.stage-confirm-actions button {
  flex: 1 1 50%;
  padding: 9px 0;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}
.stage-confirm-cancel {
  background: transparent;
  border: 1.5px solid rgba(var(--c-ink),0.3);
  color: rgb(var(--c-ink));
}
.stage-confirm-cancel:hover { background: rgba(var(--c-ink),0.06); }
.stage-confirm-ok {
  background: rgb(var(--c-accent-2));
  border: none;
  color: #ffffff;
}
.stage-confirm-ok:hover { background: rgb(var(--c-accent)); }
