/* Data Soyuz / Soyuz palette. Dense glass; no canvas filters or animated blur. */
:root {
  --soyuz-bg: #0e1424;
  --soyuz-panel: #151d31;
  --soyuz-raised: #1e2942;
  --soyuz-deep: #0a0f1d;
  --soyuz-text: #eef3f8;
  --soyuz-secondary: #b9c6d8;
  --soyuz-muted: #8ea0b8;
  --soyuz-accent: #4fd1d9;
  --soyuz-accent-hover: #66dbe2;
  --soyuz-on-accent: #06232a;
  --soyuz-border: rgba(122, 200, 220, 0.16);
  --soyuz-grid: #24314d;
  --soyuz-glass: rgba(21, 29, 49, 0.94);
  --soyuz-glass-raised: rgba(30, 41, 66, 0.96);
  --soyuz-sheen: linear-gradient(135deg, rgba(238, 243, 248, 0.035), rgba(79, 209, 217, 0.018) 42%, transparent 75%);
  --soyuz-shadow: 0 10px 28px rgba(2, 6, 16, 0.18);
  color-scheme: dark;
}

body {
  background-color: var(--soyuz-bg) !important;
  color: var(--soyuz-text) !important;
  -webkit-font-smoothing: antialiased;
}

body:not(.standalone) {
  background-image: radial-gradient(ellipse at 8% 0%, rgba(79, 209, 217, 0.065), transparent 44%),
                    radial-gradient(ellipse at 92% 4%, rgba(57, 135, 229, 0.045), transparent 40%);
  background-attachment: fixed;
}

/* Stable Superset / Ant Design selectors; Emotion hash selectors are avoided. */
#main-menu,
.navbar.navbar-static-top,
.ant-layout-header {
  background: var(--soyuz-sheen), var(--soyuz-glass) !important;
  border-bottom: 1px solid rgba(79, 209, 217, 0.30) !important;
  box-shadow: inset 0 1px 0 rgba(238, 243, 248, 0.055), 0 8px 22px rgba(2, 6, 16, 0.12);
}

#main-menu .ant-menu,
.navbar .ant-menu,
.ant-layout-header .ant-menu {
  background: transparent !important;
}

.navbar-brand img,
img[alt="OOM"] {
  filter: brightness(0) invert(1);
}

.dashboard-header,
.dashboard-component-tabs,
.dashboard-component-chart-holder,
.ant-card {
  background: var(--soyuz-sheen), rgba(21, 29, 49, 0.97) !important;
  border-color: var(--soyuz-border) !important;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(238, 243, 248, 0.035), var(--soyuz-shadow);
}

/* Chart cards are deliberately not blurred: many GPU layers hurt scrolling. */
.dashboard-component-chart-holder .chart-container,
.dashboard-component-chart-holder .slice_container,
.dashboard-component-chart-holder .chart-slice {
  background: transparent !important;
}

.dashboard-header { border-bottom: 1px solid var(--soyuz-border); }
.dashboard-header .ant-btn-primary { font-weight: 600; }

/* Superset 6.1.0: the empty root Tabs drop target otherwise has zero height.
   Mirrors upstream fix apache/superset#39423; applies only in edit mode
   before root-level tabs exist, without moving or rewriting dashboard content. */
[data-test="dashboard-header-wrapper"]
  [data-test="top-level-tabs"].empty-droptarget {
  min-height: 16px;
}

.ant-modal-content,
.ant-drawer-content,
.ant-popover-inner,
.ant-dropdown-menu {
  background: var(--soyuz-sheen), var(--soyuz-glass-raised) !important;
  border: 1px solid rgba(122, 200, 220, 0.22);
  box-shadow: inset 0 1px 0 rgba(238, 243, 248, 0.055), 0 18px 44px rgba(2, 6, 16, 0.38);
}

.ant-select-dropdown,
.ant-picker-dropdown .ant-picker-panel-container,
.ant-tooltip-inner {
  background-color: #1e2942 !important;
  border: 1px solid var(--soyuz-border);
}

.ant-btn-primary:not(:disabled) { color: var(--soyuz-on-accent); font-weight: 600; }
.ant-btn-dangerous.ant-btn-primary:not(:disabled) { color: #fff; }
.ant-btn:focus-visible,
.ant-input:focus-visible,
.ant-select-focused .ant-select-selector {
  outline: 2px solid var(--soyuz-accent);
  outline-offset: 2px;
}
.ant-switch-checked .ant-switch-handle::before { background: var(--soyuz-on-accent); }

.ant-table { font-variant-numeric: tabular-nums; }
.ant-table-thead > tr > th { border-bottom-color: var(--soyuz-grid) !important; }
.ant-table-tbody > tr > td { border-bottom-color: var(--soyuz-grid) !important; }
.ant-table-tbody > tr:hover > td { background-color: var(--soyuz-raised) !important; }

/* SQL Lab uses its own syntax colors; only surfaces and selection are changed. */
.ace_editor, .ace_gutter { background-color: var(--soyuz-deep) !important; }
.ace_gutter { color: var(--soyuz-muted) !important; }
.ace_marker-layer .ace_selection { background-color: #1f3a55 !important; }
.ace_cursor { border-left-color: var(--soyuz-accent) !important; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #main-menu, .navbar.navbar-static-top, .ant-layout-header,
  .ant-modal-content, .ant-drawer-content, .ant-popover-inner {
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    backdrop-filter: blur(10px) saturate(130%);
  }
}

@media (max-width: 768px) {
  #main-menu, .navbar.navbar-static-top, .ant-layout-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: #151d31 !important;
  }
  .ant-btn, .ant-input, .ant-select-selector { font-size: 16px; }
}

@media (prefers-reduced-transparency: reduce) {
  #main-menu, .navbar.navbar-static-top, .ant-layout-header,
  .ant-modal-content, .ant-drawer-content, .ant-popover-inner,
  .ant-dropdown-menu, .dashboard-component-chart-holder, .ant-card {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #151d31 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  #main-menu, .navbar.navbar-static-top, .ant-layout-header,
  .ant-modal-content, .ant-drawer-content, .ant-popover-inner, .ant-card,
  .dashboard-component-chart-holder {
    background: Canvas !important;
    color: CanvasText !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  .ant-btn-primary:not(:disabled) { color: ButtonText; }
}
