/* ============================================================
   TR HOME — DARK THEME OVERRIDE (Mike directive 2026-06-11)
   Baseline matches internal PM pages: body #0d0e10, text #eef3f8,
   indigo accent #818cf8. Loaded LAST so it overrides the legacy
   light Runway palette without touching 3,600 lines of old CSS.
   Roll back by removing the <link> in index.html.
   ============================================================ */

body {
  color-scheme: dark !important;
  color: #eef3f8 !important;
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(129,140,248,.26), transparent 60%),
    radial-gradient(1000px 600px at 95% 0%, rgba(99,102,241,.14), transparent 55%),
    #0d0e10 !important;
}
body::before { opacity: .05 !important; }

h1, h2, h3, h4 { color: #eef3f8 !important; }
.eyebrow { color: #a5b4fc !important; }
.subtitle, .muted, .small { color: #9aa3b2 !important; }

/* ---- Flatten the bubble layering: ONE surface level ---- */
.office-shell,
.runway-board-section,
.big-goals-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.office-shell:hover, .big-goals-section:hover { box-shadow: none !important; }

.card,
.kpi-source-column,
.runway-kpi-strip,
.goal-bubble,
.runway-priority-panel,
.runway-calendar-panel,
.model-plan-card,
.tr-approvals-card,
.clock-banner {
  background: #16181d !important;
  border: 1px solid rgba(129,140,248,.18) !important;
  border-radius: 16px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.35) !important;
}
.runway-kpi-strip { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 22px 22px !important; }
.runway-kpi-strip > h2 { color: #a5b4fc !important; }

/* ---- Clock banner ---- */
.clock-banner, .local-clock-card { color: #eef3f8 !important; }
.clock-time, .clock-date, .clock-zone, .clock-weather { color: #eef3f8 !important; }
.clock-banner-label { color: #9aa3b2 !important; }

/* ---- KPI strip ---- */
.kpi-source-header h3 { color: #eef3f8 !important; }
.kpi-row { border-bottom: 1px solid rgba(255,255,255,.06) !important; }
.kpi-row-label { color: #9aa3b2 !important; }
.kpi-row-value { color: #eef3f8 !important; }
.kpi-row-value.good { color: #34d399 !important; }
.kpi-row-value.bad { color: #f87171 !important; }
.kpi-status-pill.good { background: rgba(16,185,129,.15) !important; border-color: rgba(16,185,129,.4) !important; color: #34d399 !important; }
.kpi-status-pill.warn { background: rgba(245,158,11,.15) !important; border-color: rgba(245,158,11,.4) !important; color: #fbbf24 !important; }
.kpi-status-pill.bad { background: rgba(239,68,68,.15) !important; border-color: rgba(239,68,68,.4) !important; color: #f87171 !important; }

/* ---- Runway board / tasks / calendar panels ---- */
.runway-board-head h2, .runway-panel-heading h3 { color: #eef3f8 !important; }
.runway-priority-item {
  background: #1c1f26 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  color: #eef3f8 !important;
}
.runway-priority-item:hover { background: #232734 !important; border-color: rgba(129,140,248,.45) !important; }
.runway-priority-item strong { color: #eef3f8 !important; }
.runway-priority-rank { background: rgba(129,140,248,.2) !important; color: #a5b4fc !important; }
.runway-status-chip { color: #9aa3b2 !important; }
.runway-panel-count { color: #9aa3b2 !important; }
.runway-add-task-btn, .runway-calendar-step {
  background: rgba(129,140,248,.16) !important;
  border: 1px solid rgba(129,140,248,.4) !important;
  color: #c7d2fe !important;
}
.runway-add-task-btn:hover, .runway-calendar-step:hover { background: rgba(129,140,248,.28) !important; }
.runway-calendar-current-day { color: #eef3f8 !important; }
.runway-calendar-list .event, .runway-email-item {
  background: #1c1f26 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  color: #eef3f8 !important;
}
.runway-done-btn { background: rgba(16,185,129,.18) !important; color: #34d399 !important; border: 1px solid rgba(16,185,129,.4) !important; }
input, select, textarea {
  background: #1c1f26 !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #eef3f8 !important;
}
input::placeholder, textarea::placeholder { color: #6b7280 !important; }

/* ---- Goal bubbles (clickable) ---- */
.goal-bubble { cursor: pointer; transition: transform .12s ease, border-color .12s ease !important; }
.goal-bubble:hover { transform: translateY(-2px); border-color: rgba(129,140,248,.5) !important; box-shadow: 0 10px 26px rgba(0,0,0,.5) !important; }
.goal-bubble h3, .goal-bubble-phase-name { color: #eef3f8 !important; }
.goal-bubble-phase-desc { color: #9aa3b2 !important; }
.goal-ring::after { background: #16181d !important; }
.goal-ring span { color: #eef3f8 !important; }
.goal-bubble-status { background: rgba(16,185,129,.12) !important; color: #34d399 !important; border-color: rgba(16,185,129,.3) !important; }
.goal-bubble-checklist li { color: #c8cfdb !important; }
.goal-bubble-checklist li span:first-child { background: rgba(255,255,255,.08) !important; color: #9aa3b2 !important; }
.goal-bubble-cta {
  background: #4f46e5 !important; color: #ffffff !important;
  border-radius: 12px; display: block; text-align: center;
  padding: 11px; font-weight: 800; text-decoration: none; font-size: 13px;
}
.goal-bubble-cta:hover { background: #4338ca !important; }

/* ---- Side panel: TR Mode / Active Model / Approvals ---- */
.side-panel .card h2 { color: #eef3f8 !important; }
.side-panel .event { background: #1c1f26 !important; border: 1px solid rgba(255,255,255,.08) !important; color: #eef3f8 !important; }
.side-panel .event strong { color: #eef3f8 !important; }
#tr-openrouter-cost { color: #34d399 !important; }

/* Approvals — solid high-contrast action cards */
.tr-approvals-card h2 { color: #eef3f8 !important; }
.tr-approvals-badge { background: #f59e0b !important; color: #111 !important; }
.tr-approval-item { background: #1c1f26 !important; border: 1px solid rgba(245,158,11,.35) !important; }
.tr-approval-who { color: #eef3f8 !important; }
.tr-approval-cap { background: rgba(129,140,248,.18) !important; color: #c7d2fe !important; border-color: rgba(129,140,248,.4) !important; }
.tr-approval-text { color: #c8cfdb !important; }
.tr-approval-btn.approve { background: #10b981 !important; color: #06241a !important; font-weight: 800 !important; }
.tr-approval-btn.deny { background: #3a1518 !important; border-color: #ef4444 !important; color: #fca5a5 !important; }
.tr-approval-btn.grant { background: rgba(129,140,248,.2) !important; border-color: #818cf8 !important; color: #c7d2fe !important; }
.tr-approvals-empty { color: #6b7280 !important; }

/* ---- Status pill / header ---- */
.status-pill { background: rgba(16,185,129,.15) !important; border: 1px solid rgba(16,185,129,.4) !important; color: #34d399 !important; }

/* ---- 45-second top strip ---- */
.snapshot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.snapshot-tile {
  background: #16181d;
  border: 1px solid rgba(129,140,248,.22);
  border-radius: 14px;
  padding: 14px 16px;
}
.snapshot-tile.alert { border-color: rgba(245,158,11,.55); background: #1d1812; }
.snapshot-tile h4 {
  margin: 0 0 8px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: #a5b4fc !important;
}
.snapshot-tile.alert h4 { color: #fbbf24 !important; }
.snapshot-tile .snap-big { font-size: 20px; font-weight: 800; color: #eef3f8; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.snapshot-tile .snap-sub { font-size: 11.5px; color: #9aa3b2; margin-top: 2px; }
.snapshot-tile ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.snapshot-tile li { font-size: 12px; color: #c8cfdb; line-height: 1.35; display: flex; gap: 6px; }
.snapshot-tile li::before { content: "·"; color: #818cf8; font-weight: 800; }
.snapshot-tile .snap-good { color: #34d399; }
.snapshot-tile .snap-bad { color: #f87171; }

/* ---- Task detail slide-over (clickable decisions/tasks) ---- */
.snapshot-tile li.snap-click { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; transition: background .1s; }
.snapshot-tile li.snap-click:hover { background: rgba(129,140,248,.14); color: #eef3f8; }
.runway-priority-item[data-task-id] { cursor: pointer; }
#task-detail-overlay { position: fixed; inset: 0; z-index: 1000; }
#task-detail-overlay .td-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
#task-detail-overlay .td-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  background: #16181d; border-left: 1px solid rgba(129,140,248,.3);
  box-shadow: -12px 0 40px rgba(0,0,0,.6); display: flex; flex-direction: column;
  animation: td-slide .18s ease-out;
}
@keyframes td-slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#task-detail-overlay .td-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
#task-detail-overlay .td-head h3 { margin: 0; font-size: 17px; color: #eef3f8; line-height: 1.35; overflow-wrap: anywhere; }
#task-detail-overlay .td-close { background: rgba(255,255,255,.08); border: none; color: #9aa3b2; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; flex-shrink: 0; }
#task-detail-overlay .td-close:hover { background: rgba(239,68,68,.2); color: #fca5a5; }
#task-detail-overlay .td-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
#task-detail-overlay .td-row { display: flex; flex-direction: column; gap: 3px; }
#task-detail-overlay .td-label { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #a5b4fc; }
#task-detail-overlay .td-val { font-size: 13.5px; color: #e2e8f0; line-height: 1.5; overflow-wrap: anywhere; }
#task-detail-overlay .td-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 20px 20px; border-top: 1px solid rgba(255,255,255,.08); }
#task-detail-overlay .td-done { background: #10b981; color: #06241a; border: none; padding: 11px; border-radius: 10px; font-weight: 800; font-size: 13px; cursor: pointer; }
#task-detail-overlay .td-done:hover { background: #0ea674; }
#task-detail-overlay .td-done[disabled] { opacity: .5; cursor: default; }
#task-detail-overlay .td-dismiss { background: rgba(255,255,255,.07); color: #c8cfdb; border: 1px solid rgba(255,255,255,.12); padding: 11px; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
