.chart-panel {
    border: 1px solid var(--border);
    height: 100%;
    background: var(--card-bg);
    font-family: var(--ems-chart-font-family);
    box-shadow: none;
}

.chart-panel .card-body {
    position: relative;
}

.chart-panel--loading .chart-panel__canvas {
    opacity: 0.35;
    pointer-events: none;
}

.chart-panel__loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.72);
    pointer-events: none;
}

.chart-panel__loading-overlay .spinner-border {
    width: 2rem;
    height: 2rem;
    color: var(--dashboard-primary);
    border-width: 0.2em;
}

.chart-panel__loading-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dashboard-muted);
}

.chart-panel__error {
    font-size: 0.78rem;
    color: var(--dashboard-muted);
}

.chart-panel__empty {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    pointer-events: none;
    background: #ffffff;
}

.chart-panel__empty-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #98A2B3;
    letter-spacing: 0.01em;
}

.chart-panel__empty-value {
    font-size: 0.72rem;
    font-weight: 600;
    color: #B0B8C4;
    font-variant-numeric: tabular-nums;
}

.chart-panel__header {
    background: #ffffff;
    border-bottom: 1px solid var(--dashboard-border);
    padding: 0.65rem 1rem;
}

.chart-panel__title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--dashboard-primary);
    text-transform: none;
    font-family: var(--ems-chart-font-family);
}

.chart-panel__canvas {
    width: 100%;
    height: 340px;
}

.chart-panel__canvas--compact {
    height: 280px;
    min-height: 280px;
}

.dashboard-subsection .chart-panel__canvas--compact {
    height: 300px;
    min-height: 300px;
}

.chart-panel__canvas--donut {
    overflow: visible;
    height: 340px;
    min-height: 340px;
}

.chart-panel__canvas--growth {
    height: auto;
    min-height: 200px;
    padding: 0.65rem 0.75rem 0.75rem;
}

.chart-panel__canvas--weekly-row {
    height: auto;
    min-height: 380px;
    padding: 0.45rem 0.7rem 0.65rem;
}

.chart-panel__canvas--ranking-bar {
    height: auto;
    min-height: 300px;
    padding: 0.45rem 0.7rem 0.65rem;
}

.ranking-bar-chart__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ranking-bar-chart__top--bottom {
    margin-bottom: 0;
    margin-top: 0.35rem;
    padding-top: 0.15rem;
}

.ranking-bar-chart__unit {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--dashboard-muted);
    text-transform: none;
    font-family: var(--ems-chart-font-family);
    white-space: nowrap;
}

.ranking-bar-chart__header,
.ranking-bar-chart__row,
.ranking-bar-chart__scale {
    display: grid;
    grid-template-columns: 6.4rem minmax(0, 1fr) 4.8rem 4.8rem 3.4rem;
    gap: 0.55rem;
    align-items: center;
}

.ranking-bar-chart__header {
    margin-bottom: 0.3rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #E5E7EB;
}

.ranking-bar-chart__head-metric,
.ranking-bar-chart__head-pct {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--dashboard-muted);
    text-align: right;
    text-transform: none;
    font-family: var(--ems-chart-font-family);
}

.ranking-bar-chart__rows {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.ranking-bar-chart__row {
    min-height: 1.65rem;
}

.ranking-bar-chart__label {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--dashboard-text);
    line-height: 1.25;
}

.ranking-bar-chart__label-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-bar-chart__track {
    position: relative;
    height: 1.15rem;
    border-radius: 2px;
    background: #E5E7EB;
    overflow: visible;
}

.ranking-bar-chart__track--pct {
    background: #E5E7EB;
}

.ranking-bar-chart__track--pct::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 74, 153, 0.2);
}

.ranking-bar-chart__bar {
    position: relative;
    height: 100%;
    min-width: 0;
    border-radius: 2px;
    background: #0B5CAD;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.35rem;
}

.ranking-bar-chart__bar-value {
    font-size: 0.62rem;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ranking-bar-chart__bar-col .ranking-bar-chart__bar--value-outside + .ranking-bar-chart__bar-value-floating,
.ranking-bar-chart__bar--value-outside .ranking-bar-chart__bar-value {
    display: none;
}

.ranking-bar-chart__bar-value-floating {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    font-weight: 700;
    color: #0B5CAD;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

.ranking-bar-chart__head-metric--actual {
    color: #0B5CAD;
}

.ranking-bar-chart__actual-col {
    font-size: 0.64rem;
    font-weight: 700;
    color: #0B5CAD;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ranking-bar-chart__plan-col {
    font-size: 0.64rem;
    font-weight: 600;
    color: #5c6b7a;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ranking-bar-chart__pct-col {
    display: flex;
    justify-content: flex-end;
}

.ranking-bar-chart__pct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    padding: 0.12rem 0.3rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ranking-bar-chart__pct--danger {
    color: var(--danger-dark);
    background: var(--danger-bg);
}

.ranking-bar-chart__pct--warning {
    color: var(--target-dark);
    background: var(--warning-bg);
}

.ranking-bar-chart__pct--good {
    color: var(--success);
    background: var(--success-bg);
}

.ranking-bar-chart__scale {
    margin-top: 0.45rem;
    padding-top: 0.25rem;
    border-top: 1px solid #E5E7EB;
}

.ranking-bar-chart__scale-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.58rem;
    color: var(--dashboard-muted);
    font-variant-numeric: tabular-nums;
}

.ranking-bar-chart__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.45rem;
}

.ranking-bar-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--dashboard-muted);
}

.ranking-bar-chart__legend-item::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
}

.ranking-bar-chart__legend-item--actual::before {
    background: #0B5CAD;
    border-radius: 1px;
    width: 0.7rem;
    height: 0.55rem;
}

.ranking-bar-chart__legend-item--danger::before {
    background: #DC2626;
}

.ranking-bar-chart__legend-item--warning::before {
    background: #F59E0B;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__legend {
    justify-content: flex-start;
    gap: 0.85rem;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__legend .ranking-bar-chart__unit {
    margin-left: auto;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__header,
.ranking-bar-chart--unit-mtd .ranking-bar-chart__row,
.ranking-bar-chart--unit-mtd .ranking-bar-chart__scale {
    grid-template-columns: 5.8rem minmax(0, 1fr) 4.2rem 4.2rem 3rem;
    gap: 0.7rem;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__rows {
    gap: 0.75rem;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__scale-line {
    display: grid;
    grid-template-columns: repeat(var(--scale-count, 4), minmax(0, 1fr));
    gap: 0.2rem;
    font-size: 0.52rem;
    letter-spacing: -0.01em;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__scale-line span:first-child {
    text-align: left;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__scale-line span:last-child {
    text-align: right;
}

.ranking-bar-chart--unit-mtd .ranking-bar-chart__scale-line span:not(:first-child):not(:last-child) {
    text-align: center;
}

.ranking-bar-chart__legend-item--good::before {
    background: #16A34A;
}

.weekly-row-chart__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.weekly-row-chart__series-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.weekly-row-chart__series-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--dashboard-muted);
}

.weekly-row-chart__series-item::before {
    content: '';
    width: 0.7rem;
    height: 0.55rem;
    border-radius: 1px;
}

.weekly-row-chart__series-item--actual::before {
    background: #0B5CAD;
}

.weekly-row-chart__series-item--plan::before {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #F59E0B;
}

.weekly-row-chart__unit {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--dashboard-muted);
    text-transform: none;
    font-family: var(--ems-chart-font-family);
    white-space: nowrap;
}

.weekly-row-chart__header,
.weekly-row-chart__row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
}

.weekly-row-chart__scale {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
}

.weekly-row-chart__header {
    margin-bottom: 0.3rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #E5E7EB;
}

/* Desktop: bar + metrics nằm cạnh nhau trong cột chính */
.weekly-row-chart__main,
.weekly-row-chart__head-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11.5rem, auto);
    gap: 0.4rem;
    align-items: center;
    min-width: 0;
}

.weekly-row-chart__head-metrics,
.weekly-row-chart__metrics {
    display: grid;
    grid-template-columns: 4.6rem 4.6rem 2.85rem;
    gap: 0.4rem;
    align-items: center;
    min-width: 0;
}

.weekly-row-chart__head-metric,
.weekly-row-chart__head-pct {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--dashboard-muted);
    text-transform: none;
    font-family: var(--ems-chart-font-family);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weekly-row-chart__scale-metrics-spacer {
    min-width: 0;
}

.weekly-row-chart__chart-body {
    position: relative;
}

.weekly-row-chart__rows {
    position: relative;
}

.weekly-row-chart__row {
    margin-bottom: 0.72rem;
}

.weekly-row-chart__row:last-child {
    margin-bottom: 0.25rem;
}

.weekly-row-chart__week {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--dashboard-text);
    line-height: 1.15;
}

.weekly-row-chart__dates {
    font-size: 0.58rem;
    color: var(--dashboard-muted);
    margin-top: 0.08rem;
    line-height: 1.2;
}

.weekly-row-chart__track {
    position: relative;
    height: 0.9rem;
    background: #E5E7EB;
    border-radius: 1px;
    min-width: 0;
    overflow: hidden;
}

.weekly-row-chart__plan-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(243, 146, 0, 0.38);
    border-radius: 1px;
    min-width: 0;
    z-index: 0;
}

.weekly-row-chart__bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #0B5CAD;
    border-radius: 1px;
    min-width: 0;
    z-index: 1;
}

.weekly-row-chart__num-col {
    font-size: 0.64rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    line-height: 1.2;
}

.weekly-row-chart__num-col--actual {
    color: #0B5CAD;
}

.weekly-row-chart__num-col--plan {
    color: #D97706;
}

.weekly-row-chart__pct-col {
    display: flex;
    justify-content: center;
}

.weekly-row-chart__pct {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1;
    border: 1.5px solid transparent;
}

.weekly-row-chart__pct span {
    line-height: 1;
}

.weekly-row-chart__pct--danger {
    color: var(--danger);
    border-color: var(--danger);
    background: transparent;
}

.weekly-row-chart__pct--warning {
    color: var(--target-dark);
    border-color: var(--target);
    background: transparent;
}

.weekly-row-chart__pct--good {
    color: var(--success);
    border-color: var(--success);
    background: transparent;
}

.weekly-row-chart__scale {
    margin-top: 0.15rem;
    padding-top: 0.2rem;
    border-top: 1px solid #E5E7EB;
}

.weekly-row-chart__scale-spacer,
.weekly-row-chart__scale-metrics-spacer {
    display: none;
}

.weekly-row-chart__scale-line {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
    font-size: 0.56rem;
    color: var(--dashboard-muted);
    font-variant-numeric: tabular-nums;
    /* chừa chỗ bằng cột metrics bên phải */
    margin-right: calc(11.5rem + 0.4rem);
}

.weekly-row-chart__legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding-top: 0.45rem;
    margin-top: 0.15rem;
}

.weekly-row-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--dashboard-muted);
}

.weekly-row-chart__legend-item::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
}

.weekly-row-chart__legend-item--danger::before {
    background: #FCA5A5;
}

.weekly-row-chart__legend-item--warning::before {
    background: #F59E0B;
}

.weekly-row-chart__legend-item--good::before {
    background: #16A34A;
}

.chart-panel__canvas--weekly-row-overview {
    background: #ffffff;
}

.weekly-row-chart--overview .weekly-row-chart__bar {
    border-radius: 0 4px 4px 0;
}

.weekly-row-chart--overview .weekly-row-chart__series-item--actual::before {
    background: #1a7f5a;
}

.weekly-row-chart--overview .weekly-row-chart__series-item--plan::before {
    background: #e85d04;
}

.weekly-row-chart--overview .weekly-row-chart__num-col--actual {
    color: #1a7f5a;
}

.weekly-row-chart--overview .weekly-row-chart__num-col--plan {
    color: #c45c00;
}

.growth-chart__item {
    margin-bottom: 0.95rem;
}

.growth-chart__item:last-child {
    margin-bottom: 0;
}

.growth-chart__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.growth-chart__label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--dashboard-text);
    line-height: 1.35;
    min-width: 0;
}

.growth-chart__value {
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.growth-chart__value--negative {
    color: var(--dashboard-danger);
}

.growth-chart__value--positive {
    color: var(--dashboard-success);
}

.growth-chart__track {
    height: 0.6rem;
    background: #F5F7FB;
    border-radius: 999px;
    overflow: hidden;
}

.growth-chart__fill {
    height: 100%;
    border-radius: 999px;
    min-width: 0;
    transition: width 0.35s ease;
}

.growth-chart__fill--negative {
    background: var(--dashboard-danger);
}

.growth-chart__fill--positive {
    background: var(--dashboard-success);
}

.chart-panel__canvas--stacked-horizontal {
    height: 320px;
}

.chart-panel__canvas--progress {
    height: auto !important;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 0.75rem 0.85rem 0.85rem;
}

.progress-chart__item {
    margin-bottom: 1.35rem;
}

.progress-chart__item:last-child {
    margin-bottom: 0;
}

.progress-chart__identity {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.progress-chart__icon {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--dashboard-primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.progress-chart__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dashboard-text);
}

.progress-chart__track-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.55rem;
}

.progress-chart__track {
    height: 0.65rem;
    background: #F5F7FB;
    border-radius: 999px;
    overflow: hidden;
}

.progress-chart__fill {
    height: 100%;
    border-radius: 999px;
    min-width: 0;
}

.progress-chart__fill--over {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.progress-chart__value {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 3rem;
    text-align: right;
}

.progress-chart__value--good { color: var(--dashboard-success); }
.progress-chart__value--warning { color: var(--dashboard-orange-dark, #D97706); }
.progress-chart__value--danger { color: var(--dashboard-danger); }
.progress-chart__value--neutral { color: var(--dashboard-primary); }

.progress-chart__status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.progress-chart__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.progress-chart__status--good { color: var(--dashboard-success); }
.progress-chart__status--warning { color: #8a5a00; }
.progress-chart__status--danger { color: var(--dashboard-danger); }

.progress-chart__scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.85rem;
    padding-top: 0.35rem;
    border-top: 1px solid #E5E7EB;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--dashboard-muted);
}

.progress-chart__item--branch .progress-chart__identity {
    margin-bottom: 0.35rem;
}

.progress-chart__item--branch .progress-chart__track-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.progress-chart__item--branch .progress-chart__status-text {
    display: none;
}

.progress-chart__evaluations {
    margin-top: 1.15rem;
    padding-top: 0.95rem;
    border-top: 1px dashed var(--dashboard-border, #d8dee8);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.progress-chart__evaluation {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    border-left: 3px solid transparent;
    background: #f8fafc;
}

.progress-chart__evaluation--danger {
    border-left-color: var(--dashboard-danger);
    background: #fff5f5;
}

.progress-chart__evaluation--warning {
    border-left-color: var(--dashboard-orange, #F59E0B);
    background: #fffaf0;
}

.progress-chart__evaluation--good {
    border-left-color: var(--dashboard-success);
    background: #f4fff6;
}

.progress-chart__evaluation-line {
    font-size: 0.7rem;
    line-height: 1.55;
    color: var(--dashboard-text);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.progress-chart__evaluation-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.28rem;
}

.progress-chart__evaluation-status {
    font-weight: 700;
}

.progress-chart__evaluation-status--danger { color: var(--dashboard-danger); }
.progress-chart__evaluation-status--warning { color: #8a5a00; }
.progress-chart__evaluation-status--good { color: var(--dashboard-success); }

.progress-chart__legend {
    margin-top: 0.85rem;
    padding: 0.65rem 0.7rem;
    border-radius: 0.45rem;
    background: #f1f5f9;
}

.progress-chart__legend-title {
    margin: 0 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--dashboard-primary);
    text-transform: none;
    font-family: var(--ems-chart-font-family);
    letter-spacing: 0.03em;
}

.progress-chart__legend-text {
    margin: 0 0 0.45rem;
    font-size: 0.68rem;
    line-height: 1.4;
    color: var(--dashboard-text);
}

.progress-chart__legend-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.progress-chart__legend-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.66rem;
    line-height: 1.35;
    color: var(--dashboard-muted, #5f6b7a);
}

.progress-chart__legend-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.progress-chart__legend-dot--danger { background: var(--danger); }
.progress-chart__legend-dot--warning { background: var(--warning); }
.progress-chart__legend-dot--good { background: var(--success); }

.progress-chart__legend-compact {
    width: 100%;
    margin-top: 0.45rem;
}

.progress-chart__legend-unit {
    margin-left: auto;
}

.chart-panel__canvas--service-group {
    height: auto;
    min-height: 280px;
    padding: 0.65rem 0.75rem 0.75rem;
    overflow: visible;
}

.service-group-chart {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    height: 100%;
}

.service-group-chart__subtitle {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--dashboard-primary);
    text-transform: none;
    font-family: var(--ems-chart-font-family);
    letter-spacing: 0.02em;
    line-height: 1.35;
    margin-bottom: 0.1rem;
}

.service-group-chart__rows {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.service-group-chart__row {
    display: grid;
    grid-template-columns: 7.4rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
}

.service-group-chart__identity {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.service-group-chart__icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 0.28rem;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 0.82rem;
}

.service-group-chart__icon-box--blue { background: #0B5CAD; }
.service-group-chart__icon-box--green { background: #16A34A; }
.service-group-chart__icon-box--orange { background: #F59E0B; }
.service-group-chart__icon-box--purple { background: #6f42c1; }

.service-group-chart__label {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.service-group-chart__label-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--dashboard-text);
    line-height: 1.25;
}

.service-group-chart__label-total {
    font-size: 0.58rem;
    font-weight: 700;
    color: #0B5CAD;
    line-height: 1.2;
}

.service-group-chart__bar-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.service-group-chart__track {
    display: flex;
    width: 100%;
    min-height: 1.5rem;
    border-radius: 0.22rem;
    overflow: hidden;
    background: #E5E7EB;
}

.service-group-chart__segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 1.5rem;
    transition: width 0.2s ease;
}

.service-group-chart__segment-pct {
    padding: 0 0.15rem;
    font-size: 0.58rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.service-group-chart__segment--empty {
    width: 100% !important;
    background: #E5E7EB;
}

.service-group-chart__legend {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.service-group-chart__legend-block {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.service-group-chart__legend-item {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0;
}

.service-group-chart__legend-item--child {
    padding-left: 0.15rem;
}

.service-group-chart__legend-children {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-left: 0.85rem;
    padding-left: 0.45rem;
    border-left: 1px solid #E5E7EB;
}

.service-group-chart__legend-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.18rem;
}

.service-group-chart__legend-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.45rem;
    min-width: 0;
    flex: 1;
}

.service-group-chart__legend-name {
    font-size: 0.62rem;
    font-weight: 600;
    color: #344054;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
}

.service-group-chart__legend-meta {
    font-size: 0.6rem;
    font-weight: 700;
    color: #0B5CAD;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.service-group-chart__legend-item--child .service-group-chart__legend-name {
    font-size: 0.58rem;
    font-weight: 600;
    color: #667085;
}

.service-group-chart__legend-item--child .service-group-chart__legend-meta {
    font-size: 0.56rem;
}

.chart-panel__body--service-group {
    min-height: 0;
}

.chart-panel__canvas--donut.chart-panel__canvas--compact {
    min-height: 220px;
}

.chart-panel__body--treemap {
    height: 340px;
    padding: 0.35rem 0.5rem 0.5rem;
}

.treemap-chart-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.treemap-group-headers {
    display: grid;
    grid-template-columns: var(--treemap-grid-cols, 1fr 1fr);
    gap: 3px;
    width: 100%;
    height: 24px;
    flex: 0 0 24px;
    margin-bottom: 3px;
}

.treemap-group-headers__item {
    height: 24px;
    line-height: 24px;
    padding: 0 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #ffffff;
    text-transform: none;
    font-family: var(--ems-chart-font-family);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    min-width: 0;
}

.treemap-group-headers__item--domestic {
    background: var(--dashboard-primary);
}

.treemap-group-headers__item--international {
    background: var(--dashboard-orange);
}

.treemap-chart-wrap .chart-panel__canvas--treemap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: auto;
    padding: 0;
}

.chart-panel__canvas--trend {
    height: 380px;
}

/* Scroll ngang cho biểu đồ 12 tháng trên mobile/tablet */
.chart-panel__h-scroll {
    width: 100%;
    max-width: 100%;
}

.chart-panel__h-scroll--active {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pinch-zoom;
    padding-bottom: 0.35rem;
    scrollbar-width: thin;
}

.chart-panel:has(.chart-panel__h-scroll--active) .card-body {
    overflow-x: auto;
    overflow-y: visible;
}

.chart-panel__h-scroll--active .chart-panel__canvas--trend {
    height: 320px !important;
    min-height: 320px !important;
    max-width: none !important;
}

@media (max-width: 1199.98px) {
    .chart-panel__canvas,
    .chart-panel__canvas--trend {
        height: 300px;
    }

    .chart-panel__body--treemap {
        height: 300px;
    }
}

@media (max-width: 991.98px) {
    .weekly-row-chart__header,
    .weekly-row-chart__row {
        grid-template-columns: 1fr !important;
        gap: 0.3rem !important;
        align-items: stretch !important;
    }

    .weekly-row-chart__header {
        display: none !important;
    }

    /* Mobile/tablet: bar full width; Thực hiện | Kế hoạch | Tỷ lệ cùng hàng dưới bar */
    .weekly-row-chart__main,
    .weekly-row-chart__head-main {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.4rem !important;
        min-width: 0;
        width: 100%;
    }

    .weekly-row-chart__week-col {
        width: 100%;
    }

    .weekly-row-chart__chart-col {
        width: 100% !important;
        min-width: 0;
        padding-top: 0;
    }

    /* Hàng 1: số tiền | Hàng 2: tỷ lệ (gọn trên SE 375px) */
    .weekly-row-chart__metrics {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas:
            "actual plan"
            "pct pct";
        gap: 0.35rem 0.5rem !important;
        margin-top: 0.1rem !important;
        width: 100% !important;
        min-width: 0;
    }

    .weekly-row-chart__num-col--actual {
        grid-area: actual;
    }

    .weekly-row-chart__num-col--plan {
        grid-area: plan;
    }

    .weekly-row-chart__num-col {
        text-align: left;
        white-space: normal;
        font-size: 0.72rem;
        line-height: 1.25;
        min-width: 0;
    }

    .weekly-row-chart__num-col::before {
        content: attr(data-metric);
        display: block;
        font-size: 0.55rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: var(--dashboard-muted);
        text-transform: uppercase;
        margin-bottom: 0.12rem;
        line-height: 1.2;
    }

    .weekly-row-chart__pct-col {
        grid-area: pct;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0.4rem;
        min-width: 0;
        padding-top: 0.1rem;
    }

    .weekly-row-chart__pct-col::before {
        content: attr(data-metric);
        display: inline-block;
        font-size: 0.55rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: var(--dashboard-muted);
        text-transform: uppercase;
        line-height: 1.2;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .weekly-row-chart__pct {
        width: auto;
        min-width: 2.35rem;
        height: 1.45rem;
        padding: 0 0.45rem;
        border-radius: 999px;
        font-size: 0.68rem;
    }

    .weekly-row-chart__row {
        margin-bottom: 0.85rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #E5E7EB;
    }

    .weekly-row-chart__row:last-child {
        border-bottom: 0;
        margin-bottom: 0.2rem;
        padding-bottom: 0;
    }

    .weekly-row-chart__scale {
        display: none !important;
    }

    .weekly-row-chart__scale-line {
        margin-right: 0;
    }

    .weekly-row-chart__top {
        flex-wrap: wrap;
        margin-bottom: 0.45rem;
    }

    .progress-chart__evaluations {
        gap: 0.55rem;
        margin-top: 0.95rem;
        padding-top: 0.8rem;
    }

    .progress-chart__evaluation {
        padding: 0.5rem 0.6rem;
    }

    .progress-chart__evaluation-line {
        font-size: 0.68rem;
        line-height: 1.6;
    }

    .progress-chart__status {
        white-space: normal;
    }

    .chart-panel__canvas--trend,
    .chart-panel__canvas--weekly-row {
        height: auto;
        min-height: 280px;
    }

    .chart-panel__canvas--trend {
        height: 320px;
        min-height: 320px;
    }
}
