/* Glass Lite: keeps a modern tint but avoids expensive blur filters. */
html.theme-glass {
  --tableHeaderBg: rgba(224, 236, 250, 0.9);
  --tableHeaderBorder: rgba(128, 151, 181, 0.56);
  --tableHeaderText: #132d49;
  --tableHeaderBgHover: rgba(214, 229, 246, 0.96);

  --outputBandBg: rgba(108, 136, 169, 0.34);
  --outputBandActiveBg: rgba(92, 124, 161, 0.66);
  --outputBandText: #ffffff;
  --outputBandTextStrong: #ffffff;

  --topBarSecondaryText: #f1f7ff;
  --topBarSecondaryTextMuted: #dce8f8;
  --topBarControlBorder: rgba(192, 211, 235, 0.68);
  --topBarFocusRing: rgba(156, 189, 237, 0.78);
  --topBarControlBg: rgba(255, 255, 255, 0.06);
  --topBarControlBgHover: rgba(190, 208, 232, 0.16);
  --topBarDisabledText: rgba(225, 236, 251, 0.56);
  --topBarDisabledBorder: rgba(173, 192, 217, 0.3);
  --topBarDisabledBg: rgba(50, 64, 82, 0.4);
}

html.theme-glass body {
  background:
    radial-gradient(860px 360px at 8% -10%, rgba(141, 177, 221, 0.18) 0%, rgba(141, 177, 221, 0) 60%),
    radial-gradient(760px 300px at 94% 0%, rgba(118, 151, 194, 0.14) 0%, rgba(118, 151, 194, 0) 58%),
    linear-gradient(180deg, #edf2f7 0%, #e8eef6 100%);
  color: #1f2c3c;
}

html.theme-glass .navbar.navbar-dark {
  background: linear-gradient(180deg, rgba(31, 45, 61, 0.95) 0%, rgba(22, 34, 47, 0.92) 100%) !important;
  border-bottom: 1px solid rgba(196, 211, 231, 0.2);
  box-shadow: 0 3px 10px rgba(19, 34, 52, 0.16);
}

/* Top bar readability and accessible focus (Glass only). */
html.theme-glass .navbar .nav-item > div,
html.theme-glass .navbar .segment-nav-block #selectedSegmentLabel,
html.theme-glass .navbar .text-white-50,
html.theme-glass .navbar .small {
  color: var(--topBarSecondaryTextMuted) !important;
  font-weight: 500;
  letter-spacing: 0.01em;
}

html.theme-glass .navbar .nav-item > div span,
html.theme-glass .navbar .segment-nav-block #selectedSegmentLabel #currentSegmentNameOnly,
html.theme-glass .navbar .text-white {
  color: var(--topBarSecondaryText) !important;
  font-weight: 650;
}

html.theme-glass .navbar .btn,
html.theme-glass .navbar .dropdown-toggle,
html.theme-glass .navbar .form-select,
html.theme-glass .navbar .form-control {
  background-color: var(--topBarControlBg);
  border-color: var(--topBarControlBorder) !important;
}

html.theme-glass .navbar .btn:hover,
html.theme-glass .navbar .dropdown-toggle:hover,
html.theme-glass .navbar .form-select:hover,
html.theme-glass .navbar .form-control:hover {
  border-color: rgba(208, 223, 244, 0.86) !important;
}

html.theme-glass .navbar .btn-outline-light {
  color: var(--topBarSecondaryText) !important;
}

html.theme-glass .navbar .btn-outline-light:hover {
  background-color: var(--topBarControlBgHover) !important;
  color: #ffffff !important;
}

html.theme-glass .navbar .dropdown-menu .btn-danger,
html.theme-glass .navbar .dropdown-menu .btn-danger:active,
html.theme-glass .navbar .dropdown-menu .btn-danger:focus,
html.theme-glass .navbar .dropdown-menu .btn-danger:hover {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #ffffff !important;
}

html.theme-glass .navbar #filterSearchInput {
  color: var(--topBarSecondaryText) !important;
  -webkit-text-fill-color: var(--topBarSecondaryText);
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--topBarControlBorder) !important;
}

html.theme-glass .navbar #filterSearchInput::placeholder {
  color: var(--topBarSecondaryTextMuted) !important;
  opacity: 1;
}

html.theme-glass .navbar #filterSearchInput:focus {
  background-color: rgba(255, 255, 255, 0.14) !important;
}

html.theme-glass .navbar .report-save-location-nav .input-group-text {
  color: var(--topBarSecondaryText) !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--topBarControlBorder) !important;
}

html.theme-glass .navbar .btn:focus-visible,
html.theme-glass .navbar .dropdown-toggle:focus-visible,
html.theme-glass .navbar .form-select:focus-visible,
html.theme-glass .navbar .form-control:focus-visible {
  outline: 2px solid var(--topBarFocusRing);
  outline-offset: 1px;
  box-shadow: 0 0 0 0.2rem rgba(108, 148, 209, 0.34) !important;
}

html.theme-glass .navbar .btn:disabled,
html.theme-glass .navbar .btn.disabled,
html.theme-glass .navbar .form-select:disabled,
html.theme-glass .navbar .form-control:disabled {
  color: var(--topBarDisabledText) !important;
  border-color: var(--topBarDisabledBorder) !important;
  background: var(--topBarDisabledBg) !important;
  opacity: 1;
}

html.theme-glass #sidebarPanel {
  background: linear-gradient(180deg, rgba(243, 248, 255, 0.96) 0%, rgba(234, 242, 251, 0.94) 100%);
  border-left-color: rgba(164, 187, 215, 0.55);
  box-shadow: -3px 0 14px rgba(20, 37, 56, 0.12);
}

html.theme-glass .grid-container,
html.theme-glass .table-wrapper,
html.theme-glass .chart-module,
html.theme-glass .report-block,
html.theme-glass .filter-page,
html.theme-glass .cost-table-wrap {
  border-color: rgba(171, 191, 214, 0.62) !important;
  box-shadow: 0 4px 14px rgba(22, 44, 68, 0.08) !important;
}

html.theme-glass .grid-container,
html.theme-glass .table-wrapper,
html.theme-glass .chart-module,
html.theme-glass .filter-page,
html.theme-glass .cost-table-wrap {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 251, 255, 0.9) 100%) !important;
}

html.theme-glass .chart-module-canvas-wrap {
  background: rgba(236, 242, 248, 0.84);
  border-color: transparent;
}

html.theme-glass .chart-module {
  border-color: transparent !important;
  box-shadow: none !important;
}

html.theme-glass .report-loading-card,
html.theme-glass .grid-loading-card,
html.theme-glass .costs-loading {
  border-color: rgba(177, 195, 215, 0.62);
  box-shadow: 0 5px 14px rgba(20, 39, 62, 0.1);
}

html.theme-glass .form-control,
html.theme-glass .form-select,
html.theme-glass .input-group-text {
  border-color: rgba(161, 183, 208, 0.65);
  background-color: rgba(255, 255, 255, 0.92);
}

html.theme-glass .form-control:focus,
html.theme-glass .form-select:focus {
  border-color: rgba(105, 143, 191, 0.88);
  box-shadow: 0 0 0 0.14rem rgba(102, 150, 209, 0.18);
}

html.theme-glass .btn-primary {
  background: linear-gradient(180deg, #2b6ee8 0%, #1f5dcb 100%);
  border-color: #1f5dcb;
  box-shadow: 0 3px 8px rgba(42, 97, 181, 0.2);
}

html.theme-glass .btn-primary:hover {
  background: linear-gradient(180deg, #235fcf 0%, #1b4da6 100%);
  border-color: #1b4da6;
}

html.theme-glass .btn-secondary {
  background: linear-gradient(180deg, #6f7f91 0%, #5f6f81 100%);
  border-color: #5f6f81;
}

html.theme-glass .btn-success {
  background: linear-gradient(180deg, #23945b 0%, #1b7f4d 100%);
  border-color: #1b7f4d;
}

html.theme-glass .btn-outline-secondary {
  border-color: rgba(110, 139, 171, 0.6);
  background: rgba(255, 255, 255, 0.62);
}

html.theme-glass .btn-outline-secondary:hover {
  background: rgba(222, 235, 248, 0.72);
}

html.theme-glass .filter-grid th,
html.theme-glass .condition-grid th {
  background-color: rgba(225, 235, 247, 0.94) !important;
}

html.theme-glass .cost-table thead th {
  background: linear-gradient(180deg, rgba(34, 71, 116, 0.92) 0%, rgba(27, 55, 90, 0.92) 100%) !important;
  color: #ffffff !important;
  border-color: rgba(53, 89, 135, 0.7) !important;
}

html.theme-glass .cost-table tbody tr:nth-child(even) td.cost-value-cell:not(.cost-cell-disabled) {
  background: rgba(228, 240, 255, 0.88);
}

html.theme-glass .cost-table tbody tr:nth-child(odd) td.cost-value-cell:not(.cost-cell-disabled) {
  background: rgba(216, 232, 252, 0.88);
}

html.theme-glass .cost-table tbody tr:hover td.cost-value-cell:not(.cost-cell-disabled) {
  background: rgba(196, 218, 248, 0.96);
}

html.theme-glass .cost-table tbody tr:hover td.cost-level-cell {
  background: rgba(190, 212, 240, 0.96);
}

html.theme-glass .report-block {
  border-bottom-color: rgba(169, 188, 211, 0.5);
}

html.theme-glass .report-pill--base {
  background: rgba(238, 243, 250, 0.95);
}

html.theme-glass .report-pill--new {
  background: rgba(226, 238, 255, 0.95);
}

/* Header hierarchy / scanability (Glass only). */
html.theme-glass .normal-mode .thead-normal th.alt-header-cell,
html.theme-glass .normal-mode .thead-normal th.corner-cell,
html.theme-glass .transposed-mode .thead-transposed th.attribute-header,
html.theme-glass .transposed-mode .thead-transposed th.corner-cell {
  background-color: var(--tableHeaderBg) !important;
  color: var(--tableHeaderText) !important;
  font-weight: 680;
  letter-spacing: 0.018em;
  line-height: 1.2;
  border-bottom: 1px solid var(--tableHeaderBorder) !important;
  border-right: 1px solid rgba(128, 151, 181, 0.22);
  box-shadow:
    inset 0 -1px 0 rgba(95, 124, 160, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.48);
}

html.theme-glass .normal-mode .thead-normal th.alt-header-cell.grouped-alt-header,
html.theme-glass .transposed-mode .alternative-cell.grouped-alt-header {
  background-color: var(--grouped-alt-header-bg) !important;
  color: var(--grouped-alt-header-fg) !important;
}

html.theme-glass .normal-mode .thead-normal th.alt-header-cell:hover,
html.theme-glass .transposed-mode .thead-transposed th.attribute-header:hover {
  background-color: var(--tableHeaderBgHover) !important;
}

/* In transposed mode, keep the sticky first column in the same blue family
   as the standard-mode structural headers instead of the legacy grey. */
html.theme-glass .transposed-mode .alternative-cell {
  background-color: rgba(220, 233, 249, 0.92) !important;
  color: var(--tableHeaderText) !important;
  border-right: 1px solid rgba(128, 151, 181, 0.24);
  box-shadow:
    inset 0 -1px 0 rgba(95, 124, 160, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

html.theme-glass .transposed-mode .alternative-cell:hover {
  background-color: rgba(212, 227, 246, 0.96) !important;
}

html.theme-glass .normal-mode .thead-normal th.alt-header-cell.grouped-alt-header:hover,
html.theme-glass .transposed-mode .alternative-cell.grouped-alt-header:hover {
  background-color: var(--grouped-alt-header-bg) !important;
}

/* Keep drag-select clearly visible in Glass mode. */
html.theme-glass .alt-header-cell.drag-select-highlight,
html.theme-glass .alternative-cell.drag-select-highlight,
html.theme-glass .normal-mode .thead-normal th.alt-header-cell.drag-select-highlight,
html.theme-glass .transposed-mode .thead-transposed th.attribute-header.drag-select-highlight {
  background-color: rgba(120, 162, 207, 0.38) !important;
  border-color: rgba(86, 130, 178, 0.82) !important;
  box-shadow:
    inset 0 0 0 1px rgba(79, 122, 170, 0.55),
    0 0 0 1px rgba(171, 201, 235, 0.35);
}

html.theme-glass .normal-mode .thead-normal tr,
html.theme-glass .transposed-mode .thead-transposed tr {
  box-shadow: inset 0 -2px 0 var(--tableHeaderBorder);
}

html.theme-glass .normal-mode .thead-normal th.alt-header-cell br {
  display: block;
  margin-top: 0.2rem;
  line-height: 0.5;
  content: '';
}

/* Output band balancing (Glass only). */
html.theme-glass .normal-mode .tfoot-normal .outgrid-row > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row > td.output-cell.metric-cell,
html.theme-glass .transposed-mode th.outgrid-cell,
html.theme-glass .transposed-mode td.outgrid-cell.metric-cell {
  background-color: var(--outputBandBg) !important;
  color: var(--outputBandText) !important;
  transition: background-color 0.18s ease, color 0.18s ease;
}

/* Normal-mode row separators should look identical across label + metric cells. */
html.theme-glass .normal-mode .tfoot-normal .outgrid-row > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row > td.output-cell.metric-cell {
  border-top: none !important;
  border-bottom: 1px solid rgba(119, 145, 176, 0.42) !important;
}

html.theme-glass .normal-mode .tfoot-normal .outgrid-row:last-child > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:last-child > td.output-cell.metric-cell {
  border-bottom: none !important;
}

/* Match legacy Glass Lite normal outgrid row colors exactly. */
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) > td.output-cell.metric-cell {
  background-color: rgb(220, 227, 236) !important;
}

html.theme-glass .normal-mode .tfoot-normal .outgrid-row .new-metric-value,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row .base-metric-value,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row .abs-metric-change,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row .rel-metric-change {
  color: var(--outputBandTextStrong) !important;
  font-weight: 590;
}

/* Glass Lite: unselected output rows should read with dark text. */
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) > td.output-cell.metric-cell,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) .new-metric-value,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) .base-metric-value,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) .abs-metric-change,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:not(.outgrid-row-active) .rel-metric-change {
  color: #111111 !important;
  text-shadow: none !important;
}

html.theme-glass .normal-mode .tfoot-normal .outgrid-row > th {
  font-weight: 620;
}

html.theme-glass .normal-mode .tfoot-normal .outgrid-row:hover > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row:hover > td.output-cell.metric-cell {
  background-color: rgba(92, 124, 161, 0.34) !important;
}

html.theme-glass .normal-mode .tfoot-normal .outgrid-row.outgrid-row-active > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row.outgrid-row-active > td.output-cell.metric-cell,
html.theme-glass .transposed-mode .outgrid-cell.outgrid-row-active {
  background-color: rgb(169, 187, 206) !important;
  color: #f5f9ff !important;
}

html.theme-glass .normal-mode .tfoot-normal .outgrid-row.outgrid-row-active .new-metric-value,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row.outgrid-row-active .base-metric-value,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row.outgrid-row-active .abs-metric-change,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row.outgrid-row-active .rel-metric-change {
  color: #ffffff !important;
  font-weight: 640;
}

html.theme-glass .normal-mode .tfoot-normal td.output-cell.metric-cell.output-cell-with-bar .metric-track {
  display: none;
}

/* Transposed outgrid polish (Glass only). */
html.theme-glass .transposed-mode th.outgrid-cell {
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 -1px 0 rgba(23, 47, 77, 0.38);
}

/* Normal mode outgrid: no vertical separators (match legacy look). */
html.theme-glass .normal-mode .tfoot-normal .outgrid-row > th,
html.theme-glass .normal-mode .tfoot-normal .outgrid-row > td.output-cell.metric-cell {
  border-left: none !important;
  border-right: none !important;
}

html.theme-glass .transposed-mode th.outgrid-cell.outgrid-cell-new,
html.theme-glass .transposed-mode th.outgrid-cell.outgrid-cell-chg {
  background-color: rgba(41, 71, 110, 0.92) !important;
  color: #ffffff !important;
}

html.theme-glass .transposed-mode th.outgrid-cell.outgrid-cell-base,
html.theme-glass .transposed-mode th.outgrid-cell.outgrid-cell-rel {
  background-color: rgba(58, 87, 126, 0.92) !important;
  color: #ffffff !important;
}

html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-new-data,
html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-chg-data,
html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-base-data,
html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-rel-data {
  background-color: rgba(227, 236, 247, 0.92) !important;
  color: #1f3652 !important;
}

html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-new-data,
html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-base-data {
  background-image:
    linear-gradient(to right, rgba(122, 147, 179, 0.18) 0, rgba(122, 147, 179, 0.18) 1px, transparent 1px),
    linear-gradient(to right, rgba(122, 147, 179, 0.24) 0, rgba(122, 147, 179, 0.24) 1px, transparent 1px),
    linear-gradient(to right, rgba(122, 147, 179, 0.18) 0, rgba(122, 147, 179, 0.18) 1px, transparent 1px);
  background-repeat: no-repeat;
  background-size: 1px 100%, 1px 100%, 1px 100%;
  background-position: 25% 0, 50% 0, 75% 0;
}

html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .newbars,
html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .basebars {
  background-color: rgba(97, 164, 236, 0.98) !important;
}

html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .changebars,
html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .relchangebars {
  border-radius: 0 !important;
  min-width: 2px;
  box-shadow: none !important;
}

html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .new-metric-value,
html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .base-metric-value,
html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .abs-metric-change,
html.theme-glass .transposed-mode td.outgrid-cell.metric-cell .rel-metric-change {
  color: #1f3652 !important;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}

html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-new-data .new-metric-value,
html.theme-glass .transposed-mode td.outgrid-cell.outgrid-cell-base-data .base-metric-value {
  left: 8px !important;
  right: auto !important;
  transform: translateY(-50%);
  width: auto;
  max-width: calc(100% - 12px);
  padding: 0;
  text-align: left;
}
