body {
  min-height: 100vh;
}

.savings-suggestions-scroll {
  max-height: 720px;
  overflow: auto;
}

.savings-new-form {
  width: min(680px, 100%);
}

.savings-suggestions-table {
  min-width: 860px;
  table-layout: fixed;
}

.savings-suggestions-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bs-tertiary-bg);
}

.savings-suggestions-table > thead > tr > th:nth-child(1) { width: 34%; }
.savings-suggestions-table > thead > tr > th:nth-child(2) { width: 25%; }
.savings-suggestions-table > thead > tr > th:nth-child(3) { width: 14%; }
.savings-suggestions-table > thead > tr > th:nth-child(4) { width: 12%; }
.savings-suggestions-table > thead > tr > th:nth-child(5) { width: 15%; }

.savings-suggestions-table > tbody > tr:first-child > td {
  padding: 0.7rem 1rem;
}

.savings-suggestion-title {
  min-width: 0;
}

.savings-detail-panel {
  background: var(--bs-tertiary-bg);
}

.savings-detail-toggle .bi-chevron-down {
  display: inline-block;
  transition: transform 160ms ease;
}

.savings-detail-toggle[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.advisor-recommendations-scroll {
  max-height: 720px;
  overflow: auto;
}

.advisor-recommendations-table {
  min-width: 1100px;
  table-layout: fixed;
}

.advisor-recommendations-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bs-tertiary-bg);
}

.advisor-recommendations-table > thead > tr > th:nth-child(1) { width: 34%; }
.advisor-recommendations-table > thead > tr > th:nth-child(2) { width: 10%; }
.advisor-recommendations-table > thead > tr > th:nth-child(3) { width: 14%; }
.advisor-recommendations-table > thead > tr > th:nth-child(4) { width: 16%; }
.advisor-recommendations-table > thead > tr > th:nth-child(5) { width: 14%; }
.advisor-recommendations-table > thead > tr > th:nth-child(6) { width: 12%; }

.advisor-recommendation-group > tr:first-child > td {
  padding: 0.8rem 1rem;
}

.advisor-impact {
  display: inline-block;
  min-width: 5.5rem;
  padding: 0.35rem 0.5rem;
  border-left: 4px solid var(--bs-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.advisor-impact--danger { border-left-color: var(--bs-danger); }
.advisor-impact--warning { border-left-color: var(--bs-warning); }
.advisor-impact--info { border-left-color: var(--bs-info); }

.advisor-detail-toggle .bi-chevron-down {
  display: inline-block;
  transition: transform 160ms ease;
}

.advisor-detail-toggle[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.advisor-resource-table {
  min-width: 980px;
}

.advisor-import-preview-scroll {
  max-height: 340px;
}

.trend-chart {
  width: 100%;
  height: auto;
  background: linear-gradient(180deg, rgba(13, 110, 253, 0.08), rgba(13, 110, 253, 0));
  border-radius: 1rem;
}

.area-chart {
  width: 100%;
  height: auto;
  border-radius: 1rem;
}

.area-chart--green {
  background: linear-gradient(180deg, rgba(25, 135, 84, 0.06), rgba(25, 135, 84, 0));
}

.chart-tooltip {
  position: absolute;
  background: #1e293b;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  pointer-events: none;
  z-index: 1050;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: none;
}

.chart-tooltip-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

.chart-tooltip-value {
  font-weight: 600;
}

.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.chart-tooltip-key {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

.chart-tooltip-val {
  font-weight: 600;
}

.cost-progress {
  height: 0.85rem;
  border-radius: 999px;
}

.cost-progress .progress-bar {
  border-radius: 999px;
}

/* Cost Management: keep the add-filter actions inside the viewport even when
   Azure returns long resource, product, or meter names. */
.acm-add-filter-panel {
  width: 560px;
  max-width: calc(100vw - 1rem);
}

.acm-add-filter-body {
  min-height: 280px;
  min-width: 0;
  overflow: hidden;
}

.acm-add-filter-fields {
  flex: 0 0 215px;
  min-width: 0;
}

.acm-add-filter-values {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.acm-add-filter-value-list {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 290px;
  overflow-x: hidden;
  overflow-y: auto;
}

.acm-add-filter-value-list .af-value-item {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.acm-add-filter-value-list .af-value-item.af-value-item--hidden {
  display: none !important;
}

.acm-add-filter-value-list .af-value-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acm-add-filter-footer,
.acm-add-filter-actions {
  flex-shrink: 0;
}

.ov2-date-picker .min-w-0 {
  min-width: 0;
}

.ov2-date-menu {
  min-width: 360px;
}

.ov2-date-menu-heading {
  color: #555;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ov2-date-range-label {
  font-size: 0.75rem;
  white-space: nowrap;
}

.ov2-date-menu .btn-link:disabled {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

/* Cost Management smart view: Resources */
.smart-resources-search {
  width: min(320px, 100%);
}

.smart-resources-scroll {
  max-height: 650px;
  overflow: auto;
}

.smart-resources-table {
  width: 100%;
  min-width: 1240px;
  table-layout: fixed;
  font-size: 0.8rem;
}

.smart-resource-col-name { width: 250px; }
.smart-resource-col-type { width: 155px; }
.smart-resource-col-group { width: 205px; }
.smart-resource-col-location { width: 115px; }
.smart-resource-col-subscription { width: 235px; }
.smart-resource-col-tags { width: 170px; }
.smart-resource-col-total { width: 110px; }

.smart-resources-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0.65rem 0.55rem;
  color: #495057;
  background: #fff;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.smart-resources-table > tbody > tr.smart-resource-row > td {
  max-width: 260px;
  padding: 0.42rem 0.55rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-resources-table > thead > tr > th:last-child {
  right: 0;
  z-index: 5;
  background: #fff;
  box-shadow: -5px 0 7px -7px rgba(0, 0, 0, 0.65);
}

.smart-resources-table > tbody > tr.smart-resource-row > td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -5px 0 7px -7px rgba(0, 0, 0, 0.65);
}

.smart-resource-name-cell {
  min-width: 285px;
}

.smart-resource-toggle {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.15rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: #0878d1;
  text-decoration: none;
  vertical-align: middle;
}

.smart-resource-toggle-symbol {
  display: inline-flex;
  width: 0.85rem;
  height: 0.85rem;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.smart-resource-icon {
  margin-right: 0.35rem;
  color: #249be8;
}

.smart-resource-name {
  color: #0878d1;
}

.smart-resource-tags {
  display: flex;
  width: 100%;
  max-width: 155px;
  gap: 0.22rem;
  overflow: hidden;
  white-space: nowrap;
}

.smart-resource-tag {
  display: inline-block;
  max-width: 170px;
  padding: 0.08rem 0.3rem;
  overflow: hidden;
  color: #24435a;
  background: #d8ecfa;
  border-radius: 0.12rem;
  text-overflow: ellipsis;
}

.smart-resource-detail-row > td {
  padding: 0.7rem 1.75rem !important;
  background: #fafbfc;
}

.smart-resource-inner-table {
  min-width: 1000px;
  font-size: 0.78rem;
  border: 1px solid #dfe4e8;
}

.smart-resource-inner-table thead th {
  padding: 0.5rem;
  color: #495057;
  background: #f4f5f6;
  white-space: nowrap;
}

.smart-resource-inner-table tbody td {
  padding: 0.42rem 0.5rem;
}

.smart-resource-selected-chip {
  color: #17384d;
  background: #e5f2fa;
}

.smart-resource-services-table {
  width: 100%;
  min-width: 1050px;
  table-layout: fixed;
  font-size: 0.82rem;
}

.smart-resource-services-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0.65rem 0.55rem;
  color: #343a40;
  background: #fff;
  white-space: nowrap;
}

.smart-resource-services-table > thead > tr > th:first-child { width: 28%; }
.smart-resource-services-table > thead > tr > th:nth-child(2) { width: 25%; }
.smart-resource-services-table > thead > tr > th:nth-child(3) { width: 20%; }
.smart-resource-services-table > thead > tr > th:nth-child(4) { width: 19%; }
.smart-resource-services-table > thead > tr > th:last-child { width: 8%; }

.smart-resource-services-table > tbody > tr.smart-resource-service-row > td {
  padding: 0.46rem 0.55rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-resource-services-table > thead > tr > th:last-child,
.smart-resource-services-table > tbody > tr.smart-resource-service-row > td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #fff;
  box-shadow: -5px 0 7px -7px rgba(0, 0, 0, 0.65);
}

.smart-resource-service-detail-table {
  min-width: 900px;
}

.smart-resource-final-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  font-size: 0.82rem;
}

.smart-resource-final-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0.65rem 0.55rem;
  color: #343a40;
  background: #fff;
  white-space: nowrap;
}

.smart-resource-final-table > thead > tr > th:last-child {
  width: 120px;
}

.smart-resource-final-table > tbody > tr.smart-resource-level-row > td {
  padding: 0.46rem 0.55rem;
}

.smart-resource-final-table > thead > tr > th:last-child,
.smart-resource-final-table > tbody > tr.smart-resource-level-row > td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #fff;
  box-shadow: -5px 0 7px -7px rgba(0, 0, 0, 0.65);
}

.smart-resource-final-detail-table {
  min-width: 980px;
}

.local-tags-heading-copy {
  position: relative;
  padding-left: 1.5rem;
}

.local-tags-heading-copy > .bi {
  position: absolute;
  top: 0.45rem;
  left: 0;
}

.local-tags-aligned-copy {
  position: relative;
  padding-left: 1.5rem;
}

.local-tags-aligned-copy > .bi:first-child {
  position: absolute;
  top: 50%;
  left: 0.5rem;
  transform: translateY(-50%);
}

@media (min-width: 992px) {
  .local-tag-remove-panel {
    position: relative;
  }

  .local-tag-remove-panel::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-left: 1px solid var(--bs-border-color);
  }

  .local-tag-remove-panel::after {
    content: "O";
    position: absolute;
    top: 50%;
    left: 0;
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
    font-weight: 700;
  }
}

.local-tag-mobile-separator {
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--bs-secondary-color);
  font-size: 0.7rem;
  font-weight: 700;
}

.local-tag-mobile-separator::before,
.local-tag-mobile-separator::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--bs-border-color);
}

.local-tag-mobile-separator span {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid var(--bs-border-color);
  border-radius: 50%;
  background: var(--bs-body-bg);
}

@media (max-width: 575.98px) {
  .acm-add-filter-fields {
    flex-basis: 40%;
  }

  .acm-add-filter-footer {
    flex-wrap: wrap;
  }

  .acm-add-filter-actions {
    margin-left: auto;
  }

  .ov2-date-menu {
    min-width: min(360px, calc(100vw - 2rem));
  }
}
