/* Operational Intelligence Center — aligns with product mockup */

/* style.css sets `header { position: fixed; width: 100%; … }` globally — undo for dashboard tiles + expand dialog */
body.bd-oi-page header {
  position: static;
  width: auto;
  max-width: none;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}
body.bd-oi-page .wd-expand-head {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  border-radius: 20px 20px 0 0;
}

body.bd-oi-page {
  height: 100dvh;
  overflow: hidden;
}
body.bd-oi-page .bd-wrap {
  background: #f8fafc;
  padding-bottom: 0 !important;
  min-height: 0 !important;
  height: 100dvh !important;
  overflow: hidden !important;
  box-sizing: border-box;
}
body.bd-oi-page .bd-wrap-inner,
body.bd-oi-page .oi-page-root,
body.bd-oi-page .oi-command-host {
  height: 100%;
  min-height: 0;
}

/* Compact floating AI dock on cockpit — less overlap with bottom panels */
body.bd-oi-page .bdu-ai-dock {
  padding: 6px max(12px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
}
body.bd-oi-page .bdu-chatgpt-panel {
  max-width: 1024px;
  border-radius: 12px;
}
body.bd-oi-page .bdu-chatgpt-header {
  padding: 6px 10px;
}
body.bd-oi-page .bdu-chatgpt-title {
  font-size: 0.68rem;
}
body.bd-oi-page .bdu-chatgpt-messages {
  max-height: min(20vh, 120px);
  padding: 5px 10px;
  gap: 6px;
}
body.bd-oi-page .bdu-chatgpt-composer {
  padding: 6px 10px 8px;
}
body.bd-oi-page .bdu-chatgpt-input-row {
  padding: 5px 8px 5px 12px;
  border-radius: 11px;
}
body.bd-oi-page .bdu-chatgpt-input-row textarea {
  font-size: 0.82rem;
  min-height: 20px;
  padding: 6px 4px;
}
body.bd-oi-page .bdu-chatgpt-send {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
body.bd-oi-page .bdu-chatgpt-send svg {
  width: 15px;
  height: 15px;
}
body.bd-oi-page .wd-ai-chips {
  margin-top: 6px;
  gap: 6px;
}
body.bd-oi-page .wd-ai-chip {
  padding: 4px 9px;
  font-size: 0.62rem;
}
body.bd-oi-page .bdu-chatgpt-disclaimer {
  margin-top: 4px;
  font-size: 0.56rem;
}
body.bd-oi-page .bdu-chatgpt-clear {
  padding: 4px 8px;
  font-size: 0.62rem;
}
body.bd-oi-page.bd-command-locked .bd-wrap {
  padding-bottom: 0 !important;
}

.oi-page-root { position: relative; width: 100%; }
.oi-command-host {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.oi-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* ---- Sidebar (#1A1F36) ---- */
.oi-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1a1f36;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  z-index: 5;
}
.oi-sidebar-brand {
  display: block;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  padding: 0 16px 14px;
  letter-spacing: -0.02em;
}
.oi-sidebar-brand .oi-brand-word {
  background: linear-gradient(135deg, #667eea 0%, #a78bfa 45%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body.oi-sidebar-collapsed .oi-sidebar-brand .oi-brand-mini {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 900;
}
.oi-side-block--billing {
  padding-bottom: 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.oi-side-block--tools {
  padding-top: 4px;
  margin-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.oi-side-link--upgrade:hover {
  color: #c4b5fd !important;
}
.oi-side-link--usage:hover {
  color: #93c5fd !important;
}
.oi-side-link--upload:hover {
  color: #93c5fd !important;
}
.oi-side-link--experts:hover {
  color: #c4b5fd !important;
}
.oi-side-text {
  letter-spacing: 0.02em;
}
.oi-side-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
}
.oi-side-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.oi-side-block--modules {
  gap: 4px;
}
.oi-side-block--modules .oi-side-label {
  margin: 0 6px 8px;
}
.oi-side-block--modules .oi-side-link {
  margin-bottom: 0;
}
.oi-side-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin: 10px 6px 6px;
}
.oi-side-label:first-of-type { margin-top: 0; }
.oi-side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 0;
  border-radius: 7px;
  color: #cbd5e1 !important;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
.oi-side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff !important; }
.oi-side-link--active {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(91, 33, 182, 0.28);
}
.oi-side-ic {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}
.oi-side-svg {
  width: 16px;
  height: 16px;
  display: block;
}
.oi-side-link--active .oi-side-ic {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff !important;
}
/* module accent (thin-line icons, mock-aligned) */
.oi-side-tone-d { color: #a5b4fc; }
.oi-side-tone-m { color: #c4b5fd; }
.oi-side-tone-s { color: #86efac; }
.oi-side-tone-i { color: #fdba74; }
.oi-side-tone-f { color: #93c5fd; }
.oi-side-tone-h { color: #f9a8d4; }
.oi-side-tone-o { color: #7dd3fc; }
.oi-side-tone-sc { color: #5eead4; }
.oi-side-tone-c { color: #fde047; }
.oi-side-tone-r { color: #fca5a5; }
.oi-side-tone-t { color: #94a3b8; }
.oi-sidebar-foot { padding: 12px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 8px; flex-shrink: 0; }
.oi-sidebar-hint { font-size: 0.72rem; color: #94a3b8; line-height: 1.4; }

body:not(.bd-oi-bi) .oi-widget-chart { display: none !important; }

.oi-intel-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}
.oi-intel-overlay[hidden] { display: none !important; }
.oi-intel-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
}
.oi-intel-drawer {
  position: relative;
  z-index: 1;
  width: min(380px, 92vw);
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
}
.oi-intel-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.oi-intel-drawer-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}
.oi-intel-drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.oi-intel-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 20px;
}
.oi-intel-drawer-body[hidden] { display: none !important; }

/* ---- Main column ---- */
.oi-main {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #f1f5f9;
  padding: 4px 6px 4px;
  display: flex;
  flex-direction: column;
}
.oi-command {
  position: relative;
  max-width: none;
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.oi-command-surface {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.oi-main-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.oi-hero-card {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 9px;
  padding: 4px 8px 0;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 3px 12px rgb(15 23 42 / 0.05);
  min-height: 0;
}
.oi-hero-card-top { margin-bottom: 0; }
.oi-hero-card .oi-subhead {
  padding: 6px 0 8px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
}

.oi-page-head {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 10px;
  padding: 2px 0 4px;
  min-height: 0;
}
.oi-page-head-left {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.oi-head-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #e8ecf1;
  background: linear-gradient(90deg, #f8fafc 0%, #fff 50%, #f8fafc 100%);
  background-size: 200% 100%;
  animation: oi-ticker-bg 8s linear infinite;
}
@keyframes oi-ticker-bg {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.oi-ticker-pill {
  flex-shrink: 0;
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
}
.oi-ticker-pill--insight {
  background: #ede9fe;
  color: #5b21b6;
}
.oi-ticker-pill--alert {
  background: #fef3c7;
  color: #b45309;
}
.oi-ticker-pill--event {
  background: #dbeafe;
  color: #1d4ed8;
}
.oi-ticker-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 1.25rem;
}
.oi-ticker-text {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.35s ease, transform 0.45s ease;
}
.oi-ticker-text.is-visible {
  opacity: 1;
  transform: translateX(0);
  animation: oi-ticker-slide 5s linear 1;
}
@keyframes oi-ticker-slide {
  0% { transform: translateX(8%); }
  100% { transform: translateX(-4%); }
}
.oi-period-dropdown {
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.oi-period-dropdown[data-period="week"] {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}
.oi-period-dropdown[data-period="month"] {
  border-color: #6ee7b7;
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
}
.oi-period-dropdown[data-period="year"] {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}
.oi-period-dropdown-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 4px 8px 4px 6px;
  cursor: pointer;
}
.oi-period-dropdown-ic {
  flex-shrink: 0;
  margin-top: 2px;
  color: #64748b;
  line-height: 0;
}
.oi-period-dropdown[data-period="week"] .oi-period-dropdown-ic { color: #2563eb; }
.oi-period-dropdown[data-period="month"] .oi-period-dropdown-ic { color: #059669; }
.oi-period-dropdown[data-period="year"] .oi-period-dropdown-ic { color: #d97706; }
.oi-period-dropdown-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 168px;
}
.oi-period-select {
  width: 100%;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0 16px 0 0;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  line-height: 1.25;
}
.oi-period-select:focus {
  outline: none;
}
.oi-period-dropdown:focus-within {
  outline: 2px solid #7c3aed;
  outline-offset: 1px;
}
.oi-period-range {
  display: block;
  margin: 0;
  font-size: 0.52rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.oi-period-week .oi-period-range,
.oi-period-dropdown[data-period="week"] .oi-period-range { color: #2563eb; }
body.oi-period-month .oi-period-range,
.oi-period-dropdown[data-period="month"] .oi-period-range { color: #059669; }
body.oi-period-year .oi-period-range,
.oi-period-dropdown[data-period="year"] .oi-period-range { color: #d97706; }
.oi-page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.oi-page-sub {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}
.oi-page-sub--sector {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.oi-page-head-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.oi-head-quick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.oi-head-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 5px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.oi-head-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}
.oi-head-btn:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}
.oi-head-btn-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  line-height: 0;
  flex-shrink: 0;
}
.oi-head-btn-label {
  letter-spacing: -0.01em;
}
/* Upload — soft blue accent */
a.oi-head-btn--upload .oi-head-btn-ic {
  color: #2563eb;
  background: #eff6ff;
}
a.oi-head-btn--upload:hover {
  border-color: #bfdbfe;
  background: #f8fafc;
  color: #1e40af;
}
a.oi-head-btn--upload:hover .oi-head-btn-ic {
  background: #dbeafe;
}
/* Experts — soft indigo accent */
a.oi-head-btn--experts .oi-head-btn-ic {
  color: #4f46e5;
  background: #eef2ff;
}
a.oi-head-btn--experts:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
  color: #3730a3;
}
a.oi-head-btn--experts:hover .oi-head-btn-ic {
  background: #e0e7ff;
}
/* AI — light violet; stronger only when open */
button.oi-head-btn--ai {
  color: #5b21b6;
  background: #faf5ff;
  border-color: #e9d5ff;
}
button.oi-head-btn--ai .oi-head-btn-ic {
  color: #7c3aed;
  background: #f3e8ff;
}
button.oi-head-btn--ai:hover {
  border-color: #d8b4fe;
  background: #f5f3ff;
  color: #4c1d95;
}
button.oi-head-btn--ai:hover .oi-head-btn-ic {
  background: #ede9fe;
}
body.wd-ai-panel-open button.oi-head-btn--ai#wdAiPanelTab {
  color: #fff;
  background: #7c3aed;
  border-color: #7c3aed;
  box-shadow: 0 1px 3px rgb(124 58 237 / 0.25);
}
body.wd-ai-panel-open button.oi-head-btn--ai#wdAiPanelTab .oi-head-btn-ic {
  color: #7c3aed;
  background: #fff;
}
a.oi-company-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(300px, 42vw);
  padding: 5px 8px 5px 5px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 55%, #f5f3ff 100%);
  text-decoration: none;
  color: #0f172a;
  box-shadow:
    0 1px 2px rgb(15 23 42 / 0.04),
    0 4px 14px rgb(91 33 182 / 0.08);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
a.oi-company-card:hover {
  border-color: #c4b5fd;
  box-shadow:
    0 4px 6px rgb(15 23 42 / 0.05),
    0 10px 24px rgb(91 33 182 / 0.14);
  transform: translateY(-1px);
}
a.oi-company-card:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}
.oi-company-card-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.35);
}
.oi-company-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.oi-company-card-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.oi-company-card-sub {
  font-size: 0.58rem;
  font-weight: 600;
  color: #64748b;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
}
.oi-company-card-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
  margin-left: 0;
  border-left: 1px solid #e2e8f0;
  font-size: 1rem;
  line-height: 1;
  color: #94a3b8;
  font-weight: 700;
  transition: color 0.2s, transform 0.15s;
}
a.oi-company-card:hover .oi-company-card-chevron {
  color: #7c3aed;
  transform: translateX(2px);
}
body.oi-period-week a.oi-company-card-sub { color: #2563eb; }
body.oi-period-month a.oi-company-card-sub { color: #059669; }
body.oi-period-year a.oi-company-card-sub { color: #d97706; }

/* Period tint on module grid */
body.oi-period-week .oi-main-inner,
.oi-command--period-week .oi-main-inner {
  --oi-period-tint: #eff6ff;
  --oi-period-accent: #3b82f6;
}
body.oi-period-month .oi-main-inner,
.oi-command--period-month .oi-main-inner {
  --oi-period-tint: #ecfdf5;
  --oi-period-accent: #10b981;
}
body.oi-period-year .oi-main-inner,
.oi-command--period-year .oi-main-inner {
  --oi-period-tint: #fffbeb;
  --oi-period-accent: #f59e0b;
}
body.oi-period-week .oi-grid-3,
body.oi-period-month .oi-grid-3,
body.oi-period-year .oi-grid-3 {
  background: var(--oi-period-tint);
  border-radius: 10px;
  padding: 6px;
  transition: background 0.25s ease;
}
body.oi-period-week .oi-tile,
.oi-command--period-week .oi-tile {
  box-shadow: inset 0 3px 0 var(--oi-period-accent, #3b82f6), 0 1px 3px rgb(15 23 42 / 0.06);
}
body.oi-period-month .oi-tile,
.oi-command--period-month .oi-tile {
  box-shadow: inset 0 3px 0 var(--oi-period-accent, #10b981), 0 1px 3px rgb(15 23 42 / 0.06);
}
body.oi-period-year .oi-tile,
.oi-command--period-year .oi-tile {
  box-shadow: inset 0 3px 0 var(--oi-period-accent, #f59e0b), 0 1px 3px rgb(15 23 42 / 0.06);
}
.oi-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #047857;
  font-size: 0.68rem;
  font-weight: 700;
}
.oi-live-pill--hold {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.oi-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  animation: oi-pulse-dot 2s ease infinite;
}
.oi-live-pill--hold .oi-live-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3); }
@keyframes oi-pulse-dot { 50% { opacity: 0.75; transform: scale(0.92); } }

.oi-date-range {
  font-size: 0.68rem;
  font-weight: 600;
  color: #475569;
  padding: 4px 9px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.oi-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.oi-icon-btn:hover { border-color: #cbd5e1; color: #0f172a; }
.oi-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 5px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  max-width: min(260px, 100%);
}
.oi-user-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.oi-user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oi-user-caret {
  flex-shrink: 0;
  border: none;
  background: transparent;
  padding: 2px 4px;
  margin: 0;
  cursor: pointer;
  color: #64748b;
  font-size: 0.65rem;
  line-height: 1;
  font-family: inherit;
}
.oi-user-caret:hover { color: #0f172a; }
.oi-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Subheader priorities + CTA */
.oi-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}
.oi-priorities-wrap { flex: 1; min-width: 200px; }
.oi-priorities-banner,
.bdu-kpi-banner.oi-priorities-banner {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0d9488 !important;
  line-height: 1.32;
}
.oi-priorities-banner strong { color: #0f766e; font-weight: 800; }
.oi-priorities-fallback { margin: 0; font-size: 0.85rem; color: #64748b; }

.oi-expert-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #c4b5fd;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.72rem;
  font-family: inherit;
  color: #5b21b6;
  background: #f5f3ff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.oi-expert-cta:hover {
  background: #ede9fe;
  border-color: #7c3aed;
  color: #4c1d95;
}
.oi-spark { font-size: 1rem; line-height: 1; }

/* 3×3 module grid — fit viewport without page scroll */
.oi-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  align-content: stretch;
}
@media (max-width: 900px) {
  body.bd-oi-page {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  body.bd-oi-page .bd-wrap {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }
  .oi-layout { height: auto; overflow: visible; }
  .oi-main { height: auto; overflow: visible; }
  .oi-main-inner {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .oi-grid-3 {
    height: auto;
    max-height: none;
    grid-template-rows: auto;
  }
  .oi-bottom-row { max-height: none; }
}
@media (max-width: 720px) {
  .oi-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .oi-layout { flex-direction: column; }
  .oi-sidebar {
    width: 100%;
    position: relative;
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
  }
  .oi-side-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .oi-side-label { width: 100%; }
  .oi-grid-3 { grid-template-columns: 1fr; }
}

.oi-tile {
  position: relative;
  background: #fff;
  border-radius: 8px;
  border: none;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
  padding: 8px 9px 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.oi-command:not(.oi-command--locked) .oi-tile:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}
.oi-tile-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding-right: 32px;
}
.oi-tile-icon { font-size: 1rem; line-height: 1; }
.oi-tile-title {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.oi-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 0;
  flex: 1;
  align-content: center;
}
@media (max-width: 480px) {
  .oi-kpi-strip { grid-template-columns: 1fr; }
}
.oi-kpi-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.oi-kpi-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.oi-kpi-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.oi-kpi-delta {
  font-size: 0.58rem;
  font-weight: 700;
}
.oi-kpi-delta--up { color: #059669; }
.oi-kpi-delta--down { color: #dc2626; }
.oi-kpi-delta--flat { color: #64748b; }

.oi-widget-chart {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: none;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: none;
  margin-bottom: 0;
}
.oi-chart-svg { width: 100%; height: 100%; display: block; }
@keyframes oi-bar-rise {
  from { transform: scaleY(0.35); opacity: 0.55; }
  to { transform: scaleY(1); opacity: 1; }
}
.oi-bar-anim {
  transform-origin: bottom center;
  animation: oi-bar-rise 0.85s ease backwards;
}

.oi-tile-ai {
  display: none !important;
  margin-top: auto;
  padding: 5px 7px;
  background: linear-gradient(180deg, #f0f9ff 0%, #eff6ff 55%, #f8fafc 100%);
  border-radius: 6px;
  border: 1px solid #e0f2fe;
  font-size: 0.6rem;
  line-height: 1.3;
  color: #475569;
  border-left: 3px solid var(--oi-accent, #7c3aed);
}
.oi-tile-ai-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.oi-tile-ai-text {
  min-width: 0;
  flex: 1;
}
.oi-tile-ai-arrow {
  flex-shrink: 0;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.45;
  margin-top: 1px;
}
.oi-tile-ai-lbl {
  font-weight: 800;
  color: var(--oi-accent, #7c3aed);
  margin-right: 5px;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

a.oi-widget-expand {
  text-decoration: none;
  color: inherit;
}
.oi-widget-expand {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.oi-widget-expand:hover:not(:disabled) {
  background: #f5f3ff;
  border-color: #7c3aed;
  color: #5b21b6;
}
.oi-widget-expand:disabled { opacity: 0.4; cursor: not-allowed; }
.oi-widget-expand--off { opacity: 0.2; }

/* Bottom row — MUST override style.css global `section` (padding-top:120px, flex centering) */
body.bd-oi-page section.oi-bottom-row,
.oi-bottom-row {
  display: none !important;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 5px;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  max-height: min(128px, 17vh);
  overflow: hidden;
  align-items: stretch !important;
  justify-content: initial !important;
  box-sizing: border-box;
}
@media (max-width: 1024px) {
  .oi-bottom-row { grid-template-columns: 1fr; }
}
.oi-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 3px 10px rgb(15 23 42 / 0.04);
  min-height: 0;
}
.oi-panel-title {
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.oi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.oi-dot--purple { background: #7c3aed; box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25); }
.oi-dot--insight { background: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22); }
.oi-dot--amber { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }

.oi-insight-list,
.oi-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.65rem;
  line-height: 1.3;
  color: #334155;
}
.oi-insight-list li,
.oi-alert-list li {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid #f1f5f9;
}
.oi-insight-list li:last-child,
.oi-alert-list li:last-child { border-bottom: none; }
.oi-sev { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.oi-sev--high { background: #ef4444; }
.oi-sev--med { background: #f59e0b; }

.oi-view-all {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7c3aed;
  text-decoration: none;
}
.oi-view-all:hover { text-decoration: underline; }

.oi-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.oi-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 6px;
  border-radius: 7px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  font-size: 0.62rem;
  font-weight: 700;
  color: #334155;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.oi-action-btn:hover { border-color: #7c3aed; background: #f5f3ff; color: #5b21b6; }
.oi-action-btn--ai {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff !important;
  border: none;
}
.oi-action-btn--ai:hover { filter: brightness(1.06); color: #fff !important; }

/* Locked + overlay */
.oi-command--locked .oi-command-surface {
  opacity: 0.45;
  filter: grayscale(0.06);
  pointer-events: none;
  user-select: none;
  transition: opacity 0.45s ease;
}
.oi-upload-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}
@media (min-width: 641px) {
  .oi-upload-layer { left: 220px; }
}
.oi-upload-card {
  pointer-events: auto;
  max-width: 500px;
  width: 100%;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  animation: oi-hero-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes oi-hero-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.oi-hero-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7c3aed;
  margin: 0 0 8px;
}
.oi-hero-title { font-size: 1.4rem; font-weight: 800; margin: 0 0 8px; color: #0f172a; }
.oi-hero-desc { font-size: 0.88rem; color: #64748b; line-height: 1.5; margin: 0 0 12px; }
.oi-hero-formats { font-size: 0.78rem; color: #475569; font-weight: 600; margin: 0 0 18px; }
.oi-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 33, 182, 0.35);
}
.oi-hero-btn:disabled { opacity: 0.65; cursor: not-allowed; }
.oi-hero-link { display: block; margin-top: 14px; font-size: 0.82rem; color: #7c3aed; font-weight: 600; }
.oi-hero-warn { margin-top: 12px; font-size: 0.78rem; color: #b45309; }
.oi-hero-bare { margin: 0 0 14px; font-size: 0.84rem; color: #64748b; }
.oi-hero-bare a { color: #7c3aed; font-weight: 700; }
.oi-hero-busy { opacity: 0.88; pointer-events: none; }

/* Boot stagger */
@keyframes oi-tile-boot {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.oi-command--booting .oi-tile { animation: oi-tile-boot 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.oi-command--booting .oi-tile:nth-child(1) { animation-delay: 0.03s; }
.oi-command--booting .oi-tile:nth-child(2) { animation-delay: 0.06s; }
.oi-command--booting .oi-tile:nth-child(3) { animation-delay: 0.09s; }
.oi-command--booting .oi-tile:nth-child(4) { animation-delay: 0.12s; }
.oi-command--booting .oi-tile:nth-child(5) { animation-delay: 0.15s; }
.oi-command--booting .oi-tile:nth-child(6) { animation-delay: 0.18s; }
.oi-command--booting .oi-tile:nth-child(7) { animation-delay: 0.21s; }
.oi-command--booting .oi-tile:nth-child(8) { animation-delay: 0.24s; }
.oi-command--booting .oi-tile:nth-child(9) { animation-delay: 0.27s; }
.oi-command--booting .oi-bottom-row { animation: oi-tile-boot 0.5s 0.3s backwards; }

/* Sector-adaptive cockpit accents */
body.bd-sector-manufacturing.bd-oi-page .oi-main { background: #f4f6f8; }
body.bd-sector-manufacturing .oi-page-title { letter-spacing: -0.03em; }
body.bd-sector-manufacturing .oi-tile--operations { border-top: none; }
body.bd-sector-manufacturing .oi-priorities-banner { border-left: 3px solid #64748b; }

body.bd-sector-service.bd-oi-page .oi-main { background: #f6faf9; }
body.bd-sector-service .oi-tile--customers { border-top: none; }
body.bd-sector-service .oi-priorities-banner { border-left: 3px solid #0d9488; }

body.bd-sector-raw.bd-oi-page .oi-main { background: #f4f8fa; }
body.bd-sector-raw .oi-tile--operations { border-top: none; }
body.bd-sector-raw .oi-priorities-banner { border-left: 3px solid #0284c7; }

body.bd-sector-trade .oi-priorities-banner { border-left: 3px solid #7c3aed; }
body.bd-sector-multi .oi-priorities-banner { border-left: 3px solid #6366f1; }

/* Visual themes — sector feel beyond renamed widgets */
.oi-theme-raw .oi-grid--resource { gap: 12px; }
.oi-theme-mfg .oi-grid-3 .oi-tile-head { letter-spacing: 0.01em; }
.oi-theme-multi .oi-secondary-modules { border-style: dashed; }

.oi-secondary-modules {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  padding: 5px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.oi-secondary-modules-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-right: 4px;
}
.oi-sec-mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cbd5e1;
  font-size: 0.78rem;
  color: #334155;
}
.oi-sec-mod-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #6366f1;
  font-weight: 700;
}
