.ag-theme-alpine{
  transition: background-color 0.3s ease, color 0.3s ease;
}

.ag-theme-alpine {
  --ag-font-size: 12px !important;
  --ag-alpine-active-color: rgb(0, 0, 0) !important;
  --ag-input-focus-border-color: var(--highcharts-background-color) !important;
  --ag-selected-row-background-color: var(--hover-orange) !important;
  --ag-row-hover-color: var(--hover-orange) !important;
  --ag-odd-row-background-color: var(--highcharts-background-color) !important;
  --ag-header-background-color: var(--highcharts-background-color) !important;
  --ag-background-color: var(--highcharts-background-color) !important;
}

.ag-theme-alpine[id*="nexus_gpt_gpt_schedule"] {
  max-width: 100% !important;
  overflow-x: auto !important;
}

.ag-theme-alpine[id*="nexus_gpt_gpt_schedule"] .ag-root-wrapper {
  max-width: 100% !important;
  overflow-x: auto !important;
}

.ag-theme-alpine[id*="nexus_gpt_gpt_schedule"] .ag-center-cols-container{
  max-width: 100% !important;
}

.ag-theme-alpine.compact {
  --ag-grid-size: 3px;
  --ag-header-height: 30px;
  border-radius: 12px;
}

.ag-theme-alpine.report-grid {
  --ag-grid-size: 3px;
  --ag-header-height: 30px;
  height: 340px !important;
  padding: 0px !important;
  align-items: center;
  overflow: visible;
}

.ag-theme-alpine.onboarding-grid {
  --ag-grid-size: 3px;
  --ag-header-height: 30px;
  --ag-background-color: var(--page-bg) !important;
  --ag-odd-row-background-color: var(--page-bg) !important;
  --ag-header-background-color: var(--page-bg) !important;
  height: 290px !important;
  padding: 0px !important;
  align-items: center;
  overflow: visible;
}

.ag-theme-alpine.onboarding-grid .ag-root-wrapper {
  border-radius: 10px;
}

.ag-theme-alpine.budgets {
  --ag-row-hover-color: none !important;
}

.ag-theme-alpine.compact.ads-api  .ag-cell-value,
.ag-theme-alpine.compact.ads-api .ag-group-value{
  font-size: 12px;
}

.ag-cell-value {
  white-space: pre !important;
}

.ag-root-wrapper {
  border: none !important;
}

.ag-cell-inline-editing * {
  height: 100% !important;
}

.ag-cell:has(.textarea-editor) {
  height:200px !important;
}

/* .ag-cell:has(.image-thumbnail) {
  height:200px !important;
} */

.ag-cell-focus {
  border: none !important;
  outline: none !important;
}

.ag-header-row-column {
  font-size: 16px;
}

/* Align content vertically centered */
.ag-cell {
  line-height: 40px !important;
  height: 40px !important;
 }

.ag-theme-alpine.performance-grid .ag-cell {
  height: 64px !important;
  line-height: 1.2 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ag-theme-alpine.performance-grid .ag-pinned-left-cols-container .ag-cell {
  justify-content: flex-start;
}

.ag-theme-alpine.performance-grid .ag-cell-value,
.ag-theme-alpine.performance-grid .ag-cell-wrapper {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-header-cell-label {
  justify-content: center;
}

.ag-icon, .ag-checkbox-input-wrapper {
  font-family: var(--ag-icon-font-family) !important;
}

div[col-id="ag-Grid-ControlsColumn"] {
  width: 40px !important;
}

div[col-id="ag-Grid-ControlsColumn"] .ag-selection-checkbox {
  margin-top: 8px;
}

.ag-floating-bottom.ag-selectable {
  overflow-y: hidden !important
}

.ag-header-impression, .ag-header-impressions {
  color: rgb(18, 183, 106);
}
.ag-header-clicks, .ag-header-pdp_only_med, .ag-header-cvr_med {
  color: rgb(243, 135, 68);
}
.ag-header-spend, .ag-header-pdp_only_top, .ag-header-cvr_top {
  color: rgb(238, 70, 188);
}
.ag-header-ad_sales {
  color: rgb(250, 197, 21);
}
.ag-header-total_sales, .ag-header-purchases {
  color: rgb(207, 36, 54);
}
.ag-header-ad_orders {
  color: rgb(243, 135, 68);
}
.ag-header-cpc, .ag-header-atc {
  color: rgb(11, 165, 236);
}
.ag-header-acos {
  color: rgb(113, 21, 250);
}
.ag-header-cvr, .ag-header-pdp_only, .ag-header-pdp {
  color: rgb(20, 146, 131);
}
.ag-header-ctr {
  color: rgb(111, 71, 134);
}
.ag-grid-title {
  align-self: flex-start;
  margin-bottom: -5px;
  font-size: 1.2em;
  font-weight: bold;
}

.ag-header-highlight-budget-col{
  background-color: var(--ag-grid-budget-background-color) !important;
  padding-left: 0px !important;
  padding-right: 0px !important;
}
.ag-header-highlight-budget-col .ag-header-active {
  background-color: var(--ag-grid-budget-background-color) !important;
}

.ag-header-highlight-budget-col .ag-header-cell-text{
  color: var(--ag-grid-budget-text-color) !important;
}

.ag-header-highlight-budget-col :hover{
  background-color: var(--page-bg) !important;
}
.ag-header-highlight-budget-col .ag-header-active :hover {
  background-color: var(--page-bg) !important;
}
.ag-header-highlight-budget-col :hover .ag-header-cell-text{
  color: var(--page-text) !important;
}

.asins-cross-purchase-spanned-cell {
  background: var(--highcharts-background-color) !important;
  border-right: 1px solid #babfc7 !important;
  border-bottom: 1px solid #babfc7 !important;
  align-content: center;
  color: var(--page-text)  !important;
}

.row-span-3 {
  height: 120px !important;
}

.row-span-2 {
  height: 80px !important;
}

.ag-header-cell-text {
  color: #435267;
}

.ag-cell-value a {
  color: #0fa4eb !important;
}

.ag-row-selected .ag-cell-value a {
  color: blue !important;
}
.ag-input-field-input{
  color: var(--page-text) !important;
}
.ag-input-field-input:focus {
  border-color: var(--main-color) !important;
}

.ag-checkbox-input-wrapper.ag-checked::after {
  background-color: white !important;
}

/* .ag-cell-normal-height {
  height: auto !important;
}

.ag-cell-value {
  height: auto !important;
} */

/* .ag-row .ag-row-normal-height {
  height: auto !important;
} */

/* .ag-row {
  height: auto !important;
} */

.ag-theme-alpine.report-grid.brand-tbl-height {
  height: 120px !important;
}

/* DSP Creative table at creative roll-ups: 60px preview thumbnails need taller rows */
.ag-theme-alpine.report-grid.preview-rows {
  height: 600px !important;
}

.ag-theme-alpine.report-grid.preview-rows .ag-cell {
  height: 100% !important;
  line-height: 63px !important;
}

.ag-theme-alpine.report-grid.preview-rows .ag-cell img {
  vertical-align: middle;
}

.creative-video-thumb {
  position: relative;
  display: inline-block;
  cursor: pointer;
  line-height: 0;
}

.creative-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  text-align: center;
}

.amc-time-to-conversion .ag-theme-alpine.report-grid,
.custom-height .ag-theme-alpine.report-grid {
  height: 350px !important;
}
.amc-time-to-conversion .ag-header-cell-label {
  justify-content: flex-start;
}

.ag-theme-alpine.report-grid.customer-journey {
  height: 200px !important;
}

.presets-icon {
  color: var(--main-color) !important;
  font-size: 16px;
  height: auto !important;
  width: auto !important;
}

.mantine-ActionIcon-icon  .presets-delete-icon {
  color: var(--main-color) !important;
  font-size: 16px;
  height: auto !important;
  width: auto !important;
}

.preset-delete-btn {
  padding: 0px !important;
}

.presets-label {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 0%;
  font-size: 15px;
  color: var(--page-text-secondary);
}

.presets-btn {
  color: var(--page-text);
  font-size: 15px;
  font-weight: 400;
}

.presets-btn[data-variant="subtle"] {
  background-color: transparent !important;
}

.presets-btn[data-variant="filled"] {
  background-color: var(--ag-grid-preset-btn-bg) !important;
}

.custom-preset-title-label {
  flex: 0 0 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-preset-label {
  flex: 0 0 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-preset-operator {
  flex: 0 0 70px;
}

.custom-preset-text-input {
  flex: 1 1 auto;
  min-width: 0;
}

.custom-preset-text-input .mantine-TextInput-input {
  width: 190px !important;
}

.custom-preset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

.custom-preset-title-input {
  flex: 1 1 auto;
  min-width: 0;
}

.custom-preset-title-input .mantine-TextInput-input {
  width: 280px !important;
}

.ag-grid-action-btn {
  border: none !important;
  margin-left: auto;
}

.custom-preset-range-input .mantine-NumberInput-input {
  width: 90px;
}

.custom-preset-number-input .mantine-NumberInput-input {
  width: 190px !important;
}

.ag-checked.ag-checkbox-input-wrapper::after {
  background-color: transparent !important;
}

/* Grid scrollbars — the global 1px ::-webkit-scrollbar rule leaves them
   invisible; keep in sync with SCROLLBAR_WIDTH in src/layout_components/ag_grid.py */
.ag-theme-alpine ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.ag-theme-alpine ::-webkit-scrollbar-track {
  background: transparent;
}

.ag-theme-alpine ::-webkit-scrollbar-thumb {
  background-color: var(--page-text-disabled);
  border-radius: 5px;
}

.ag-theme-alpine ::-webkit-scrollbar-thumb:hover {
  background-color: var(--page-text-muted);
}

/* Firefox ignores ::-webkit-scrollbar; give it the standard properties instead.
   Scoped via @supports so Chromium never sees them — standard scrollbar props
   on an element make Chrome 121+ ignore its ::-webkit-scrollbar styling. */
@supports (-moz-appearance: none) {
  .ag-theme-alpine .ag-body-horizontal-scroll-viewport,
  .ag-theme-alpine .ag-body-vertical-scroll-viewport,
  .ag-theme-alpine .ag-body-viewport {
    scrollbar-width: thin;
    scrollbar-color: var(--page-text-disabled) transparent;
  }
}

/* macOS overlay-scrollbar mode: AG Grid absolutely positions the horizontal bar
   and fades it in only while scrolling/hovering (ag-apple-scrollbar). Keep it
   in normal flow and permanently visible instead. */
.ag-body-horizontal-scroll.ag-scrollbar-invisible,
.ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar {
  position: relative !important;
  opacity: 1 !important;
  visibility: visible !important;
}
