@font-face {
  font-family: 'Inter';
  src: url('/static/inter/Inter.woff2') format('woff2');
  font-weight: 300 800; font-display: swap;
}
:root {
  --dark: #0F1923; --dark2: #162230; --dark3: #1C2D3F;
  --accent: #00C896; --accent-dim: #00A87D; --accent-glow: rgba(0,200,150,0.12);
  --red: #FF6B6B; --yellow: #FFD93D; --light: #F4F7FA; --muted: #7A8FA6; --slate: #64748B;
  /* Pipeline "Booked" — a step short of Met, so it sits between the accent green and the
     yellow of Open. Chosen to stay legible on both the light (#F4F7FA) and dark (#0F1923)
     grounds, and to remain distinguishable from --accent for red-green colour blindness. */
  --blue: #4EA8DE;
}
[data-theme="dark"] {
  --bg: var(--dark); --bg2: var(--dark2); --bg3: var(--dark3);
  --text: #fff; --text2: var(--muted); --border: rgba(255,255,255,0.08);
}
[data-theme="light"] {
  --bg: var(--light); --bg2: #fff; --bg3: #E8ECF1;
  --text: var(--dark); --text2: #5A6B7D; --border: rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); }
/* Centered header: utility (theme/logout) pinned top-right, then brand lockup, welcome, and
   two centered control rows (accounts, then date range). */
.header { position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 20px 32px; border-bottom: 1px solid var(--border); }
.header-utility { position: absolute; top: 16px; right: 24px; z-index: 5;
  display: flex; align-items: center; gap: 8px; }
.brand-row { display: flex; justify-content: center; align-items: center; }
/* Logo lockup (Neural node): gradient tile with a connected-node network, wordmark below,
   "INTELLIGENCE" as a spaced product tag. Centered stack. */
.logo { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.logo-mark { display: inline-flex; flex: 0 0 auto; position: relative; }
.logo-mark svg { display: block; border-radius: 12px; position: relative; z-index: 1; }
.logo-mark.glow::before { content: ""; position: absolute; inset: -10px; z-index: 0; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent); }
.logo-word { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.logo .wordmark { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); line-height: 1; }
.logo .wordmark .brand-accent { color: var(--accent); }
.logo .brand-int { font-size: 10.5px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase;
  color: var(--text2); }
.env-badge { font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 3px 8px;
  border-radius: 4px; background: var(--yellow); color: #1a1a1a; text-transform: uppercase; }
/* Centered greeting: sits between the brand lockup and the controls. A hairline rule under
   it separates the brand block from the filter row. */
.dash-welcome { text-align: center; font-size: 19px; letter-spacing: -0.2px; line-height: 1.2;
  padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dash-welcome .w-hi { color: var(--text2); font-weight: 400; }
.dash-welcome .w-name { color: var(--text); font-weight: 700; }
/* Each control row is centered; row 1 = account switcher, row 2 = date range + source. */
.ctrl-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px; row-gap: 8px; }
.btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; text-decoration: none;
  font-size: 12px; font-weight: 500; transition: all 0.2s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.content { max-width: 1100px; margin: 0 auto; padding: 48px 32px; }
.welcome-h { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.welcome-sub { color: var(--text2); margin-top: 8px; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px; margin-top: 28px; }
.loc-switch { display: inline-flex; gap: 4px; padding: 3px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 9px; }
.loc-switch-item { padding: 5px 12px; border-radius: 6px; color: var(--text2);
  text-decoration: none; font-size: 12px; font-weight: 500; white-space: nowrap; transition: all .15s; }
.loc-switch-item:hover { color: var(--text); }
.loc-switch-item.is-active { background: var(--accent); color: var(--dark); font-weight: 600; }
/* The switcher is one unbreakable inline-flex row, so a multi-location owner pushed it far past
   a phone viewport (854px at 6 accounts → 233px of horizontal page scroll on a 390px screen),
   and the ACTIVE chip landed off-screen left — you could not see which client you were viewing
   without scrolling sideways first. Wrapping keeps every account visible and the page at
   viewport width. Verified via headless-Chrome device emulation: overflow 233px → 0 at 390/375/360. */
@media (max-width: 820px) {
  .loc-switch { flex-wrap: wrap; justify-content: center; }
}

/* ---------- First-run guided tour (built by static/tour.js) ----------
   The overlay dims + blocks the page; the current step's element is lifted above the overlay
   (.vl-tour-spot raises z-index) so it reads as "lit" with an accent ring while everything else
   is dimmed. The tooltip is positioned by JS on desktop; on phones the media query below pins it
   as a bottom sheet. No inline styles are required for any of this — CSP-safe. */
.vl-tour-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(8, 15, 22, 0.66);
}
.vl-tour-spot {
  position: relative; z-index: 10000;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 8px var(--accent-glow), 0 12px 40px rgba(0,0,0,0.35);
  border-radius: 16px;
}
.vl-tour-tip {
  position: fixed; z-index: 10001; width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: vl-tour-in 0.18s ease;
}
.vl-tour-list {
  list-style: none; margin: 11px 0 0; display: flex; flex-direction: column; gap: 7px;
}
.vl-tour-list li {
  font-size: 13px; line-height: 1.45; color: var(--text2); position: relative; padding-left: 15px;
}
.vl-tour-list li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.vl-tour-list li b { color: var(--text); font-weight: 700; }
.vl-tour-count {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.vl-tour-title { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; margin-top: 6px; }
.vl-tour-body { font-size: 13.5px; line-height: 1.5; color: var(--text2); margin-top: 8px; }
.vl-tour-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px;
}
.vl-tour-nav { display: flex; gap: 8px; }
.vl-tour-skip {
  background: none; border: none; color: var(--text2); font-family: inherit;
  font-size: 12px; cursor: pointer; padding: 6px 2px; text-decoration: underline;
}
.vl-tour-skip:hover { color: var(--text); }
.vl-tour-btn {
  border: 1px solid var(--border); background: var(--bg3); color: var(--text);
  font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px;
  border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.vl-tour-btn:hover { border-color: var(--accent); }
.vl-tour-btn.is-primary { background: var(--accent); border-color: var(--accent); color: var(--dark); }
.vl-tour-btn.is-primary:hover { background: var(--accent-dim); }
@keyframes vl-tour-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 620px) {
  /* Bottom sheet on phones — pin to the lower edge so it never covers the spotlighted card, and
     override any inline left/top JS set for the desktop floating position. */
  .vl-tour-tip {
    left: 16px !important; right: 16px !important; bottom: 16px !important;
    top: auto !important; width: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vl-tour-tip { animation: none; }
}
