/* ════════════════════════════════════════════════════════════════════
   Event Outflow tab — scoped styles under .eo-event-outflow-*

   Visual language matches the existing pipe-outflow / qp drawer pattern
   (cream surface, deep forest text, sage-green accents) so the tab
   doesn't read as a foreign system. Heavy reuse of CSS vars from
   themes.css — anything unset falls back to the muted slate palette
   that base.html ships.
   ════════════════════════════════════════════════════════════════════ */

/* ─── Empty / not-loaded state ─────────────────────────────────────── */
.eo-event-outflow-empty {
  padding: 28px 32px;
  border: 1px dashed var(--border-subtle, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-2, #f8fafc);
  color: var(--text-secondary, #475569);
  margin: 16px 0;
}
.eo-event-outflow-empty h3 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
}
.eo-event-outflow-empty code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--surface, #fff);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle, #e5e7eb);
}

/* ─── Header strip ─────────────────────────────────────────────────── */
.eo-event-outflow-header {
  margin: 12px 0 16px;
}
.eo-event-outflow-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.eo-event-outflow-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.eo-event-outflow-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary, #475569);
}
.eo-event-outflow-header-actions {
  display: flex; gap: 8px;
}

/* ─── Buttons ──────────────────────────────────────────────────────── */
.eo-event-outflow-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--surface, #fff);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.eo-event-outflow-btn:hover {
  background: var(--surface-2, #f8fafc);
  border-color: var(--accent, #6b8e60);
}
.eo-event-outflow-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.eo-event-outflow-btn-primary {
  background: var(--accent, #6b8e60);
  border-color: var(--accent, #6b8e60);
  color: #fff;
}
.eo-event-outflow-btn-primary:hover {
  background: var(--accent-hover, #5a7d50);
  border-color: var(--accent-hover, #5a7d50);
}

.eo-event-outflow-link {
  background: none; border: none;
  color: var(--accent, #6b8e60);
  cursor: pointer;
  font-size: inherit;
  padding: 0 4px;
  text-decoration: underline;
}

/* ─── Pivot selector ───────────────────────────────────────────────── */
.eo-event-outflow-pivots {
  display: flex; gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}
.eo-event-outflow-pivot {
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.eo-event-outflow-pivot:hover {
  color: var(--text-primary);
}
.eo-event-outflow-pivot.is-active {
  color: var(--accent, #6b8e60);
  border-bottom-color: var(--accent, #6b8e60);
}

/* ─── Toolbar ──────────────────────────────────────────────────────── */
.eo-event-outflow-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: flex-end;
  padding: 12px 14px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 8px;
  margin-bottom: 12px;
}
.eo-event-outflow-filter {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 140px;
}
.eo-event-outflow-filter span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.eo-event-outflow-filter select {
  padding: 5px 8px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 5px;
  background: var(--surface, #fff);
  font-size: 12px;
  color: var(--text-primary);
}
.eo-event-outflow-toolbar-spacer {
  flex: 1 1 auto;
}

/* ─── Apply result banner ──────────────────────────────────────────── */
.eo-event-outflow-result {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--accent, #6b8e60);
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 12px;
}
.eo-event-outflow-result.is-error {
  border-color: var(--danger, #dc2626);
}
.eo-event-outflow-result-dismiss {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
}

/* ─── Grid ─────────────────────────────────────────────────────────── */
.eo-event-outflow-grid {
  display: flex; flex-direction: column; gap: 12px;
}
.eo-event-outflow-grid.is-loading {
  opacity: 0.6;
}
.eo-event-outflow-grid-loading,
.eo-event-outflow-grid-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary, #475569);
  font-size: 13px;
  background: var(--surface-2, #f8fafc);
  border: 1px dashed var(--border-subtle, #e5e7eb);
  border-radius: 8px;
}

.eo-event-outflow-group {
  background: var(--surface, #fff);
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}
.eo-event-outflow-group-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2, #f8fafc);
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}
.eo-event-outflow-group-title {
  display: flex; align-items: baseline; gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
}
.eo-event-outflow-group-count {
  font-size: 10px;
  color: var(--text-muted, #64748b);
  font-weight: 500;
  letter-spacing: .04em;
}
.eo-event-outflow-group-meta {
  display: flex; gap: 6px; align-items: center;
}

.eo-event-outflow-atoms {
  display: flex; flex-direction: column;
}
.eo-event-outflow-atom {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  background: var(--surface, #fff);
  border: none;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
}
.eo-event-outflow-atom:first-child { border-top: none; }
.eo-event-outflow-atom:hover { background: var(--surface-2, #f8fafc); }
.eo-event-outflow-atom.is-selected {
  background: rgba(107, 142, 96, 0.08);
  border-left: 2px solid var(--accent, #6b8e60);
  padding-left: 12px;
}
.eo-event-outflow-atom-row {
  display: flex; gap: 6px; align-items: baseline;
  font-size: 12px;
  flex-wrap: wrap;
}
.eo-event-outflow-atom-account {
  font-weight: 700;
  flex: 1 1 auto;
}
.eo-event-outflow-atom-play {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent, #6b8e60);
  font-weight: 600;
}
.eo-event-outflow-atom-row-sub {
  color: var(--text-secondary, #475569);
  font-size: 11px;
}
.eo-event-outflow-atom-row-meta {
  color: var(--text-muted, #64748b);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Play / row-source chips ──────────────────────────────────────── */
.eo-event-outflow-play-chip {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(107, 142, 96, 0.12);
  color: var(--accent, #6b8e60);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}
.eo-event-outflow-row-source-chip {
  display: inline-block;
  padding: 1px 6px;
  background: var(--surface-2, #f8fafc);
  color: var(--text-secondary, #475569);
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ─── Drawer (right slide-in) ──────────────────────────────────────── */
.eo-event-outflow-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9100;
  display: flex; justify-content: flex-end;
}
.eo-event-outflow-drawer {
  background: var(--surface, #fff);
  width: min(1200px, 96vw);
  height: 100%;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 48px rgba(0,0,0,.25);
}
.eo-event-outflow-drawer-head {
  flex: 0 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--surface-2, #f8fafc);
}
.eo-event-outflow-drawer-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent, #6b8e60);
}
.eo-event-outflow-drawer-title {
  margin: 2px 0 0 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.eo-event-outflow-drawer-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary, #475569);
}
.eo-event-outflow-drawer-close {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-subtle, #e5e7eb);
  background: transparent;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-secondary, #475569);
}
.eo-event-outflow-drawer-close:hover { background: var(--border-subtle, #e5e7eb); }

/* ─── Drawer panes (3-column grid) ─────────────────────────────────── */
.eo-event-outflow-drawer > section + section { border-left: 1px solid var(--border-subtle, #e5e7eb); }
.eo-event-outflow-drawer {
  /* Use a grid for the three panes (flex column wraps them in a single
     scroll axis which makes the actions pane hard to reach) */
}
.eo-event-outflow-drawer-body {
  /* Body fills the remaining space; panes go side-by-side */
}

/* Override: use a flex row for the 3 panes inside the drawer */
.eo-event-outflow-pane {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 18px;
  overflow-y: auto;
  background: var(--surface, #fff);
  border-top: 1px solid var(--border-subtle, #e5e7eb);
}
/* Two-up at wide; stack to rows at narrow */
.eo-event-outflow-drawer {
  display: grid;
  grid-template-rows: auto 1fr;
}
.eo-event-outflow-drawer > section:nth-of-type(1) { grid-column: 1; }
.eo-event-outflow-drawer > section:nth-of-type(2) { grid-column: 2; }
.eo-event-outflow-drawer > section:nth-of-type(3) { grid-column: 3; }
.eo-event-outflow-drawer {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(220px, 0.7fr);
}
@media (max-width: 1100px) {
  .eo-event-outflow-drawer {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }
  .eo-event-outflow-drawer > section:nth-of-type(1),
  .eo-event-outflow-drawer > section:nth-of-type(2),
  .eo-event-outflow-drawer > section:nth-of-type(3) {
    grid-column: 1;
  }
}

.eo-event-outflow-pane-h {
  margin: 0 0 12px 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.eo-event-outflow-pane-empty {
  padding: 14px;
  background: var(--surface-2, #f8fafc);
  border: 1px dashed var(--border-subtle, #e5e7eb);
  border-radius: 6px;
  color: var(--text-secondary, #475569);
  font-size: 12px;
}
.eo-event-outflow-pane-empty.is-warn {
  border-color: var(--warn, #f59e0b);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-primary);
}

/* ─── Brief preview chips ──────────────────────────────────────────── */
.eo-event-outflow-brief-section {
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-primary);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.eo-event-outflow-brief-section ul {
  flex-basis: 100%;
  margin: 4px 0 0 0;
  padding-left: 18px;
  font-size: 11px;
  color: var(--text-secondary, #475569);
}
.eo-event-outflow-brief-section strong {
  color: var(--text-muted, #64748b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.eo-event-outflow-brief-objective {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-secondary, #475569);
}
.eo-event-outflow-signal-list li {
  margin-bottom: 4px;
}
.eo-event-outflow-signal-urgency {
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-right: 5px;
  vertical-align: middle;
}
.eo-event-outflow-signal-urgency.is-critical { background: rgba(220, 38, 38, 0.15); color: #b91c1c; }
.eo-event-outflow-signal-urgency.is-high     { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.eo-event-outflow-signal-urgency.is-medium   { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.eo-event-outflow-signal-urgency.is-low      { background: var(--surface-2, #f8fafc); color: var(--text-secondary, #475569); }
.eo-event-outflow-donot-list li {
  margin-bottom: 3px;
  color: #b45309;
}

.eo-event-outflow-alt-chip {
  padding: 2px 8px;
  background: var(--surface, #fff);
  color: var(--accent, #6b8e60);
  border: 1px solid var(--accent, #6b8e60);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.eo-event-outflow-alt-chip:hover {
  background: var(--accent, #6b8e60);
  color: #fff;
}
.eo-event-outflow-alt-chip:disabled {
  opacity: 0.5; cursor: not-allowed;
}

/* ─── Compose form ─────────────────────────────────────────────────── */
.eo-event-outflow-field {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 12px;
}
.eo-event-outflow-field span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.eo-event-outflow-field input,
.eo-event-outflow-field textarea {
  padding: 8px 10px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 5px;
  background: var(--surface, #fff);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.eo-event-outflow-cite-row {
  margin-top: 8px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 11px;
}
.eo-event-outflow-cite-row strong {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-muted, #64748b); text-transform: uppercase;
}
.eo-event-outflow-cite-chip {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(107, 142, 96, 0.10);
  color: var(--accent, #6b8e60);
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
}

/* ─── Actions pane ─────────────────────────────────────────────────── */
.eo-event-outflow-pane-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.eo-event-outflow-actions-divider {
  height: 1px;
  background: var(--border-subtle, #e5e7eb);
  margin: 6px 0;
}
.eo-event-outflow-actions-meta {
  font-size: 11px;
  color: var(--text-secondary, #475569);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.6;
}
.eo-event-outflow-actions-meta strong {
  color: var(--text-muted, #64748b);
  margin-right: 4px;
}
.eo-event-outflow-actions-meta code {
  font-size: 10px;
  background: var(--surface-2, #f8fafc);
  padding: 1px 3px;
  border-radius: 2px;
}

/* ─── Deprecation banner (Quarterly) + inline chip (Pipeline Outflow Mode)
   Visible only while ``EVENT_OUTFLOW_CUTOVER_AT_ISO`` is set on the
   server (see context_processor in app.py). Tone is informative-warn,
   not destructive — the legacy tab still works through the cutover.
   ────────────────────────────────────────────────────────────────────── */
.eo-deprecation-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin: 0 0 14px 0;
  background: linear-gradient(
    135deg,
    rgba(249, 168, 37, 0.08) 0%,
    rgba(249, 168, 37, 0.02) 100%
  );
  border: 1px solid rgba(249, 168, 37, 0.35);
  border-left: 3px solid #f9a825;
  border-radius: 6px;
}
.eo-deprecation-banner__icon {
  flex: 0 0 auto;
  color: #b87900;
  display: flex;
  align-items: center;
}
.eo-deprecation-banner__body {
  flex: 1 1 auto;
  min-width: 0;
}
.eo-deprecation-banner__title {
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  font-size: 14px;
  line-height: 1.3;
}
.eo-deprecation-banner__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary, #475569);
  line-height: 1.45;
}
.eo-deprecation-banner__cta {
  flex: 0 0 auto;
  white-space: nowrap;
}

.eo-deprecation-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  margin-left: 6px;
  border: 1px solid rgba(249, 168, 37, 0.45);
  background: rgba(249, 168, 37, 0.10);
  color: #b87900;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.eo-deprecation-chip:hover {
  background: rgba(249, 168, 37, 0.18);
}
