/* Phase 4 — Dashboard home (Figma Backoffice Elevai + NewLayout) */

.dashboard-page {
    position: relative;
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

.dashboard-page > * {
    min-width: 0;
    max-width: 100%;
}

.dashboard-heading {
    align-items: flex-start;
    margin-bottom: 0 !important;
}

.dashboard-heading__intro {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 16rem;
}

/* Beat .app-shell__content h1/h2 display-md override for page + card titles */
.app-shell__content .dashboard-page .elev-page-heading__title {
    margin: 0;
    color: var(--elev-text-bold);
    font-family: var(--elev-font-display);
    font-size: var(--elev-display-md-size);
    line-height: var(--elev-display-md-line);
    font-weight: 600;
    letter-spacing: var(--elev-display-md-tracking);
}

.app-shell__content .dashboard-page .elev-page-heading__description,
.dashboard-heading .elev-page-heading__description {
    margin: 0;
    max-width: 42rem;
    color: var(--elev-text-sheen);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-md-size);
    line-height: var(--elev-text-md-line);
    font-weight: 500;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-width: 0;
    max-width: 100%;
}

.dashboard-actions .date-range-filter {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.dashboard-actions .date-range-trigger {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 960px) {
    .dashboard-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .dashboard-actions .date-range-filter {
        flex: 1 1 auto;
        min-width: 0;
    }

    .dashboard-actions .service-orders-actions__icon,
    .dashboard-actions .service-orders-actions__filter {
        flex: 0 0 auto;
    }
}

.dashboard-health {
    display: grid;
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.dashboard-kpi-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 21.0625rem;
    padding: 1.25rem 1.25rem 1rem;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    box-shadow: none;
}

.dashboard-kpi-card__intro {
    max-width: 18.375rem; /* 294px — NewLayout .kpi-copy */
    padding-right: 1.75rem;
}

.app-shell__content .dashboard-page .dashboard-kpi-card__title,
.dashboard-kpi-card__title {
    margin: 0;
    color: var(--elev-text-bold);
    font-family: var(--elev-font-display);
    font-size: var(--elev-text-xl-size); /* 20px — not display-md */
    line-height: normal;
    font-weight: 600;
    letter-spacing: normal;
}

.dashboard-kpi-card__copy {
    margin: 0.25rem 0 0;
    color: #535862;
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-xs-size); /* 12px */
    line-height: var(--elev-text-xs-line);
    font-weight: 400;
}

.dashboard-gauge {
    position: relative;
    width: min(100%, 18.375rem); /* 294px */
    height: 9.1875rem; /* 147px */
    margin: 0.25rem auto 0;
    overflow: hidden;
}

.dashboard-gauge__svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.dashboard-gauge__track,
.dashboard-gauge__progress {
    fill: none;
    stroke-width: 36;
    stroke-linecap: round;
}

.dashboard-gauge__track {
    stroke: #fff8eb;
}

.dashboard-gauge__progress {
    stroke: #2ecc71;
    transition: stroke 0.25s ease, stroke-dasharray 0.35s ease;
}

.dashboard-gauge__value {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 4.85rem;
    width: 6.8125rem;
    margin: 0;
    transform: translateX(-50%);
    color: #2ecc71;
    font-family: var(--elev-font-display);
    font-size: 3rem; /* 48px — display-lg */
    font-weight: 700;
    line-height: 3.75rem; /* 60px */
    letter-spacing: -0.02em;
    text-align: center;
    transition: color 0.25s ease;
}

.dashboard-kpi-card__change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--elev-muted);
}

.dashboard-kpi-card__change-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.5rem;
    padding: 0.125rem 0.3125rem;
    border-radius: 4px;
    color: #1e4841;
    background: #bbf49c;
    font-size: var(--elev-text-sm-size);
    font-weight: 600;
    line-height: var(--elev-text-sm-line);
    white-space: nowrap;
}

.dashboard-kpi-card__change-pill.is-negative {
    color: var(--elev-destructive);
    background: var(--elev-destructive-soft);
}

.dashboard-kpi-card__change-helper {
    color: var(--elev-text-sheen);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-sm-size); /* 14px */
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-stat-card {
    display: flex;
    flex-direction: column;
    min-height: 10.25rem;
    padding: 1.5rem;
    border-radius: var(--elev-radius);
}

.dashboard-stat-card.is-clickable {
    cursor: pointer;
}

.dashboard-stat-card.is-clickable:hover {
    border-color: var(--elev-primary);
}

.dashboard-stat-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-stat-card__value-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
}

.dashboard-stat-card__value-row .dashboard-stat-card__value {
    margin: 0;
}

.dashboard-stat-card__report-link {
    flex: 0 0 auto;
    width: 1.75rem !important;
    height: 1.75rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dashboard-stat-card__label {
    margin: 0;
    color: var(--elev-muted);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-md-size); /* 16px */
    line-height: var(--elev-text-md-line);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.dashboard-stat-card__change {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0 0.5rem;
    border-radius: 6px;
    font-size: var(--elev-text-sm-size);
    font-style: normal;
    font-weight: 600;
    line-height: var(--elev-text-sm-line);
    white-space: nowrap;
}

.dashboard-stat-card__change.is-positive {
    color: var(--elev-success);
    background: var(--elev-success-soft);
}

.dashboard-stat-card__change.is-negative {
    color: var(--elev-destructive);
    background: var(--elev-destructive-soft);
}

.dashboard-stat-card__value {
    display: block;
    margin: 1.5rem 0 0;
    color: var(--elev-text-bold);
    font-family: var(--elev-font-display);
    font-size: var(--elev-display-sm-size); /* 30px */
    line-height: var(--elev-display-sm-line);
    font-weight: 700;
    letter-spacing: normal;
}

.dashboard-stat-card.is-danger .dashboard-stat-card__value {
    color: var(--elev-destructive);
}

.dashboard-stat-card__helper {
    display: block;
    margin-top: 0.75rem;
    color: var(--elev-text-sheen);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-sm-size); /* 14px */
    font-weight: 400;
    line-height: var(--elev-text-sm-line);
}

.dashboard-section-card .elev-ui-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 0;
}

.app-shell__content .dashboard-page .dashboard-section-card__title,
.dashboard-section-card__title {
    margin: 0;
    color: var(--elev-text-bold);
    font-family: var(--elev-font-display);
    font-size: var(--elev-text-lg-size); /* 18px — not display-md */
    line-height: var(--elev-text-lg-line);
    font-weight: 600;
    letter-spacing: normal;
}

.dashboard-section-card__description {
    margin: 0.25rem 0 0;
    color: var(--elev-text-sheen);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-sm-size);
    line-height: var(--elev-text-sm-line);
    font-weight: 500;
}

.dashboard-section-card__body {
    padding: 0.5rem 1.25rem 1.25rem;
}

.dashboard-page .dashboard-recent-orders.orders-table-card {
    overflow: hidden;
}

.dashboard-page .dashboard-recent-orders .orders-table-toolbar {
    margin-left: 0;
    max-width: none;
}

.dashboard-page .dashboard-recent-orders .dashboard-section-card__body {
    padding: 0 1.25rem 0.75rem;
}

/* Match OS quick-filter date trigger chrome */
.dashboard-page .dashboard-view-all-orders.mud-button-root {
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    padding-inline: 0.875rem !important;
    border: 1px solid var(--elev-border) !important;
    border-radius: var(--elev-radius-pill) !important;
    background: var(--elev-surface) !important;
    color: var(--elev-text-bold) !important;
    box-shadow: none !important;
    font-family: var(--elev-font-sans) !important;
    font-size: var(--elev-text-sm-size) !important;
    font-weight: 600 !important;
    line-height: var(--elev-text-sm-line) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.dashboard-page .dashboard-view-all-orders.mud-button-root:hover,
.dashboard-page .dashboard-view-all-orders.mud-button-root:focus-visible {
    background: var(--elev-bg-pale) !important;
    border-color: var(--elev-border) !important;
    color: var(--elev-text-bold) !important;
}

.dashboard-section-card .chart {
    min-height: 22rem;
    max-width: 100%;
    overflow: hidden;
}

.dashboard-section-card .chart.chart--ranking {
    min-height: 26rem;
}

.dashboard-page .chart--ranking .apexcharts-xaxis-label,
.dashboard-page .chart--ranking .apexcharts-xaxis-label tspan {
    fill: #535862 !important;
    font-family: var(--elev-font-sans) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.dashboard-page .chart--ranking .apexcharts-xaxis-texts-g text {
    dominant-baseline: hanging;
}

.dashboard-section-card .chart .apexcharts-canvas,
.dashboard-section-card .chart svg {
    max-width: 100% !important;
}

.elev-ranking-tooltip {
    min-width: 12.5rem;
    max-width: 18rem;
    padding: 0.75rem 0.875rem;
    border: 0;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: none;
    font-family: var(--elev-font-sans);
    color: var(--elev-text-bold);
}

.elev-ranking-tooltip__title {
    display: block;
    margin-bottom: 0.25rem;
    font-size: var(--elev-text-sm-size);
    font-weight: 700;
    line-height: var(--elev-text-sm-line);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-page .chart--ranking .apexcharts-tooltip {
    border: 1px solid #e7e7e7 !important;
    border-radius: 0.75rem !important;
    background: #fff !important;
    box-shadow: 0 12px 28px rgba(10, 13, 18, 0.14) !important;
    overflow: hidden;
}

.dashboard-page .chart--ranking .apexcharts-tooltip.apexcharts-active {
    overflow: hidden;
}

.dashboard-page .chart--ranking .apexcharts-tooltip-title {
    display: none !important;
}

.elev-ranking-tooltip__total {
    margin-bottom: 0.625rem;
    color: var(--elev-text-sheen);
    font-size: var(--elev-text-xs-size);
    line-height: var(--elev-text-xs-line);
    font-weight: 500;
}

.elev-ranking-tooltip__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: var(--elev-text-xs-size);
    line-height: var(--elev-text-xs-line);
}

.elev-ranking-tooltip__swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 2px;
}

.elev-ranking-tooltip__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--elev-foreground);
    font-weight: 500;
}

.elev-ranking-tooltip__value {
    font-weight: 700;
}

.elev-sla-tooltip {
    min-width: 11.5rem;
    max-width: 16rem;
    padding: 0.75rem 0.875rem;
    border: 0;
    border-radius: 0.75rem;
    background: #fff;
    font-family: var(--elev-font-sans);
    color: var(--elev-text-bold);
}

.elev-sla-tooltip__title {
    display: block;
    margin-bottom: 0.5rem;
    font-size: var(--elev-text-sm-size);
    font-weight: 700;
    line-height: var(--elev-text-sm-line);
}

.elev-sla-tooltip__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: var(--elev-text-xs-size);
    line-height: var(--elev-text-xs-line);
}

.elev-sla-tooltip__swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 2px;
}

.elev-sla-tooltip__name {
    min-width: 0;
    color: var(--elev-foreground);
    font-weight: 500;
}

.elev-sla-tooltip__value {
    font-weight: 700;
}

.dashboard-page .chart--ops-trend .apexcharts-tooltip {
    border: 1px solid #e7e7e7 !important;
    border-radius: 0.75rem !important;
    background: #fff !important;
    box-shadow: 0 12px 28px rgba(10, 13, 18, 0.14) !important;
    overflow: hidden;
}

.dashboard-extras {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.dashboard-extras--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-extras--productivity {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: stretch;
}

.dashboard-extras--productivity > .dashboard-section-card {
    display: flex;
    flex-direction: column;
    height: 26rem;
    min-height: 20rem;
    max-height: 26rem;
    min-width: 0;
}

.dashboard-extras--productivity > .dashboard-section-card > .elev-ui-card__header {
    flex-shrink: 0;
}

.dashboard-extras--productivity .dashboard-productivity,
.dashboard-extras--productivity .dashboard-risk {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-top: 0.25rem;
}

.dashboard-productivity__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--elev-text-sm-size);
    line-height: var(--elev-text-sm-line);
    color: var(--elev-text);
}

.dashboard-productivity__table th,
.dashboard-productivity__table td {
    padding: 0.7rem 0.75rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--elev-border-subtle, #ececec);
    white-space: nowrap;
}

.dashboard-productivity__table th:first-child,
.dashboard-productivity__table td:first-child {
    white-space: normal;
    min-width: 8rem;
}

.dashboard-productivity__table th:not(:first-child),
.dashboard-productivity__table td:not(:first-child) {
    text-align: center;
}

.dashboard-productivity__table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f5f6f8;
    color: var(--elev-text-sheen, #535862);
    font-weight: 600;
    font-size: var(--elev-text-xs-size);
    line-height: var(--elev-text-xs-line);
}

.dashboard-productivity__table tbody tr:last-child td {
    border-bottom: none;
}

.dashboard-risk__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dashboard-risk__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--elev-border-subtle, #e8eaed);
    border-radius: 0.75rem;
    background: #fafafa;
}

.dashboard-risk__main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.dashboard-risk__name {
    color: var(--elev-text);
    font-size: var(--elev-text-sm-size);
    font-weight: 700;
    line-height: var(--elev-text-sm-line);
}

.dashboard-risk__meta {
    color: var(--elev-text-sheen, #717680);
    font-size: var(--elev-text-xs-size);
    line-height: var(--elev-text-xs-line);
}

.dashboard-risk__badge {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-risk__badge--high {
    background: #fde8ea;
    color: #b42318;
}

.dashboard-risk__badge--medium {
    background: #fff1e0;
    color: #b54708;
}

.dashboard-risk__badge--low {
    background: #e8f6ee;
    color: #067647;
}

.dashboard-empty-inline {
    color: var(--elev-text-sheen, #717680);
}

.dashboard-root-cause .elev-ui-card__header {
    align-items: flex-start;
}

.dashboard-root-cause__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.dashboard-root-cause__panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 18rem;
    max-height: 26rem;
    height: 26rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--elev-border-subtle, #e8eaed);
    border-radius: 0.85rem;
    background: #fff;
}

.dashboard-root-cause__panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dashboard-root-cause__panel-title {
    margin: 0;
    color: var(--elev-text);
    font-size: var(--elev-text-sm-size);
    font-weight: 700;
    line-height: var(--elev-text-sm-line);
}

.dashboard-problem-bars {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.55rem;
    min-height: 0;
    overflow: auto;
    padding-right: 0.15rem;
}

.dashboard-problem-bars__tooltip {
    display: block;
    width: 100%;
    min-width: 0;
}

.dashboard-problem-bars__row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

/* Match ApexCharts TMA tooltip (elev-sla-tooltip) when MudTooltip hosts it. */
.mud-tooltip:has(.elev-sla-tooltip--problem) {
    padding: 0 !important;
    border: 1px solid #e7e7e7 !important;
    border-radius: 0.75rem !important;
    background: #fff !important;
    color: var(--elev-text-bold) !important;
    box-shadow: 0 12px 28px rgba(10, 13, 18, 0.14) !important;
    overflow: hidden;
}

.mud-tooltip:has(.elev-sla-tooltip--problem) .mud-tooltip-arrow {
    color: #fff !important;
}

.elev-sla-tooltip--problem {
    width: 100%;
    min-width: 14rem;
    max-width: 22rem;
}

.elev-sla-tooltip--problem .elev-sla-tooltip__title {
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.elev-sla-tooltip--problem .elev-sla-tooltip__row--no-swatch {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.elev-sla-tooltip--problem .elev-sla-tooltip__row--no-swatch .elev-sla-tooltip__name {
    flex: 0 0 auto;
    text-align: left;
}

.elev-sla-tooltip--problem .elev-sla-tooltip__row--no-swatch .elev-sla-tooltip__value {
    flex: 1 1 auto;
    margin-inline-start: auto;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-problem-bars__label {
    overflow: hidden;
    color: #535862;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-problem-bars__track {
    min-width: 0;
}

.dashboard-problem-bars__fill {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 2.25rem;
    height: 1.55rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: #2196E9;
}

.dashboard-problem-bars__value {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.dashboard-root-cause__panel .chart--root-problems {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.dashboard-request-dist {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.25rem;
    min-height: 0;
    padding-top: 0.15rem;
}

.dashboard-request-donut {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 11.5rem;
}

.dashboard-root-cause__panel--request {
    overflow: visible;
}

.dashboard-root-cause__panel--request .dashboard-request-dist,
.dashboard-root-cause__panel--request .dashboard-request-donut {
    overflow: visible;
}

.dashboard-section-card .chart.chart--root-request {
    min-height: 0;
    overflow: visible;
}

.dashboard-root-cause__panel--request .apexcharts-inner,
.dashboard-root-cause__panel--request .apexcharts-canvas,
.dashboard-root-cause__panel--request .apexcharts-svg {
    overflow: visible !important;
}

.dashboard-root-cause__panel--request .apexcharts-tooltip {
    z-index: 60;
    white-space: nowrap;
    max-width: none;
}

.dashboard-root-cause__panel--request .chart--root-request {
    flex: 0 0 auto;
    width: 12rem;
    height: 12rem;
    margin: 0 auto;
    overflow: visible;
}

.dashboard-request-donut__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}

.dashboard-request-donut__center strong {
    color: #181d27;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.05;
}

.dashboard-request-donut__center span {
    margin-top: 0.2rem;
    color: #717680;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
}

.dashboard-root-cause__areas {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.dashboard-area-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.75rem;
    background: #f7f8fa;
}

.dashboard-area-card__main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.dashboard-area-card__name {
    color: var(--elev-text);
    font-size: var(--elev-text-sm-size);
    font-weight: 700;
    line-height: var(--elev-text-sm-line);
}

.dashboard-area-card__meta {
    color: var(--elev-text-sheen, #717680);
    font-size: var(--elev-text-xs-size);
    line-height: var(--elev-text-xs-line);
}

.dashboard-area-card__badge {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-area-card__badge--critical {
    background: #fde8ea;
    color: #b42318;
}

.dashboard-area-card__badge--attention {
    background: #fff4d6;
    color: #b54708;
}

.dashboard-area-card__badge--stable {
    background: #e8f1fb;
    color: #175cd3;
}

.dashboard-area-card__badge--healthy {
    background: #e8f6ee;
    color: #067647;
}

.dashboard-request-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    width: 100%;
    margin-top: auto;
    flex: 0 0 auto;
}

.dashboard-request-legend__item {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.55rem;
    row-gap: 0.1rem;
    align-items: start;
    min-width: 0;
}

.dashboard-request-legend__pct {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    width: 2.75rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 0.45rem;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.dashboard-request-legend__name {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    color: #717680;
    font-size: 0.8125rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-request-legend__count {
    grid-column: 2;
    grid-row: 2;
    color: #181d27;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-ops-trend .elev-ui-card__header {
    align-items: center;
}

.dashboard-ops-trend__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 0.25rem;
}

.dashboard-ops-trend__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem 1rem 0.75rem;
    border: 1px solid var(--elev-border);
    border-radius: var(--elev-radius);
    background: var(--elev-surface);
}

.dashboard-ops-trend__card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-ops-trend__card-title {
    margin: 0;
    color: var(--elev-text-bold);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-sm-size);
    font-weight: 600;
    line-height: var(--elev-text-sm-line);
}

.dashboard-ops-trend__card .chart--ops-trend {
    min-height: 14rem;
    max-width: 100%;
}

.dashboard-ops-trend__footer {
    margin: 0.25rem 0 0;
    color: var(--elev-text-bold);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-xs-size);
    font-weight: 600;
    line-height: var(--elev-text-xs-line);
}

.dashboard-funnel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.dashboard-funnel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.5625rem 0.75rem;
    border-radius: 999px;
    color: var(--elev-secondary);
    background: var(--elev-primary-soft);
    font-size: var(--elev-text-sm-size);
    line-height: var(--elev-text-sm-line);
    font-weight: 600;
}

.dashboard-funnel__row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-funnel__row strong {
    flex-shrink: 0;
}

.dashboard-aging {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
}

.dashboard-aging__item {
    min-height: 5.375rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--elev-border-soft);
    border-radius: var(--elev-radius);
    background: var(--elev-surface-soft);
    text-align: center;
}

.dashboard-aging__item.is-danger {
    border-color: var(--elev-destructive-soft);
    background: var(--elev-destructive-soft);
}

.dashboard-aging__item strong,
.dashboard-aging__item span {
    display: block;
}

.dashboard-aging__item strong {
    color: var(--elev-text-bold);
    font-family: var(--elev-font-display);
    font-size: var(--elev-display-xs-size);
    line-height: var(--elev-display-xs-line);
}

.dashboard-aging__item span {
    margin-top: 0.5rem;
    color: var(--elev-muted);
    font-size: var(--elev-text-xs-size);
    line-height: var(--elev-text-xs-line);
    font-weight: 700;
}

.dashboard-repeat {
    display: grid;
    gap: 0.625rem;
    max-height: 18rem;
    overflow: auto;
    padding-right: 0.15rem;
}

.dashboard-repeat__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--elev-border-soft);
    border-radius: var(--elev-radius);
    background: var(--elev-surface-soft);
}

.dashboard-repeat__main {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.dashboard-repeat__name {
    color: var(--elev-text);
    font-size: var(--elev-text-sm-size);
    font-weight: 700;
    line-height: var(--elev-text-sm-line);
}

.dashboard-repeat__context {
    overflow: hidden;
    color: #717680;
    font-size: var(--elev-text-xs-size);
    font-weight: 500;
    line-height: var(--elev-text-xs-line);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-repeat__meta {
    color: #717680;
    font-size: var(--elev-text-xs-size);
    font-weight: 500;
    line-height: var(--elev-text-xs-line);
}

.dashboard-repeat__icon {
    color: #98a2b3;
    font-size: 1.25rem !important;
}

.dashboard-empty {
    margin: 0;
}

/* Date range quick filter (NewLayout) */
.date-range-filter {
    position: relative;
}

.date-range-filter.is-open {
    z-index: 60;
}

.date-range-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.date-range-picker {
    position: relative;
    z-index: 70;
}

.date-range-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    height: 2.75rem;
    min-width: 14.875rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: var(--elev-radius-pill);
    background: var(--elev-bg-white-card);
    color: var(--elev-text-bold);
    font-family: var(--elev-font-sans);
    font-size: var(--elev-text-sm-size);
    font-weight: 600;
    line-height: var(--elev-text-sm-line);
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
}

.date-range-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.date-range-trigger span {
    overflow: hidden;
    flex: 0 1 auto;
    text-align: left;
    text-overflow: ellipsis;
}

.date-range-popover {
    position: absolute;
    z-index: 71;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(40.375rem, calc(100vw - 3rem));
    padding: 1rem;
    border: 1px solid #e7e7e7;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 13, 18, 0.16);
}

.date-range-calendars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    column-gap: 1.75rem;
    row-gap: 1rem;
}

.calendar-month {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
    min-width: 0;
}

.calendar-month__header {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 2rem;
    align-items: center;
    min-height: 2rem;
}

.calendar-month__title {
    margin: 0;
    color: var(--elev-text-bold);
    font-size: var(--elev-text-sm-size);
    font-weight: 600;
    line-height: var(--elev-text-sm-line);
    text-align: center;
}

.calendar-month__nav {
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--elev-border);
    border-radius: 10px;
    background: #fff;
    color: var(--elev-foreground);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.calendar-month__nav.is-spacer {
    border: 0;
    background: transparent;
    pointer-events: none;
    visibility: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.calendar-weekday {
    display: grid;
    place-items: center;
    min-width: 0;
    height: 1.75rem;
    color: #717680;
    font-size: var(--elev-text-xs-size);
    font-weight: 500;
    line-height: 1;
    text-align: center;
}

.calendar-day {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 2.125rem;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--elev-foreground);
    font-size: var(--elev-text-sm-size);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.calendar-day:not(.is-empty):hover {
    background: var(--elev-bg-pale);
}

.calendar-day.is-range {
    border-radius: 8px;
    background: #eaf5ff;
    color: var(--elev-primary);
}

.calendar-day.is-start,
.calendar-day.is-end {
    background: var(--elev-primary);
    color: #fff;
    box-shadow: 0 6px 14px rgba(34, 153, 239, 0.22);
}

.calendar-day.is-empty {
    pointer-events: none;
}

.date-range-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid #f0f1f3;
}

.date-range-footer button {
    display: inline-grid;
    place-items: center;
    height: 2rem;
    padding: 0 0.75rem;
    border: 1px solid var(--elev-border);
    border-radius: 10px;
    background: #fff;
    color: var(--elev-foreground);
    font-size: var(--elev-text-sm-size);
    font-weight: 500;
    cursor: pointer;
}

.date-range-footer span {
    color: #535862;
    font-size: var(--elev-text-sm-size);
    font-weight: 500;
}

.date-range-footer div {
    display: flex;
    gap: 0.5rem;
}

.date-range-footer button:last-child {
    border-color: var(--elev-primary);
    background: var(--elev-primary);
    color: #fff;
}

.date-range-footer button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .dashboard-health,
    .dashboard-extras,
    .dashboard-extras--pair,
    .dashboard-extras--productivity,
    .dashboard-root-cause__grid,
    .dashboard-ops-trend__grid {
        grid-template-columns: 1fr;
    }

    .dashboard-extras--productivity > .dashboard-section-card {
        height: 20rem;
        min-height: 16rem;
        max-height: 22rem;
    }

    .dashboard-root-cause__panel {
        height: 22rem;
        min-height: 16rem;
        max-height: 24rem;
    }

    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .date-range-calendars {
        grid-template-columns: 1fr;
    }

    .date-range-popover {
        right: auto;
        left: 0;
    }
}

@media (max-width: 720px) {
    .dashboard-stat-grid,
    .dashboard-aging {
        grid-template-columns: 1fr 1fr;
    }
}

/* Card help tip (?) */
.dashboard-help-tip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}

.dashboard-help-tip--corner {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
}

.dashboard-help-tip__btn.mud-button-root,
.dashboard-help-tip__btn.mud-icon-button {
    width: 1.375rem !important;
    height: 1.375rem !important;
    min-width: 0 !important;
    padding: 0 !important;
    color: #98a2b3 !important;
    background: #f2f4f7 !important;
    border-radius: 50% !important;
}

.dashboard-help-tip__btn .mud-icon-root {
    font-size: 0.875rem !important;
}

.dashboard-help-tip__btn:hover {
    color: #667085 !important;
    background: #e4e7ec !important;
}

.dashboard-help-tip__content {
    max-width: 17.5rem;
    white-space: normal;
    text-align: left;
    font-family: var(--elev-font-sans);
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 400;
}
