/* effective.report shared theme — dark default, light via html[data-theme="light"] */

/* Palette-independent tokens. */
:root {
  --radius: 12px;
  --radius-sm: 8px;
  --ease: 160ms ease;
}

/* Dark is the default for every report. `:root` also covers no-JS / pre-bootstrap paint. */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f0ec;
  --muted: #9aafa4;
  --line: #2c3c35;
  --line-soft: #1e2a25;
  --paper: #0f1613;
  --paper-top: #121c18;
  --panel: #17201c;
  --panel-2: #1c2823;
  --accent: #3dba84;
  --accent-hover: #56d09a;
  --accent-soft: #1a3228;
  --accent-ring: rgba(61, 186, 132, 0.35);
  --accent-on: #0a1210;
  --err: #ff8a80;
  --err-soft: #3a1f1f;
  --warn: #e0b35a;
  --warn-soft: #3a3018;
  --phase: #7eb6e0;
  --phase-soft: #1a2834;
  --urgent: #ff8a80;
  --urgent-soft: #3a1f1f;
  --ok: #3dba84;
  --ok-soft: #1a3228;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(15, 22, 19, 0.92);
  --input-bg: #121a17;
  --chip-bg: rgba(23, 32, 28, 0.9);

  /* Dashboard aliases (legacy names) */
  --bg: var(--paper);
  --surface: var(--panel);
  --surface2: var(--panel-2);
  --border: var(--line);
  --text: var(--ink);
  --accent-dim: var(--accent-hover);
  --high: #ff8a80;
  --normal: #e0b35a;
  --low: #7dcea0;
  --open: var(--accent);
  --in_progress: #e0b35a;
  --done: var(--ok);
  --attention_needed: #e0a050;
  --response_required: #ff8a80;
  --action_required: #ff8a80;
  --fyi: var(--muted);
  --waiting: #b39ddb;
  --follow_up_needed: #64b5f6;
  --completed: var(--ok);
  --sent: #7dcea0;
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #101a16;
  --muted: #5b6c65;
  --line: #dde5e0;
  --line-soft: #eef2ef;
  --paper: #f2f5f3;
  --paper-top: #e8f1ec;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --accent: #0f6b4c;
  --accent-hover: #0c5840;
  --accent-soft: #e6f3ec;
  --accent-ring: rgba(15, 107, 76, 0.28);
  --accent-on: #ffffff;
  --err: #9b2c2c;
  --err-soft: #f8e8e8;
  --warn: #8f5610;
  --warn-soft: #f7efdf;
  --phase: #1a4a6e;
  --phase-soft: #e8f0f6;
  --urgent: #9b2c2c;
  --urgent-soft: #f8e8e8;
  --ok: #0f6b4c;
  --ok-soft: #e6f3ec;
  --shadow: 0 1px 2px rgba(16, 26, 22, 0.04), 0 10px 28px rgba(16, 26, 22, 0.05);
  --header-bg: rgba(255, 255, 255, 0.86);
  --input-bg: #fafcfb;
  --chip-bg: rgba(255, 255, 255, 0.85);

  --bg: var(--paper);
  --surface: var(--panel);
  --surface2: var(--panel-2);
  --border: var(--line);
  --text: var(--ink);
  --accent-dim: var(--accent-hover);
  --high: #c23b3b;
  --normal: #b8860b;
  --low: #3d8b5a;
  --open: var(--accent);
  --in_progress: #b8860b;
  --done: var(--ok);
  --attention_needed: #c47a1a;
  --response_required: #c23b3b;
  --action_required: #c23b3b;
  --fyi: var(--muted);
  --waiting: #6b5b95;
  --follow_up_needed: #2a6f97;
  --completed: var(--ok);
  --sent: #3d8b5a;
}

/* Shared chrome */
.er-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: 600 0.78rem/1 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.er-session-bar {
  position: sticky;
  top: 0;
  z-index: 10050;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 8px 14px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  font: 600 12px/1.2 "DM Sans", system-ui, sans-serif;
  background: var(--header-bg, rgba(15, 22, 19, 0.92));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
html {
  --er-session-bar-h: 48px;
}
body:has(.er-session-bar) {
  --er-session-bar-h: 48px;
}
.er-session-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 8px;
  font-weight: 500;
}
.er-session-logout {
  background: var(--accent);
  color: var(--accent-on);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
}
.er-session-logout:hover { background: var(--accent-hover); }
.er-theme-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9998;
}
