.kdtn-dv-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B42318;
    padding: 0.7rem 0.85rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.kdtn-dv {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-family: var(--ems-chart-font-family, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif);
}

.kdtn-dv__kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    position: relative;
    min-height: 0;
}

.kdtn-dv-kpi {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 1rem 1.15rem 1.05rem;
    min-height: 0;
}

.kdtn-dv-kpi__main {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    height: 100%;
}

.kdtn-dv-kpi__primary {
    min-width: 0;
}

.kdtn-dv-kpi__head-main {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-width: 0;
}

.kdtn-dv-kpi__head-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding-top: 0.05rem;
}

.kdtn-dv-kpi__icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: #EFF6FF;
    color: #0B5CAD;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
}

.kdtn-dv-kpi__icon--revenue { background: #DBEAFE; color: #1D4ED8; }
.kdtn-dv-kpi__icon--qty { background: #DCFCE7; color: #15803D; }
.kdtn-dv-kpi__icon--weight { background: #FEF3C7; color: #B45309; }

.kdtn-dv-kpi__title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0B5CAD;
    line-height: 1.25;
}

.kdtn-dv-kpi__value {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.28rem 0.4rem;
}

.kdtn-dv-kpi__unit {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748B;
    margin-left: 0;
}

.kdtn-dv-kpi__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem 1.1rem;
    min-width: 0;
    align-content: start;
    border-top: 1px solid #EEF2F7;
    padding-top: 0.85rem;
}

.kdtn-dv-kpi__compare {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.kdtn-dv-kpi__compare-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #4B5563;
    line-height: 1.3;
}

.kdtn-dv-kpi__compare-base {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0B5CAD;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.kdtn-dv-kpi__compare-change {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.12rem;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.kdtn-dv-kpi__compare-delta {
    font-weight: 700;
}

.kdtn-dv-kpi__compare-pct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    background: #16A34A;
    white-space: nowrap;
}

.kdtn-dv-kpi__compare-change.is-up {
    color: #16A34A;
}

.kdtn-dv-kpi__compare-change.is-up .kdtn-dv-kpi__compare-pct {
    background: #16A34A;
}

.kdtn-dv-kpi__compare-change.is-down {
    color: #DC2626;
}

.kdtn-dv-kpi__compare-change.is-down .kdtn-dv-kpi__compare-pct {
    background: #DC2626;
}

.kdtn-dv-kpi__compare-change.is-flat {
    color: #64748B;
}

.kdtn-dv-kpi__compare-change.is-flat .kdtn-dv-kpi__compare-pct {
    background: #64748B;
}

.kdtn-dv-kpi__meta .is-up,
.kdtn-dv-num.is-up,
.kdtn-dv-compare__pct.is-up,
.kdtn-dv-compare__growth.is-up {
    color: var(--success);
}

.kdtn-dv-kpi__meta .is-down,
.kdtn-dv-num.is-down,
.kdtn-dv-compare__pct.is-down,
.kdtn-dv-compare__growth.is-down {
    color: var(--danger);
}

.kdtn-dv-kpi__meta .is-flat,
.kdtn-dv-num.is-flat,
.kdtn-dv-compare__growth.is-flat {
    color: var(--text-sub);
}

.kdtn-dv__row {
    display: grid;
    gap: 0.75rem;
}

.kdtn-dv__row--charts {
    /* Cột 1 = chuẩn căn hàng dưới (xu hướng tuần). */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.28fr);
    align-items: stretch;
}

.kdtn-dv-panel__hint {
    margin: 0.18rem 0 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-sub);
    white-space: nowrap;
}

.kdtn-dv-contrib {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    min-height: 260px;
    height: 100%;
}

.kdtn-dv-chart--contribution {
    height: 268px;
    min-height: 268px;
}

.kdtn-dv-contrib__legend {
    list-style: none;
    margin: 0 auto;
    padding: 0 0.15rem 0.1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    width: fit-content;
    max-width: 100%;
}

.kdtn-dv-contrib__legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.25;
}

.kdtn-dv-contrib__swatch {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.kdtn-dv-contrib__legend-name {
    min-width: 0;
}

.kdtn-dv-contrib__legend-value {
    font-variant-numeric: tabular-nums;
    color: #0B5CAD;
    white-space: nowrap;
}

.kdtn-dv-service-groups {
    min-height: 300px;
    max-height: none;
    overflow: visible;
}

.kdtn-dv-service-groups.is-scrollable {
    max-height: 38rem;
    overflow: auto;
    padding-right: 0.15rem;
}

.kdtn-dv-hbar {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 0.85rem;
    min-width: 0;
    min-height: 176px;
    font-family: var(--ems-chart-font-family, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif);
}

.kdtn-dv-hbar--top6 {
    justify-content: flex-start;
    gap: 0.62rem;
    min-height: 0;
    height: auto;
}

.kdtn-dv-hbar__row {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.kdtn-dv-hbar__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 700;
    color: #344054;
}

.kdtn-dv-hbar__plot {
    display: grid;
    grid-template-columns: minmax(4.5rem, 1fr) max-content;
    gap: 0.5rem;
    align-items: center;
}

.kdtn-dv-hbar__track {
    height: 1.15rem;
    border-radius: 3px;
    background: #EDF1F5;
    overflow: hidden;
}

.kdtn-dv-hbar__bar {
    height: 100%;
    border-radius: 3px;
    min-width: 0;
}

.kdtn-dv-hbar__metrics {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0B5CAD;
}

.kdtn-dv-donut {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kdtn-dv-chart--donut {
    height: 176px;
}

.kdtn-dv-donut__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem 0.65rem;
    padding: 0 0.1rem 0.1rem;
}

.kdtn-dv-donut__item {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.64rem;
    font-weight: 600;
    color: #344054;
    font-family: var(--ems-chart-font-family, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif);
    white-space: nowrap;
}

.kdtn-dv-donut__item i {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.kdtn-dv__row--analysis {
    /* Cột 1 khớp "Phân tích hiệu suất theo đơn vị"; cột 2 (12 tháng) rộng hơn; cảnh báo hẹp lại. */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 0.73fr);
    align-items: stretch;
}

.kdtn-dv-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.kdtn-dv-panel--loading .kdtn-dv-panel__body,
.kdtn-dv__kpis.kdtn-dv-panel--loading {
    opacity: 0.35;
    pointer-events: none;
}

.kdtn-dv-card-loading {
    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;
    border-radius: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dashboard-muted, #667085);
}

.kdtn-dv-card-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    color: var(--dashboard-primary, #0B5CAD);
    border-width: 0.2em;
}

.kdtn-dv-panel__header {
    padding: 0.6rem 0.85rem 0.4rem;
    border-bottom: 1px solid var(--border);
}

.kdtn-dv-panel__header--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.kdtn-dv-panel__title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.kdtn-dv-panel__body {
    padding: 0.45rem 0.7rem 0.7rem;
    flex: 1;
    position: relative;
}

.kdtn-dv__row--charts > .kdtn-dv-panel {
    min-height: 390px;
}

.kdtn-dv__row--charts > .kdtn-dv-panel .kdtn-dv-panel__body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.kdtn-dv-panel--table.is-page {
    flex: 1;
    min-height: calc(100vh - 9.5rem);
}

.kdtn-dv--matrix-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 8.5rem);
}

.kdtn-dv--matrix-page .kdtn-dv-table-wrap {
    max-height: calc(100vh - 12.5rem);
}

.kdtn-dv-chart {
    width: 100%;
    height: 210px;
    min-width: 0;
}

.kdtn-dv-chart--donut {
    height: 176px;
}

.kdtn-dv-chart--top6 {
    height: 210px;
}

.kdtn-dv-chart--trend {
    height: 248px;
}

.kdtn-dv-chart--month {
    height: 248px;
}

.kdtn-dv-panel--compare .kdtn-dv-panel__body {
    display: flex;
}

.kdtn-dv-panel__body--alerts {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.kdtn-dv-link {
    display: inline-flex;
    margin-top: 0.15rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}

.kdtn-dv-link:hover {
    text-decoration: underline;
}

.kdtn-dv-tabs {
    display: flex;
    gap: 0.25rem;
}

.kdtn-dv-tab {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-sub);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 3px;
    cursor: pointer;
}

.kdtn-dv-tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.kdtn-dv-compare {
    width: 100%;
}

.kdtn-dv-compare__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
    flex: 1;
}

.kdtn-dv-compare__tile {
    border: 1px solid #EEF2F6;
    border-radius: 8px;
    padding: 0.5rem 0.55rem 0.45rem;
    background: #FCFDFE;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kdtn-dv-compare__name {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

.kdtn-dv-compare__value {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0.2rem 0 0.12rem;
    line-height: 1.2;
}

.kdtn-dv-compare__value small {
    display: block;
    font-size: 0.62rem;
    color: var(--text-sub);
    font-weight: 600;
    margin-left: 0;
    margin-top: 0.08rem;
}

.kdtn-dv-compare__growth {
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: baseline;
}

.kdtn-dv-compare__growth span {
    font-weight: 700;
}

.kdtn-dv-compare__hint {
    margin-top: 0.22rem;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-sub);
}

.kdtn-dv-compare__pct {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0.2rem 0 0.1rem;
}

.kdtn-dv-compare__bars {
    height: 88px;
}

.kdtn-dv-compare__bars--spark {
    height: 72px;
}

.kdtn-dv-compare__legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--text-sub);
    font-weight: 600;
}

.kdtn-dv-alerts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
    min-height: 180px;
    overflow: auto;
}

.kdtn-dv-alert {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-main);
}

.kdtn-dv-alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.kdtn-dv-alert--down i { color: var(--danger); }
.kdtn-dv-alert--warn i { color: var(--warning); }
.kdtn-dv-alert--up i { color: var(--success); }

.kdtn-dv-alerts-modal__dialog {
    --bs-modal-width: min(1180px, 92vw);
    width: min(1180px, 92vw);
    max-width: min(1180px, 92vw);
    margin: 1.25rem auto;
}

.kdtn-dv-alerts-modal .modal-content {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.kdtn-dv-alerts-modal .modal-header {
    border-bottom: 1px solid #E8EEF5;
    padding: 1rem 1.25rem 0.85rem;
    align-items: flex-start;
}

.kdtn-dv-alerts-modal__header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding-right: 0.75rem;
}

.kdtn-dv-alerts-modal .modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0B5CAD;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.35;
    margin: 0;
}

.kdtn-dv-alerts-modal__subtitle {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748B;
    line-height: 1.4;
}

.kdtn-dv-alerts-modal .modal-body {
    padding: 0.95rem 1.25rem 1rem;
    display: block;
    max-height: min(68vh, 640px);
}

.kdtn-dv-alerts-modal__columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.kdtn-dv-alerts-modal__section {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.kdtn-dv-alerts-modal__heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.kdtn-dv-alerts-modal__heading i {
    font-size: 0.95rem;
}

.kdtn-dv-alerts-modal__heading-label {
    flex: 1;
    min-width: 0;
}

.kdtn-dv-alerts-modal__heading-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
}

.kdtn-dv-alerts-modal__heading--up {
    color: #15803D;
    background: #E8F8EE;
}

.kdtn-dv-alerts-modal__heading--up .kdtn-dv-alerts-modal__heading-count {
    background: #16A34A;
}

.kdtn-dv-alerts-modal__heading--down {
    color: #B91C1C;
    background: #FDECEC;
}

.kdtn-dv-alerts-modal__heading--down .kdtn-dv-alerts-modal__heading-count {
    background: #DC2626;
}

.kdtn-dv-alerts-modal__stack {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.kdtn-dv-alerts-modal__group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0;
}

.kdtn-dv-alerts-modal__group.is-collapsed > .kdtn-dv-alerts-modal__list {
    display: none;
}

.kdtn-dv-alerts-modal__node.is-collapsed > .kdtn-dv-alerts-modal__children {
    display: none;
}

.kdtn-dv-alerts-modal__group-head,
.kdtn-dv-alerts-modal__item {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: start;
    padding: 0.7rem 0.8rem;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.kdtn-dv-alerts-modal__group-head {
    background: #fff;
}

.kdtn-dv-alerts-modal__item--child {
    background: #F8FAFC;
}

.kdtn-dv-alerts-modal__group-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: 0.01em;
    min-width: 0;
    padding-top: 0.12rem;
}

.kdtn-dv-alerts-modal__group-title-main {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    width: 100%;
}

.kdtn-dv-alerts-modal__group-title-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kdtn-dv-alerts-modal__group-title em {
    font-style: normal;
    min-width: 1.2rem;
    height: 1.15rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #E8F1FB;
    color: #0B5CAD;
    font-size: 0.66rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kdtn-dv-alerts-modal__toggle {
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #16A34A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.kdtn-dv-alerts-modal__toggle:hover {
    color: #15803D;
    background: #E8F8EE;
}

.kdtn-dv-alerts-modal__toggle-spacer {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
}

.kdtn-dv-alerts-modal__list,
.kdtn-dv-alerts-modal__children {
    list-style: none;
    margin: 0.35rem 0 0 1.55rem;
    padding: 0 0 0 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-left: 2px solid #E5E7EB;
}

.kdtn-dv-alerts-modal__node {
    display: flex;
    flex-direction: column;
}

.kdtn-dv-alerts-modal__copy {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
    padding-top: 0.12rem;
}

.kdtn-dv-alerts-modal__copy strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0F172A;
}

.kdtn-dv-alerts-modal__metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
    text-align: right;
    min-width: 7.5rem;
}

.kdtn-dv-alerts-modal__delta {
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    white-space: nowrap;
}

.kdtn-dv-alerts-modal__pct {
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    line-height: 1;
    white-space: nowrap;
}

.kdtn-dv-alerts-modal__triangle {
    font-size: 0.62rem;
    line-height: 1;
}

.kdtn-dv-alerts-modal__item--up .kdtn-dv-alerts-modal__delta,
.kdtn-dv-alerts-modal__item--up .kdtn-dv-alerts-modal__pct,
.kdtn-dv-alerts-modal__group-head.kdtn-dv-alerts-modal__item--up .kdtn-dv-alerts-modal__delta,
.kdtn-dv-alerts-modal__group-head.kdtn-dv-alerts-modal__item--up .kdtn-dv-alerts-modal__pct {
    color: #16A34A;
}

.kdtn-dv-alerts-modal__item--down .kdtn-dv-alerts-modal__delta,
.kdtn-dv-alerts-modal__item--down .kdtn-dv-alerts-modal__pct,
.kdtn-dv-alerts-modal__group-head.kdtn-dv-alerts-modal__item--down .kdtn-dv-alerts-modal__delta,
.kdtn-dv-alerts-modal__group-head.kdtn-dv-alerts-modal__item--down .kdtn-dv-alerts-modal__pct {
    color: #DC2626;
}

.kdtn-dv-alerts-modal__week-line {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748B;
    white-space: nowrap;
    max-width: none;
    line-height: 1.35;
}

.kdtn-dv-alerts-modal__week-line i {
    font-style: normal;
    font-weight: 600;
    color: #94A3B8;
    margin: 0 0.2rem;
}

.kdtn-dv-alerts-modal__week-bc,
.kdtn-dv-alerts-modal__week-prev {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.kdtn-dv-alerts-modal__week-bc {
    color: #0B5CAD;
}

.kdtn-dv-alerts-modal__week-prev {
    color: #F59E0B;
}

.kdtn-dv-alerts-modal__empty {
    margin: 0;
    padding: 0.85rem 0.9rem;
    border: 1px dashed #D0D5DD;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748B;
    background: #F8FAFC;
}

.kdtn-dv-alerts-modal__footer {
    justify-content: flex-start;
    gap: 0.55rem;
    border-top: 0;
    background: #EFF6FF;
    color: #1E40AF;
    padding: 0.75rem 1.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.45;
}

.kdtn-dv-alerts-modal__footer i {
    flex-shrink: 0;
    font-size: 0.95rem;
    margin-top: 0.05rem;
}

@media (max-width: 992px) {
    .kdtn-dv-alerts-modal__dialog {
        --bs-modal-width: min(96vw, 720px);
        width: min(96vw, 720px);
        max-width: min(96vw, 720px);
    }

    .kdtn-dv-alerts-modal__columns {
        grid-template-columns: 1fr;
    }

    .kdtn-dv-alerts-modal__metrics {
        min-width: 0;
    }
}

.kdtn-dv-panel--table {
    overflow: hidden;
}

.kdtn-dv-panel--table.is-fullscreen {
    position: fixed;
    inset: 0.75rem;
    z-index: 80;
    background: #fff;
    box-shadow: none;
}

#matrix-table-panel.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1055;
    margin: 0;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    max-width: none;
    width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: none;
}

#matrix-table-panel.is-fullscreen .matrix-table__header {
    flex: 0 0 auto;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

#matrix-table-panel.is-fullscreen .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#matrix-table-panel.is-fullscreen .matrix-table__scroll {
    flex: 1 1 auto;
    max-height: none !important;
    height: calc(100vh - 3.75rem) !important;
}

.kdtn-dv-matrix-fs-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.48);
}

body.kdtn-dv-matrix-fs-open {
    overflow: hidden;
}

.kdtn-dv-table-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.kdtn-dv-tool {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.55rem;
    border-radius: 3px;
    cursor: pointer;
}

.kdtn-dv-tool--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.kdtn-dv-tool:disabled {
    opacity: 0.45;
    cursor: default;
}

.kdtn-dv-hide-cols {
    position: relative;
}

.kdtn-dv-hide-cols__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.45rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 10rem;
    font-size: 0.75rem;
}

.kdtn-dv-hide-cols__menu[hidden] {
    display: none !important;
}

.kdtn-dv-table-wrap {
    overflow: auto;
    max-height: 420px;
}

.kdtn-dv-panel--table.is-fullscreen .kdtn-dv-table-wrap {
    max-height: calc(100vh - 7rem);
}

.kdtn-dv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    white-space: nowrap;
}

.kdtn-dv-table th,
.kdtn-dv-table td {
    border: 1px solid #E5E7EB;
    padding: 0.38rem 0.5rem;
    vertical-align: middle;
}

.kdtn-dv-table thead th {
    background: #F8FAFC;
    color: var(--primary-dark);
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.kdtn-dv-table tbody td:nth-child(2),
.kdtn-dv-table tbody td:nth-child(3) {
    text-align: left;
    white-space: normal;
    min-width: 8.5rem;
}

.kdtn-dv-table__stt {
    text-align: center;
    font-weight: 700;
    color: #344054;
    width: 3.2rem;
}

.kdtn-dv-table__name {
    min-width: 16rem;
}

.kdtn-dv-table__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.kdtn-dv-table__toggle {
    width: 18px;
    height: 18px;
    border: 1px solid #D0D5DD;
    border-radius: 3px;
    background: #fff;
    color: #0B5CAD;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex: 0 0 18px;
}

.kdtn-dv-table__toggle:hover {
    background: #EFF6FF;
}

.kdtn-dv-table__toggle-spacer {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 18px;
}

.kdtn-dv-table tr.is-group td {
    font-weight: 700;
    background: #F8FAFC;
}

.kdtn-dv-table tr.is-section td {
    background: #E8EEF6;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kdtn-dv-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.kdtn-dv-table .is-hidden {
    display: none;
}

.kdtn-dv-table-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-sub);
}

.kdtn-dv-pager {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.kdtn-dv-pager select {
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.72rem;
}

@media (max-width: 1399.98px) {
    .kdtn-dv__kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .kdtn-dv__row--charts {
        grid-template-columns: 1fr 1fr;
    }

    .kdtn-dv__row--analysis {
        grid-template-columns: 1fr 1fr;
    }

    .kdtn-dv__row--analysis > .kdtn-dv-panel:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {
    .kdtn-dv__kpis,
    .kdtn-dv__row--charts,
    .kdtn-dv__row--analysis,
    .kdtn-dv-panel__body--split {
        grid-template-columns: 1fr;
    }

    .kdtn-dv-kpi__meta {
        grid-template-columns: 1fr 1fr;
    }

    .kdtn-dv__row--analysis > .kdtn-dv-panel:first-child,
    .kdtn-dv__row--analysis > .kdtn-dv-panel:last-child {
        grid-column: auto;
    }

    .kdtn-dv-compare__grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
    }

    .kdtn-dv-panel__header--split,
    .kdtn-dv-table-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}
