.services-page {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.services-page > * {
  min-width: 0;
}

.services-achi-summary__year,
.services-section-count {
  align-self: start;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.services-achi-subviews {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border: 1px solid var(--border-color, rgba(148, 163, 184, 0.35));
  border-radius: 0.8rem;
  background: var(--surface-muted, rgba(15, 23, 42, 0.04));
}

.services-achi-subviews button {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 0.6rem;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.services-achi-subviews button[aria-selected="true"] {
  color: var(--accent-contrast, #fff);
  background: var(--accent, #167d6b);
}

.services-doctor-achi-filters,
.services-doctor-achi-table-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.services-doctor-achi-filters__doctor,
.services-doctor-achi-table-tools label:first-child {
  grid-column: span 2;
}

.services-doctor-achi-filters label,
.services-doctor-achi-table-tools label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
  font-weight: 700;
}

.services-doctor-achi-filters select,
.services-doctor-achi-filters input,
.services-doctor-achi-table-tools select,
.services-doctor-achi-table-tools input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-color, #94a3b8);
  border-radius: 0.6rem;
  color: var(--text-color, inherit);
  background: var(--surface, #fff);
  font: inherit;
}

.services-doctor-achi-disclaimer,
#servicesDoctorAchiActiveAverage {
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .services-achi-subviews {
    display: grid;
    width: 100%;
  }

  .services-doctor-achi-filters,
  .services-doctor-achi-table-tools {
    grid-template-columns: 1fr;
  }

  .services-doctor-achi-filters__doctor,
  .services-doctor-achi-table-tools label:first-child {
    grid-column: auto;
  }
}

.services-achi-summary__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.services-achi-card {
  display: grid;
  gap: 8px;
  min-height: 94px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-alt);
}

.services-achi-card--accent {
  border-color: color-mix(in srgb, var(--color-accent) 38%, var(--color-border));
  background: color-mix(in srgb, var(--color-accent-soft) 55%, var(--color-surface));
}

.services-achi-card__label {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.services-achi-card__value {
  color: var(--color-text);
  font-size: clamp(1.1rem, 2.4vw, 1.65rem);
  line-height: 1.1;
}

.services-achi-panel .services-chart-frame--tall {
  min-height: 420px;
  height: clamp(420px, 52vh, 570px);
  max-height: 570px;
}

.services-achi-panel .services-table-wrapper {
  max-height: 540px;
}

.services-achi-panel .section__header {
  align-items: flex-start;
}

.services-achi-panel .section__actions {
  justify-content: flex-end;
}

.services-achi-ranking-chart-actions,
.services-achi-ranking-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.services-achi-ranking-chart-actions[hidden],
.services-achi-ranking-table-actions[hidden] {
  display: none;
}

.services-achi-ranking-table-wrapper {
  max-height: min(720px, 70vh);
}

.services-achi-ranking-table-wrapper table {
  min-width: 860px;
}

#servicesAchiRankingTable th:first-child,
#servicesAchiRankingTable td:first-child {
  width: 52px;
  min-width: 52px;
}

#servicesAchiRankingTable th:nth-child(2),
#servicesAchiRankingTable td:nth-child(2) {
  width: 124px;
  min-width: 124px;
}

#servicesAchiRankingTable th:nth-child(3),
#servicesAchiRankingTable td:nth-child(3) {
  min-width: 280px;
}

#servicesAchiRankingTable th:nth-child(4),
#servicesAchiRankingTable td:nth-child(4) {
  min-width: 190px;
}

#servicesAchiRankingTable th:nth-child(5),
#servicesAchiRankingTable td:nth-child(5),
#servicesAchiRankingTable th:nth-child(6),
#servicesAchiRankingTable td:nth-child(6) {
  min-width: 112px;
}

.services-achi-ranking-table__rank {
  width: 52px;
  min-width: 52px;
}

.services-achi-ranking-table__code {
  min-width: 124px;
  white-space: nowrap;
}

.services-achi-ranking-table__name {
  min-width: 320px;
  max-width: 460px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.services-achi-ranking-table__value {
  position: relative;
  min-width: 190px;
  overflow: hidden;
}

.services-achi-ranking-table__bar {
  position: absolute;
  inset: 7px 10px;
  display: block;
  max-width: calc(100% - 20px);
  border-radius: 5px;
  background: color-mix(in srgb, var(--color-accent) 22%, transparent);
  pointer-events: none;
}

.services-achi-ranking-table__value-text {
  position: relative;
  z-index: 1;
}

.services-achi-panel th:first-child,
.services-achi-panel td:first-child {
  min-width: 180px;
}

.services-achi-panel th:nth-child(2),
.services-achi-panel td:nth-child(2),
.services-achi-panel th:nth-child(4),
.services-achi-panel td:nth-child(4) {
  min-width: 220px;
}
body[data-services-view="specialists"]
  .services-page:has([data-internal-consultation-mode="operations"])
  > .services-active-filters,
body[data-services-view="specialists"]
  .services-page:has([data-internal-consultation-mode="operations"])
  > #servicesEmptyState {
  display: none;
}
.services-view-panel[hidden],
.services-table-panel[hidden],
[data-internal-consultation-panel][hidden],
[data-services-filter-context][hidden] {
  display: none;
}

.internal-consultation-tabs .workspace-tabs__list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.internal-consultation-tabs + .services-active-filters {
  margin-block-start: 12px;
}

.internal-consultation-active-filters {
  position: relative;
}

.internal-consultation-active-filters.services-active-filters {
  min-height: 0;
  padding-block: 8px;
}

.internal-consultation-active-filters[hidden] {
  display: none;
}

.internal-consultation-local-controls__label {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.internal-consultation-filter-panel {
  top: 128px;
}

.internal-consultation-filter-panel .services-filter-sheet__title:focus {
  outline: none;
}

.services-filter-sheet__subtitle {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.internal-consultation-department-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.internal-consultation-department-actions > [hidden],
.internal-consultation-search-control > [hidden] {
  display: none;
}

.internal-consultation-department-options {
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  scrollbar-gutter: stable;
}

.internal-consultation-department-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
}

.internal-consultation-department-option:last-child {
  border-bottom: 0;
}

.internal-consultation-department-option:hover {
  background: var(--color-surface-alt);
}

.internal-consultation-department-option input {
  width: 18px;
  height: 18px;
}

.internal-consultation-filter-panel .services-filter-help {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.internal-consultation-local-controls label {
  display: grid;
  gap: 5px;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.internal-consultation-local-controls input {
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.internal-consultation-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  min-width: 0;
}

.internal-consultation-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
}

.internal-consultation-kpi {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.internal-consultation-kpi__label {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.internal-consultation-kpi__value {
  color: var(--color-text);
  font-size: 1.35rem;
  font-weight: 800;
}

.internal-consultation-kpi__context {
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.internal-consultation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.internal-consultation-card {
  min-width: 0;
  margin: 0;
}

.internal-consultation-card > .section__header,
.internal-consultation-duration-chart__header {
  position: relative;
  z-index: 2;
}

.internal-consultation-card--wide {
  grid-column: 1 / -1;
}

.internal-consultation-local-controls {
  display: grid;
  grid-template-columns: max-content minmax(280px, 1fr) minmax(140px, 180px);
  gap: 12px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-alt);
}

.internal-consultation-local-controls > div {
  display: grid;
  gap: 5px;
}

.internal-consultation-local-controls small {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.internal-consultation-duration-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  height: 240px;
  min-height: 240px;
}

.internal-consultation-duration-chart {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.internal-consultation-duration-chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}

.internal-consultation-duration-chart__header > span {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.internal-consultation-duration-chart__header .export-icon-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
}

.internal-consultation-search-control {
  display: flex;
  gap: 6px;
}

.internal-consultation-search-control input {
  min-width: 0;
}

.internal-consultation-duration-chart .services-chart-frame {
  height: 215px;
  min-height: 215px;
  padding: 6px 10px 4px;
}

.internal-consultation-heatmap-scroll {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.internal-consultation-heatmap {
  display: grid;
  grid-template-columns: 64px repeat(24, minmax(21px, 1fr));
  gap: 2px;
  min-height: 250px;
  min-width: 620px;
}

.internal-consultation-heatmap__cell {
  display: grid;
  place-items: center;
  min-width: 24px;
  min-height: 31px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--color-accent) calc(var(--heat, 0) * 1%), var(--color-surface));
  color: var(--color-text);
  font-size: 0.66rem;
}

.internal-consultation-heatmap__label {
  position: sticky;
  left: 0;
  z-index: 2;
  justify-content: start;
  padding-left: 6px;
  background: var(--color-surface);
  font-weight: 700;
}

.internal-consultation-heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.internal-consultation-heatmap-legend span[aria-hidden="true"] {
  width: 24px;
  height: 8px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--color-accent) calc(var(--heat-level) * 1%), var(--color-surface));
}

.internal-consultation-table-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.internal-consultation-table-section > header h2 {
  margin: 0;
  font-size: 1rem;
}

.internal-consultation-table-section > header p {
  margin: 3px 0 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.internal-consultation-table-section .services-table-wrapper {
  max-height: min(560px, 65vh);
  overflow: auto;
}

.internal-consultation-table-scroll-hint {
  display: none;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.74rem;
}

.internal-consultation-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.internal-consultation-sort-button:focus-visible {
  outline: var(--state-focus-outline);
  outline-offset: 3px;
}

.internal-consultation-sort-button__icon {
  color: var(--color-text-muted);
}

.internal-consultation-sort-button.is-sort-active .internal-consultation-sort-button__icon {
  color: var(--color-accent);
}

.internal-consultation-table-section th:first-child,
.internal-consultation-table-section td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 210px;
  background: var(--color-surface);
}

.internal-consultation-quality-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--color-warning) 45%, var(--color-border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-warning) 9%, var(--color-surface));
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 650;
}

.services-chart-frame--tall {
  min-height: 430px;
}

.internal-consultation-card .services-chart-frame--tall {
  max-height: none;
}

.services-chart-frame[data-empty="true"] {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.services-chart-frame[data-empty="true"] canvas {
  opacity: 0;
}

.services-chart-frame[data-empty="true"]::after {
  content: attr(data-empty-message);
  position: absolute;
  max-width: 34rem;
  padding: 18px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 1100px) {
  .services-achi-summary__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .internal-consultation-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .internal-consultation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .services-achi-summary__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-achi-card:last-child {
    grid-column: 1 / -1;
  }

  .services-achi-panel .section__header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .services-achi-panel .section__actions {
    justify-content: flex-start;
  }

  .services-view-tabs > .workspace-tabs__list,
  .internal-consultation-tabs .workspace-tabs__list {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .services-view-tabs .workspace-tab,
  .internal-consultation-tabs .workspace-tab {
    flex: 0 0 auto;
    min-width: 116px;
    scroll-snap-align: start;
  }
  .internal-consultation-department-options {
    max-height: 300px;
    overflow-y: auto;
  }
  .internal-consultation-local-controls {
    grid-template-columns: 1fr;
  }
  .internal-consultation-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .internal-consultation-kpi {
    min-height: 104px;
  }
  .internal-consultation-kpi:last-child {
    grid-column: 1 / -1;
  }
  .internal-consultation-duration-stack {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    height: 520px;
    min-height: 520px;
  }
  .internal-consultation-duration-chart .services-chart-frame {
    height: 230px;
    min-height: 230px;
  }
  .internal-consultation-heatmap-legend span[aria-hidden="true"] {
    width: 16px;
  }
  .internal-consultation-table-section th:first-child,
  .internal-consultation-table-section td:first-child {
    min-width: 170px;
  }
  .internal-consultation-table-scroll-hint {
    display: block;
  }
}
.services-view-panel {
  position: relative;
  min-width: 0;
}
.services-view-panel[data-services-load-state="updating"]::after {
  content: "Atnaujinama…";
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 8;
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  box-shadow: var(--shadow-popover-soft);
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  pointer-events: none;
  transform: translateX(-50%);
}
.services-view-panel:is([data-services-load-state="loading"], [data-services-load-state="error"])
  .section__actions,
.services-view-panel:is([data-services-load-state="loading"], [data-services-load-state="error"])
  .services-specialist-control__summary {
  opacity: 0.52;
}
.services-revenue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.services-revenue-grid > .section {
  min-width: 0;
  margin: 0;
}
.services-revenue-card .section__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  min-height: 105px;
  margin-bottom: 10px;
}
.services-revenue-card .section__actions {
  justify-content: flex-end;
}
.services-revenue-card .section__subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  line-height: 1.35;
}
.services-revenue-summary__value {
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 800;
}
.services-revenue-summary__context,
.services-revenue-summary__note {
  color: var(--color-text-muted);
}
.services-revenue-summary__change {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 750;
}
.services-revenue-summary__change[data-tone="up"] {
  background: color-mix(in srgb, var(--color-success) 14%, var(--color-surface));
  color: var(--color-success);
}
.services-revenue-summary__change[data-tone="down"] {
  background: color-mix(in srgb, var(--color-danger) 12%, var(--color-surface));
  color: var(--color-danger);
}
.services-revenue-summary__note {
  flex-basis: 100%;
  font-size: 0.78rem;
}
.services-revenue-legend-slot {
  position: relative;
  min-width: 0;
  height: 42px;
  margin-bottom: 8px;
}
.services-revenue-legend-slot .services-chart-legend {
  flex-wrap: nowrap;
  height: 34px;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.services-revenue-legend-slot:has(
    .services-chart-legend[data-overflowing="true"][data-overflow-end="false"]
  )::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 8px;
  width: 34px;
  background: linear-gradient(90deg, transparent, var(--color-bg));
  pointer-events: none;
}
.services-revenue-drivers {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}
.services-revenue-drivers__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.services-revenue-drivers__title {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
}
.services-revenue-drivers__summary,
.services-revenue-drivers__method,
.services-revenue-drivers__warning,
.services-revenue-drivers__empty {
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.services-revenue-drivers__warning {
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--color-warning) 36%, var(--color-border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-warning) 9%, var(--color-surface));
  color: var(--color-text);
}
.services-chart-frame--drivers {
  height: 330px;
  min-height: 300px;
  max-height: 360px;
}
.services-revenue-drivers__top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.services-revenue-driver-list {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-alt);
}
.services-revenue-driver-list h4 {
  margin: 0 0 8px;
  font-size: 0.82rem;
}
.services-revenue-driver-list ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}
.services-revenue-driver-list li {
  padding-left: 2px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.services-revenue-driver-list strong {
  color: var(--color-text);
}
.services-revenue-drivers__details {
  min-width: 0;
  margin-top: 14px;
}
.services-revenue-drivers__details > summary {
  width: fit-content;
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.services-revenue-drivers__table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 10px;
  overflow-x: auto;
}
.services-revenue-drivers__table {
  min-width: 980px;
}
.services-revenue-drivers__table th:first-child,
.services-revenue-drivers__table td:first-child {
  min-width: 240px;
  white-space: normal;
}
.services-revenue-drivers__method {
  margin-top: 12px;
}
.services-active-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-surface-alt) 88%, transparent);
}
.services-active-filters__content {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.services-active-filters__label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}
.services-active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.services-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  min-width: 0;
}
.services-status-row:has(.services-status[hidden]):has(.services-retry[hidden]) {
  display: none;
}
.services-status-row:not(:has(.services-status[hidden])) + .services-active-filter-chips {
  display: none;
}
.services-active-filter-chip {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.services-active-filters > button:disabled {
  cursor: wait;
  opacity: 0.52;
}
button.services-active-filter-chip {
  cursor: pointer;
}
button.services-active-filter-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.services-filter-sheet {
  position: absolute;
  top: 118px;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 170px));
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-popover-soft);
}
.services-filter-backdrop {
  display: none;
}
.services-filter-backdrop[hidden],
.services-filter-sheet[hidden] {
  display: none;
}
.services-filter-sheet__header,
.services-filter-sheet__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface-alt);
}
.services-filter-sheet__header {
  border-bottom: 1px solid var(--color-border);
}
.services-filter-sheet__footer {
  display: none;
  border-top: 1px solid var(--color-border);
}
.services-filter-sheet__title {
  margin: 0;
  font-size: 1rem;
}
.services-filter-sheet__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.services-filter-sheet__body {
  min-height: 0;
  padding: 0 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.services-filter-group {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.services-filter-group:last-child {
  border-bottom: 0;
}
.services-filter-group__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.services-filter-group__title {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}
.services-filter-group__action {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.services-year-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}
.services-filter-field,
.services-specialist-search {
  display: grid;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: var(--filter-label-size);
  font-weight: 600;
}
.services-filter-field select,
.services-filter-field input,
.services-specialist-search input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--filter-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}
.services-filter-field select:focus-visible,
.services-specialist-search input:focus-visible {
  outline: none;
  box-shadow: var(--filter-focus-ring);
}
.services-filter-sheet .segmented-control,
.services-filter-sheet .segmented-control__button {
  min-height: 44px;
  border-radius: 8px;
}
.services-filter-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  overflow: auto;
}
.services-filter-list--chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
}
.services-filter-list--scroll {
  max-height: 210px;
  padding-right: 4px;
}
.services-filter-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 7px;
  border-radius: 6px;
  color: var(--color-text);
  font-size: var(--filter-font-size);
  line-height: 1.25;
}
.services-filter-list--chips .services-filter-option {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--filter-border);
  background: var(--color-surface);
  cursor: pointer;
}
.services-filter-list--chips .services-filter-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--color-accent) 58%, var(--filter-border));
  background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
  color: var(--color-accent);
}
.services-filter-option:hover {
  background: var(--color-surface-alt);
}
.services-filter-option input {
  margin: 0.15em 0 0;
}
.services-status,
.services-empty-state {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.services-status:empty {
  display: none;
}
.services-status[data-state="error"],
.services-empty-state {
  color: var(--color-danger);
  font-weight: 700;
}
.services-retry {
  flex: 0 0 auto;
}
.services-retry[hidden] {
  display: none;
}
.services-chart-frame {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: clamp(360px, 48vh, 500px);
  min-height: 360px;
  max-height: 500px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.services-revenue-grid .services-chart-frame {
  height: clamp(360px, 46vh, 450px);
  min-height: 360px;
}
.services-chart-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.services-chart-frame[data-presentation="ranking"] {
  height: clamp(440px, 58vh, 580px);
  max-height: 580px;
}
.services-presentation-control {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-alt);
}
.services-presentation-control button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}
.services-presentation-control button[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-accent);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--color-text) 12%, transparent);
}
.services-chart-skeleton {
  position: absolute;
  inset: 20px 18px 16px 44px;
  z-index: 2;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  pointer-events: none;
}
.services-chart-frame[data-loading="true"] .services-chart-skeleton {
  display: grid;
}
.services-chart-frame[data-loading="true"] canvas {
  opacity: 0;
}
.services-chart-frame[data-updating="true"] canvas,
.services-table-wrapper[data-updating="true"] table {
  opacity: 0.55;
}
.services-chart-skeleton__legend,
.services-chart-skeleton__labels {
  display: flex;
  gap: 10px;
  align-items: center;
}
.services-chart-skeleton__legend {
  overflow: hidden;
}
.services-chart-skeleton__legend span,
.services-chart-skeleton__labels span,
.services-chart-skeleton__plot span,
.services-table-skeleton span {
  border-radius: 4px;
  background: var(--skeleton-base);
  animation: servicesSkeletonPulse 1.5s ease-in-out infinite alternate;
}
.services-chart-skeleton__legend span {
  width: 96px;
  height: 24px;
}
.services-chart-skeleton__legend span:nth-child(2) {
  width: 76px;
}
.services-chart-skeleton__legend span:nth-child(3) {
  width: 112px;
}
.services-chart-skeleton__legend span:nth-child(4) {
  width: 84px;
}
.services-chart-skeleton__plot {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(25% - 1px),
    color-mix(in srgb, var(--color-border) 68%, transparent) 25%
  );
}
.services-chart-skeleton__plot span {
  position: absolute;
  top: 18%;
  left: 4%;
  width: 72%;
  height: 5px;
  transform: rotate(-4deg);
  transform-origin: left center;
}
.services-chart-skeleton__plot span:nth-child(2) {
  top: 34%;
  width: 54%;
  transform: rotate(3deg);
}
.services-chart-skeleton__plot span:nth-child(3) {
  top: 51%;
  width: 82%;
  transform: rotate(-2deg);
}
.services-chart-skeleton__plot span:nth-child(4) {
  top: 68%;
  width: 46%;
  transform: rotate(5deg);
}
.services-chart-skeleton__plot span:nth-child(5) {
  top: 83%;
  width: 66%;
  transform: rotate(-3deg);
}
.services-chart-skeleton__labels {
  justify-content: space-between;
}
.services-chart-skeleton__labels span {
  width: 42px;
  height: 10px;
}
@keyframes servicesSkeletonPulse {
  from {
    opacity: 0.48;
  }
  to {
    opacity: 0.88;
  }
}
.services-chart-expand-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}
.services-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 6px;
  min-height: 34px;
  margin: 0 0 8px;
  overflow: visible;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.services-chart-legend:empty {
  display: none;
}
.services-chart-legend[data-overflowing="true"][data-overflow-end="false"] {
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 30px), transparent 100%);
}
.services-chart-legend__item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
}
.services-chart-legend__item[aria-pressed="false"] {
  color: var(--color-text-muted);
  opacity: 0.58;
}
.services-chart-legend__swatch {
  width: 22px;
  height: 3px;
  background: var(--services-series-color);
}
.services-chart-legend__swatch[data-pattern="2"] {
  background: repeating-linear-gradient(90deg, var(--services-series-color) 0 6px, transparent 6px 10px);
}
.services-chart-legend__label {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.services-specialist-control__summary {
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.services-specialist-control__button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.services-specialist-control__button[aria-pressed="true"] {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  color: var(--color-accent);
}
.services-specialist-filter-sheet {
  top: 60px;
}
[data-section="services-specialist-consultations"] {
  position: relative;
}
.services-specialist-control__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.services-specialist-control__list {
  max-height: 300px;
  overflow-y: auto;
}
.services-table-wrapper {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.services-table-skeleton {
  display: none;
  gap: 10px;
  min-width: 760px;
  padding: 14px 12px;
}
.services-table-wrapper[data-loading="true"] {
  min-height: 272px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.services-table-wrapper[data-loading="true"] .services-table-skeleton {
  display: grid;
}
.services-table-wrapper[data-loading="true"] table {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.services-table-skeleton > div {
  display: grid;
  grid-template-columns: minmax(190px, 1.7fr) repeat(4, minmax(90px, 1fr));
  gap: 18px;
  min-height: 36px;
  align-items: center;
}
.services-table-skeleton span {
  display: block;
  width: 72%;
  height: 12px;
}
.services-table-skeleton > div:nth-child(even) span {
  width: 58%;
}
.services-table-wrapper::after {
  content: "";
  position: sticky;
  right: 0;
  display: block;
  width: 18px;
  height: 1px;
  margin-left: auto;
  box-shadow: -12px 0 18px color-mix(in srgb, var(--color-text) 18%, transparent);
  opacity: 1;
  pointer-events: none;
}
.services-table-wrapper[data-overflow-end="true"]::after,
.services-table-wrapper[data-overflowing="false"]::after {
  opacity: 0;
}
.services-table-wrapper table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.services-table-wrapper th,
.services-table-wrapper td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
  line-height: 1.35;
}
.services-table-wrapper th:first-child,
.services-table-wrapper td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-surface);
}
.services-table-wrapper th:first-child {
  z-index: 2;
  background: var(--color-surface-alt);
}
.services-table-wrapper td.services-table__numeric,
.services-table-wrapper th.services-table__numeric {
  text-align: right;
  white-space: nowrap;
}
.services-table__empty td {
  color: var(--color-text-muted);
  text-align: center;
}
.services-table__numeric[data-tone="up"] {
  color: #0284c7;
}
.services-table__numeric[data-tone="down"] {
  color: #9333ea;
}
.services-matrix__label {
  min-width: 180px;
  font-weight: 700;
}
.services-matrix__value {
  min-width: 110px;
}
.services-matrix__value > span {
  display: block;
}
.services-matrix__change {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}
.services-matrix__value[data-tone="up"] {
  background: color-mix(in srgb, #0284c7 9%, var(--color-surface));
}
.services-matrix__value[data-tone="down"] {
  background: color-mix(in srgb, #9333ea 9%, var(--color-surface));
}
.services-matrix__value[data-tone="up"][data-change-level="2"] {
  background: color-mix(in srgb, #0284c7 13%, var(--color-surface));
}
.services-matrix__value[data-tone="down"][data-change-level="2"] {
  background: color-mix(in srgb, #9333ea 13%, var(--color-surface));
}
.services-matrix__value[data-tone="up"][data-change-level="3"] {
  background: color-mix(in srgb, #0284c7 18%, var(--color-surface));
}
.services-matrix__value[data-tone="down"][data-change-level="3"] {
  background: color-mix(in srgb, #9333ea 18%, var(--color-surface));
}
.services-change-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 650;
}
.services-change-scale span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.services-change-scale i {
  width: 18px;
  height: 8px;
  border-radius: 2px;
  background: var(--color-surface-alt);
}
.services-change-scale i[data-tone="up"] {
  background: color-mix(in srgb, #0284c7 18%, var(--color-surface));
}
.services-change-scale i[data-tone="down"] {
  background: color-mix(in srgb, #9333ea 18%, var(--color-surface));
}
body[data-theme="dark"] .services-chart-frame {
  background: var(--color-surface-alt);
}
@media (max-width: 1080px) {
  .services-revenue-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .services-revenue-card .section__header {
    min-height: 0;
  }
  .services-revenue-card--secondary .services-revenue-legend-slot--placeholder {
    display: none;
  }
}
@media (max-width: 640px) {
  #servicesRevenueDriversContent {
    min-width: 0;
  }
  .services-revenue-drivers__header,
  .services-revenue-drivers__top {
    grid-template-columns: minmax(0, 1fr);
  }
  .services-revenue-drivers__header .section__actions {
    justify-content: flex-start;
  }
  .services-chart-frame--drivers {
    height: 300px;
    min-height: 280px;
  }
  .services-revenue-drivers__table {
    min-width: 700px;
  }
  .services-active-filters {
    min-height: 64px;
    padding: 8px;
  }
  .services-active-filters__label {
    display: none;
  }
  .services-active-filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .services-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 59;
    display: block;
    background: rgba(15, 23, 42, 0.48);
  }
  .services-filter-sheet {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: 100%;
    max-height: min(82dvh, 720px);
    border-radius: 12px 12px 0 0;
  }
  .services-filter-sheet__footer {
    display: flex;
  }
  .services-filter-sheet__footer .btn {
    width: 100%;
    min-height: 44px;
  }
  body.services-filters-open,
  body.services-specialist-filter-open,
  body.internal-consultation-filters-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
  }
  .services-year-range {
    grid-template-columns: 1fr;
  }
  .services-filter-list--chips .services-filter-option {
    min-height: 44px;
  }
  .services-chart-frame,
  .services-revenue-grid .services-chart-frame {
    padding: 8px;
  }
  .services-chart-frame {
    height: 400px;
    min-height: 400px;
    max-height: 400px;
  }
  .services-revenue-grid .services-chart-frame {
    height: 340px;
    min-height: 340px;
    max-height: 340px;
    padding: 8px;
  }
  .services-chart-frame[data-presentation="ranking"] {
    height: 520px;
    min-height: 520px;
    max-height: 520px;
  }
  .services-chart-legend {
    flex-wrap: nowrap;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .services-revenue-card .section__header {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .services-revenue-card .section__actions {
    justify-content: flex-start;
  }
  .services-revenue-card .section__subtitle {
    gap: 3px 7px;
  }
  .services-revenue-summary__value {
    font-size: 1.02rem;
  }
  .services-revenue-grid {
    gap: 20px;
  }
  .services-presentation-control {
    max-width: 100%;
  }
  .services-presentation-control button {
    min-height: 36px;
  }
  .services-table-wrapper table {
    min-width: 700px;
  }
  .services-table-wrapper th:first-child,
  .services-table-wrapper td:first-child {
    width: 145px;
    min-width: 145px;
    max-width: 145px;
    white-space: normal;
  }
  .services-matrix__label {
    min-width: 145px;
  }
  .services-table-wrapper th,
  .services-table-wrapper td {
    padding: 9px 10px;
    font-size: 0.82rem;
  }
}
