/* Game Plan — the narrative landing panel on /dept/sales (?tab=plan).
 * One hero strip (where you stand), one prescribed-action list (do this
 * next), and the five-pillar loop (the mental model + navigation).
 * Island: static/js/sales_gameplan.js, fed by /api/dept/sales/gameplan. */

.sgp-root { display: flex; flex-direction: column; gap: 18px; }

.sgp-loading, .sgp-error {
  padding: 48px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px;
}
.sgp-error { color: var(--danger, #dc2626); }

/* ── Hero: where you stand ─────────────────────────────────────────── */
.sgp-hero {
  border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.07), rgba(139,92,246,0.05));
  padding: 22px 24px;
}
.sgp-hero-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sgp-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent, #3b82f6); margin-bottom: 6px;
}
.sgp-title { font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1.25; }
.sgp-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; max-width: 560px; line-height: 1.5; }
.sgp-scope-pill {
  display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  background: rgba(59,130,246,0.12); color: var(--accent, #3b82f6);
}
.sgp-hero-stats { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.sgp-stat { min-width: 110px; }
.sgp-stat .v { font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.sgp-stat .v.pos { color: var(--success, #16a34a); }
.sgp-stat .v.neg { color: var(--danger, #dc2626); }
.sgp-stat .l { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }

/* ── Next actions: do this, in this order ──────────────────────────── */
.sgp-actions {
  border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  background: var(--bg-card, #fff); padding: 18px 20px;
}
.sgp-actions-title {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary, #475569); margin-bottom: 12px;
}
.sgp-action {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.sgp-action:hover { background: rgba(59,130,246,0.06); border-color: var(--border, #e5e7eb); }
.sgp-action + .sgp-action { margin-top: 4px; }
.sgp-action-num {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; background: var(--accent, #3b82f6);
}
.sgp-action-body { flex: 1 1 auto; min-width: 0; }
.sgp-action-text { font-size: 13.5px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.sgp-action-why { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.sgp-action-go { font-size: 12px; font-weight: 700; color: var(--accent, #3b82f6); white-space: nowrap; }
.sgp-action-empty { font-size: 12.5px; color: var(--text-muted); padding: 6px 2px; }

/* ── The loop: five pillars, one motion ────────────────────────────── */
.sgp-loop-title {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary, #475569); margin: 4px 2px -8px;
}
.sgp-loop {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px;
}
.sgp-step {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 14px;
  background: var(--bg-card, #fff); padding: 16px 16px 14px;
  border-top: 3px solid var(--sgp-accent, #3b82f6);
  transition: transform .12s ease, box-shadow .12s ease;
}
.sgp-step:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.sgp-step[data-accent="bible"] { --sgp-accent: #3b82f6; }
.sgp-step[data-accent="eventsales"] { --sgp-accent: #16a34a; }
.sgp-step[data-accent="logos"] { --sgp-accent: #f59e0b; }
.sgp-step[data-accent="postmortem"] { --sgp-accent: #0d9488; }
.sgp-step[data-accent="segmentation"] { --sgp-accent: #8b5cf6; }
.sgp-step-head { display: flex; align-items: center; gap: 10px; }
.sgp-step-num {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; background: var(--sgp-accent, #3b82f6);
}
.sgp-step-q { font-size: 12px; font-weight: 700; color: var(--sgp-accent, #3b82f6); }
.sgp-step-name { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.sgp-step-stats { display: flex; flex-direction: column; gap: 7px; margin: 2px 0 4px; }
.sgp-step-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sgp-step-stat .l { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.sgp-step-stat .v { font-size: 13.5px; font-weight: 800; color: var(--text-primary); white-space: nowrap; }
.sgp-step-stat .v.pos { color: var(--success, #16a34a); }
.sgp-step-stat .v.neg { color: var(--danger, #dc2626); }
.sgp-step-stat .v.muted { color: var(--text-muted); font-weight: 600; }
.sgp-step-take {
  font-size: 12px; color: var(--text-secondary, #475569); line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,0.03);
}
.sgp-step-open {
  margin-top: auto; align-self: flex-start; border: 0; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--sgp-accent, #3b82f6); padding: 4px 0 0;
}
.sgp-step-open:hover { text-decoration: underline; }

/* ── Oracle bar: the door into /chat, composed for you ─────────────── */
.sgp-oracle { display: flex; gap: 8px; margin-top: 14px; }
.sgp-oracle-input {
  flex: 1 1 auto; padding: 9px 14px; font-size: 13px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--bg-card, #fff); color: var(--text-primary);
}
.sgp-oracle-input:focus { outline: 2px solid rgba(59,130,246,.35); }
.sgp-oracle-go {
  border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--accent, #3b82f6);
}
.sgp-oracle-go:hover { filter: brightness(1.08); }

/* ── The universe strip: relationship states ───────────────────────── */
.sgp-universe {
  border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  background: var(--bg-card, #fff); padding: 14px 18px;
}
.sgp-universe-title {
  font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-secondary, #475569); margin-bottom: 10px;
}
.sgp-universe-row { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.sgp-universe-arrow { align-self: center; color: var(--text-muted); font-size: 14px; }
.sgp-state {
  flex: 1 1 120px; min-width: 118px; display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  background: transparent; padding: 10px 12px; cursor: pointer; text-align: left;
  transition: border-color .12s ease, background .12s ease;
}
.sgp-state:hover { border-color: var(--accent, #3b82f6); background: rgba(59,130,246,.05); }
.sgp-state-count { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.sgp-state-name { font-size: 12px; font-weight: 700; color: var(--text-secondary, #475569); }
.sgp-state-sub { font-size: 11px; color: var(--text-muted); line-height: 1.35; }

/* ── Main grid: queue + side rail ──────────────────────────────────── */
.sgp-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }

.sgp-queue {
  border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  background: var(--bg-card, #fff); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.sgp-queue-head { display: flex; justify-content: space-between; align-items: baseline; }
.sgp-queue-title {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary, #475569);
}
.sgp-queue-tasks { font-size: 12px; font-weight: 600; color: var(--accent, #3b82f6); text-decoration: none; }
.sgp-queue-tasks:hover { text-decoration: underline; }

.sgp-filter-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 12.5px; color: var(--text-secondary, #475569);
}
.sgp-filter-banner b { color: var(--text-primary, #0f172a); }
.sgp-filter-clear, .sgp-filter-link {
  border: 0; background: transparent; cursor: pointer; padding: 0;
  font-size: 12px; font-weight: 700; color: var(--accent, #3b82f6);
}
.sgp-filter-clear:hover, .sgp-filter-link:hover { text-decoration: underline; }
.sgp-filter-empty-acts {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px;
}

/* ── Queue tabs (Today + one per engine family) ────────────────────── */
.sgp-queue-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--border, #e5e7eb); padding-bottom: 10px;
}
.sgp-qtab {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 999px;
  background: transparent; padding: 5px 12px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--text-secondary, #475569);
  transition: background .12s, border-color .12s, color .12s;
}
.sgp-qtab:hover { background: rgba(0,0,0,.04); }
.sgp-qtab.active {
  background: var(--accent, #3b82f6); border-color: var(--accent, #3b82f6); color: #fff;
}
.sgp-qtab-n {
  font-size: 10.5px; font-weight: 800; min-width: 18px; text-align: center;
  padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.08); color: inherit;
}
.sgp-qtab.active .sgp-qtab-n { background: rgba(255,255,255,.25); }

/* ── Time-window toggle (a horizon filter, shared across tabs) ──────── */
.sgp-qwindow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sgp-qwindow-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted, #94a3b8); margin-right: 2px;
}
.sgp-qwin {
  border: 1px solid var(--border, #e5e7eb); border-radius: 999px;
  background: transparent; padding: 3px 11px; cursor: pointer;
  font-size: 11.5px; font-weight: 700; color: var(--text-secondary, #475569);
  transition: background .12s, border-color .12s, color .12s;
}
.sgp-qwin:hover { background: rgba(0,0,0,.04); }
.sgp-qwin.active {
  background: var(--text-primary, #0f172a); border-color: var(--text-primary, #0f172a);
  color: #fff;
}

/* ── Pager ─────────────────────────────────────────────────────────── */
.sgp-qpager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding-top: 4px;
}
.sgp-qpage-btn {
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  background: transparent; padding: 4px 12px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--accent, #3b82f6);
  transition: background .12s ease, border-color .12s ease;
}
.sgp-qpage-btn:hover:not(:disabled) {
  background: rgba(59,130,246,.07); border-color: var(--accent, #3b82f6);
}
.sgp-qpage-btn:disabled { opacity: .4; cursor: default; }
.sgp-qpage-info { font-size: 12px; font-weight: 600; color: var(--text-muted, #94a3b8); }

.sgp-queue-panels { display: block; }
.sgp-qpanel { display: none; flex-direction: column; gap: 12px; }
.sgp-qpanel.active { display: flex; }

.sgp-dir {
  border: 1px solid var(--border, #e5e7eb); border-left: 4px solid var(--sgp-tier, #94a3b8);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px;
  background: var(--sgp-tier-bg, transparent);
}
/* Tier is a TIME HORIZON, not a severity. Nothing in this queue is an
 * emergency, so the ramp is warm → calm (amber today, teal soon, indigo when
 * there's room) and never touches the danger red the rest of the app uses for
 * real failures. The faint wash keeps a card from reading as a bare alert
 * strip. See the tone contract in services/govtech_ai.py. */
.sgp-dir[data-tier="1"] { --sgp-tier: #d97706; --sgp-tier-bg: rgba(217,119,6,.045); }
.sgp-dir[data-tier="2"] { --sgp-tier: #0d9488; --sgp-tier-bg: rgba(13,148,136,.045); }
.sgp-dir[data-tier="3"] { --sgp-tier: #6366f1; --sgp-tier-bg: rgba(99,102,241,.04); }
.sgp-dir-head { display: flex; align-items: center; gap: 10px; }
.sgp-dir-num {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; color: #fff; background: var(--sgp-tier, #94a3b8);
}
.sgp-dir-engine {
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sgp-tier, #94a3b8);
}
.sgp-dir-value { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--text-primary); }
.sgp-dir-headline { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.sgp-dir-whys { display: flex; flex-wrap: wrap; gap: 6px; }
.sgp-dir-why {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(0,0,0,.05); color: var(--text-secondary, #475569);
}
.sgp-dir-how { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.sgp-dir-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sgp-dir-btn {
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  background: transparent; padding: 4px 11px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--accent, #3b82f6);
  transition: background .12s ease, border-color .12s ease;
}
.sgp-dir-btn:hover { background: rgba(59,130,246,.07); border-color: var(--accent, #3b82f6); }

/* ── Side rail: learning loop + pillars ────────────────────────────── */
.sgp-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sgp-learn {
  border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  background: var(--bg-card, #fff); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.sgp-learn-title {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary, #475569);
}
.sgp-learn-scope {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 7px;
  border-radius: 999px; background: rgba(0,0,0,.05); color: var(--text-muted);
  text-transform: none;
}
.sgp-learn-reason { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.sgp-learn-reason .l { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.sgp-learn-reason .v { font-size: 12.5px; font-weight: 800; color: var(--text-secondary, #475569); }
.sgp-learn-reason .n { font-size: 11px; color: var(--text-muted); }
.sgp-learn-lesson {
  flex-basis: 100%; font-size: 11.5px; color: var(--text-muted); line-height: 1.4;
  padding-left: 2px;
}
.sgp-learn-bench {
  font-size: 11.5px; color: var(--text-secondary, #475569); line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; background: rgba(22,163,74,.07);
}

.sgp-rail {
  border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  background: var(--bg-card, #fff); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.sgp-rail-title {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary, #475569); margin-bottom: 2px;
}
.sgp-rail-item {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  border: 1px solid transparent; border-radius: 10px; padding: 8px 10px;
  background: transparent; cursor: pointer; transition: background .12s ease;
}
.sgp-rail-item:hover { background: rgba(59,130,246,.06); }
.sgp-rail-q { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.sgp-rail-name { font-size: 13px; font-weight: 800; color: var(--accent, #3b82f6); }
.sgp-rail-take { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

@media (max-width: 1000px) {
  .sgp-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sgp-hero-head { flex-direction: column; }
  .sgp-loop { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .sgp-loop { grid-template-columns: 1fr; }
}
