/* ATLAS V6 — Topbar Command Bar
   V6 enterprise design: search bar + status chips + role chip + Ask Atlas CTA.
   Load AFTER all bundles so it wins specificity against jarvis.css statusbar rules. */

/* ── STATUSBAR SHELL (override legacy 56px flex bar) ─────────────── */
header#statusbar.statusbar {
  height: 76px !important;
  display: grid !important;
  grid-template-columns: minmax(320px, 580px) 1fr auto !important;
  gap: 16px !important;
  align-items: center !important;
  padding: 0 22px !important;
  border-bottom: 1px solid #d7d0c3 !important;
  background: rgba(255,253,248,.88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  flex-shrink: 0;
}

/* Hide all the legacy status-bar children — they stay in DOM for JS compat */
header#statusbar .status-left,
header#statusbar .status-center,
header#statusbar .status-jarvis,
header#statusbar .status-right,
header#statusbar .status-brand,
header#statusbar .tb-breadcrumb,
header#statusbar .quick-stats,
header#statusbar .status-dot,
header#statusbar #conn-label,
header#statusbar #conn-meta {
  display: none !important;
}

/* M5 (2026-06-25 audit) — internal build/version scaffolding off the executive
   surface. app.js feeds CFG.BRAND_LINE ("REOS · ATLAS COMMAND CONSOLE · v0.5 —
   Light/Dark · 11 panels · 21 tools live") into #brand-line; that version +
   panel/tool counts read as a prototype to a customer. The element already
   carries [hidden]; this id rule guarantees it stays hidden no matter where it
   sits in the DOM or what writes to it. */
#brand-name,
#brand-line { display: none !important; }

/* ── V6 GLOBAL SEARCH ─────────────────────────────────────────────── */
.v6-global-search {
  height: 44px;
  border: 1px solid #d7d0c3;
  background: #f0eee8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  color: #647184;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.v6-global-search svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.v6-global-search input {
  border: 0;
  background: transparent;
  outline: 0;
  min-width: 0;
  width: 100%;
  color: #101722;
  font-size: 15px;
  font-family: inherit;
}

.v6-global-search input::placeholder { color: #8a95a3; }

.v6-global-search:focus-within {
  border-color: #c18a25;
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(193,138,37,.15);
}

.v6-search-hint {
  font: 600 12px "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  color: #9fb0bf;
  background: rgba(0,0,0,.07);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── STATUS CHIPS STRIP ───────────────────────────────────────────── */
.v6-status-strip {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
}

.v6-status-chip {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #d7d0c3;
  border-radius: 8px;
  background: #fffdf8;
  color: #101722;
  font-weight: 750;
  font-size: 13px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
  white-space: nowrap;
  flex-shrink: 0;
}

.v6-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.v6-status-dot.teal  { background: #0f857c; box-shadow: 0 0 0 3px rgba(15,133,124,.13); }
.v6-status-dot.green { background: #2e8b57; box-shadow: 0 0 0 3px rgba(46,139,87,.13); }
.v6-status-dot.blue  { background: #2f66c3; box-shadow: 0 0 0 3px rgba(47,102,195,.13); }
.v6-status-dot.gold  { background: #c18a25; box-shadow: 0 0 0 3px rgba(193,138,37,.13); }

/* H3 (2026-06-25 audit) — complete the status-dot vocabulary so a chip has a
   real semantic color in EVERY state. teal/green = satisfied · amber = partial ·
   red = none. These match the house dot convention (.amber/.red are already used
   on #conn-dot + #sb-h-dot in app.js). Gold (#c18a25) is the brand ACCENT, NOT a
   status — using it as a "warning" is what made the satisfied "Sources named"
   chip read amber/yellow and contradict its own label. */
.v6-status-dot.amber,
.v6-status-dot.warn { background: #c98a1e; box-shadow: 0 0 0 3px rgba(201,138,30,.14); }
.v6-status-dot.red,
.v6-status-dot.bad  { background: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,.14); }

/* The "Sources named" chip is a SATISFIED state — when all data sources are
   named and traceable its dot is teal/green (set in index.html:398). This is a
   defensive coercion: if a stale build ships the gold (amber) dot on the
   satisfied chip, force it back to healthy teal. A genuine partial/none state
   adds .warn/.red (above), which still win by source order. */
#v6-sources-chip .v6-status-dot.gold {
  background: #0f857c;
  box-shadow: 0 0 0 3px rgba(15,133,124,.13);
}

/* ── TOP ACTION BUTTONS ───────────────────────────────────────────── */
.v6-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.v6-role-chip {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #c18a25;
  background: #fbecd0;
  color: #7a4a0a;
  font-weight: 800;
  font-size: 13px;
  cursor: default;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.v6-ask-atlas-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #d7a13a, #bd8420);
  color: #201505;
  border: 1px solid #b67c19;
  font-weight: 800;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(29,24,14,.07);
  transition: transform .1s, box-shadow .1s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.v6-ask-atlas-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(29,24,14,.12);
}

.v6-ask-atlas-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(29,24,14,.08);
}

.v6-ask-atlas-btn:focus-visible {
  outline: 2px solid #c18a25;
  outline-offset: 2px;
}

/* ── DARK MODE OVERRIDES ──────────────────────────────────────────── */
[data-theme="dark"] header#statusbar.statusbar {
  background: rgba(15,21,27,.88) !important;
  border-bottom-color: rgba(255,255,255,.1) !important;
}

[data-theme="dark"] .v6-global-search {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.15);
  color: #8a9bb0;
}

[data-theme="dark"] .v6-global-search input { color: #edf4fb; }

[data-theme="dark"] .v6-global-search input::placeholder { color: #657080; }

[data-theme="dark"] .v6-global-search:focus-within {
  border-color: #d7a13a;
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(215,161,58,.15);
}

[data-theme="dark"] .v6-search-hint {
  background: rgba(255,255,255,.1);
  color: #657080;
}

[data-theme="dark"] .v6-status-chip {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
  color: #edf4fb;
  box-shadow: none;
}

[data-theme="dark"] .v6-role-chip {
  background: rgba(193,138,37,.15);
  border-color: rgba(193,138,37,.4);
  color: #e4bd67;
}
