/* Full-width dense cockpit — sidebar collapse + terminal density */

/* Adaptive cockpit strip removed */
.oi-subhead,
.oi-priorities-banner,
.bdu-kpi-banner {
  display: none !important;
}

/* Expert CTA in header row */
.oi-page-head-actions .oi-expert-cta {
  flex-shrink: 0;
}
.oi-page-head-actions .oi-live-pill,
.oi-page-head-actions .oi-date-range,
.oi-page-head-actions .oi-icon-btn,
.oi-page-head-actions .oi-expert-cta,
.oi-page-head-actions .oi-user-menu {
  display: none !important;
}
.oi-page-head-left .oi-page-sub--sector {
  margin-top: 0;
}
@media (max-width: 900px) {
  .oi-page-head {
    grid-template-columns: 1fr minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .oi-page-head-left {
    grid-column: 1 / -1;
  }
  .oi-head-ticker {
    grid-column: 1;
  }
  .oi-page-head-actions {
    grid-column: 2;
    justify-self: end;
  }
}
@media (max-width: 720px) {
  .oi-head-ticker {
    display: none;
  }
  .oi-page-head {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
  }
  .oi-page-head-left {
    grid-column: 1;
  }
  .oi-page-head-actions {
    grid-column: 2;
  }
  .oi-period-dropdown-body {
    max-width: 140px;
  }
  .oi-period-select {
    font-size: 0.62rem;
  }
  .oi-period-range {
    font-size: 0.5rem;
  }
  a.oi-company-card {
    max-width: min(180px, 38vw);
    padding: 4px 6px 4px 4px;
  }
  .oi-head-btn-label {
    display: none;
  }
  .oi-head-btn {
    padding: 5px 7px;
  }
  .oi-company-card-chevron {
    display: none;
  }
}
@media (max-width: 520px) {
  .oi-page-head {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .oi-page-head-left {
    width: 100%;
  }
  .oi-page-head-actions {
    width: 100%;
    margin-left: 0;
  }
  .oi-head-quick {
    flex: 1;
    justify-content: flex-end;
  }
  a.oi-company-card {
    max-width: min(100%, 200px);
    flex: 1;
  }
}

/* ---- Collapsible sidebar (ChatGPT-style) — full viewport height ---- */
.oi-layout {
  min-height: 100dvh;
  height: 100%;
}
@media (min-width: 641px) {
  .oi-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    max-height: none;
    width: 212px;
    z-index: 40;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .oi-main {
    margin-left: 212px;
    width: calc(100% - 212px);
    min-height: 100dvh;
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1), width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
      margin-right 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.oi-sidebar-collapsed .oi-sidebar {
    width: 56px;
  }
  body.oi-sidebar-collapsed .oi-main {
    margin-left: 56px;
    width: calc(100% - 56px);
  }
}
.oi-sidebar {
  width: 212px;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.oi-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.oi-sidebar-brand {
  padding: 0 !important;
  margin: 0 !important;
  flex: 1;
  min-width: 0;
}
.oi-brand-mini { display: none; }
.oi-brand-full { display: inline; }

.oi-sidebar-toggle {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, transform 0.22s;
}
.oi-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.oi-sidebar-toggle .oi-side-ic {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
}

.oi-side-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, max-width 0.22s;
}
.oi-side-nav {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 8px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}
.oi-side-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.oi-side-block--billing {
  padding-bottom: 6px !important;
  margin-bottom: 4px !important;
}
.oi-side-block--modules {
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 4px;
  padding: 0 0 6px;
  margin: 0;
}
.oi-side-block--modules .oi-side-label {
  margin: 0 6px 4px !important;
  flex-shrink: 0;
}
.oi-side-block--modules .oi-side-link {
  margin-bottom: 0 !important;
  flex-shrink: 0;
}
.oi-side-block--tools {
  flex-shrink: 0;
  gap: 4px;
  padding-top: 6px;
  margin-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.oi-side-label {
  margin: 12px 6px 8px !important;
}
.oi-side-label:first-of-type {
  margin-top: 4px !important;
}
.oi-side-link {
  gap: 10px;
  overflow: hidden;
  padding: 6px 10px !important;
  font-size: 0.72rem !important;
  margin-bottom: 0;
  min-height: 0;
}
.oi-side-link--upload:hover {
  color: #93c5fd !important;
}
.oi-side-link--experts:hover {
  color: #c4b5fd !important;
}
.oi-side-block--modules .oi-side-ic,
.oi-side-block--tools .oi-side-ic {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.oi-sidebar-foot {
  flex-shrink: 0;
  margin-top: auto;
  padding: 14px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.oi-sidebar-collapsed .oi-sidebar {
  width: 56px;
}
body.oi-sidebar-collapsed .oi-brand-full,
body.oi-sidebar-collapsed .oi-side-text,
body.oi-sidebar-collapsed .oi-side-label,
body.oi-sidebar-collapsed .oi-sidebar-hint,
body.oi-sidebar-collapsed .oi-sidebar-foot {
  display: none;
}
body.oi-sidebar-collapsed .oi-brand-mini {
  display: inline;
  font-size: 1rem;
}
body.oi-sidebar-collapsed .oi-sidebar-top {
  flex-direction: column;
  padding: 4px 6px 8px;
}
body.oi-sidebar-collapsed .oi-side-nav {
  padding: 0 4px;
}
body.oi-sidebar-collapsed .oi-side-link {
  justify-content: center;
  padding: 8px 6px;
}
body.oi-sidebar-collapsed .oi-sidebar-toggle {
  transform: rotate(180deg);
}
body.oi-sidebar-collapsed .oi-side-ic {
  margin: 0 auto;
}

@media (min-width: 641px) {
  body.bd-oi-page .bdu-ai-dock {
    left: 212px;
    right: 0;
    transition: left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.bd-oi-page.oi-sidebar-collapsed .bdu-ai-dock {
    left: 56px;
  }
  body.bd-oi-page .oi-upload-layer {
    left: 212px;
    transition: left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.bd-oi-page.oi-sidebar-collapsed .oi-upload-layer {
    left: 56px;
  }
}

/* ---- Compact header strip ---- */
.oi-hero-card {
  padding: 3px 8px 0;
  border-radius: 8px;
}
.oi-page-head {
  padding: 0 0 2px;
  gap: 8px;
}
.oi-page-head-left {
  gap: 6px;
}
.oi-page-head-actions {
  align-self: center;
}
.oi-hero-card-top {
  padding: 0;
}
.oi-page-title {
  font-size: 1rem;
}
.oi-page-sub {
  font-size: 0.68rem;
  margin-top: 1px;
}
.oi-tile-title {
  font-size: 0.8rem;
}
.oi-tile-head {
  margin-bottom: 5px;
}

body.bd-oi-bi .oi-tile-head {
  margin-bottom: 0 !important;
}
.oi-kpi-strip {
  gap: 3px;
  margin-bottom: 5px;
}
.oi-kpi-label {
  font-size: 0.52rem;
}
.oi-kpi-delta {
  font-size: 0.55rem;
}
.oi-tile-ai {
  display: none !important;
}
.oi-bottom-row {
  display: none !important;
}
.oi-panel {
  padding: 7px 9px;
}
.oi-panel-title {
  font-size: 0.68rem;
  margin-bottom: 4px;
}
.oi-insight-list,
.oi-alert-list {
  font-size: 0.62rem;
}
.oi-action-btn {
  font-size: 0.6rem;
  padding: 5px 5px;
}

/* Hide secondary module chips — reduces vertical waste */
.oi-secondary-modules {
  display: none !important;
}

/* Tighter global KPI strip — reference density */
body.bd-oi-bi .oi-global-kpis {
  gap: 1px;
}

body.bd-oi-bi .oi-gkpi {
  padding: 2px 4px 1px;
}

body.bd-oi-bi .oi-hero-card {
  padding: 1px 4px 0;
}

body.bd-oi-bi .oi-bi-panel {
  min-height: 0;
}

body.bd-oi-bi .oi-grid-3--bi {
  gap: 1px;
}

body.bd-oi-bi .oi-tile-head {
  margin-bottom: 0 !important;
}

body.bd-oi-bi .oi-kpi-strip {
  gap: 0 !important;
  margin-bottom: 0 !important;
}

/* BI mode: sidebar is fixed, main fills viewport */
@media (min-width: 641px) {
  body.bd-oi-page.bd-oi-bi .oi-main {
    height: 100% !important;
    overflow: hidden !important;
  }
}
