.dashboard-matrix {
    background:
        linear-gradient(180deg, #f7faf9 0%, #eef4f2 56%, #f6efe5 100%);
}

.dashboard-matrix .shell {
    width: min(1360px, calc(100% - 28px));
}

.dashboard-matrix .topbar {
    display: grid;
    gap: 18px;
    padding: 24px 26px;
    border-color: rgba(204, 216, 214, 0.95);
    background:
        linear-gradient(135deg, rgba(12, 55, 61, 0.96), rgba(15, 118, 110, 0.9) 54%, rgba(239, 131, 84, 0.72)),
        #124a46;
}

.dashboard-matrix .topbar-menu-label,
.dashboard-matrix .topbar-copy p {
    color: rgba(237, 246, 244, 0.78);
}

.dashboard-matrix .nav-pills a {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fbfa;
}

.dashboard-matrix .nav-pills a.active {
    background: #fff7ef;
    border-color: #fff7ef;
    color: #0f4d48;
}

.dashboard-matrix .topbar-copy h1 {
    color: #fffefb;
}

.dashboard-matrix .layout,
.dashboard-matrix .main {
    gap: 16px;
}

.dashboard-matrix .panel {
    border-color: rgba(214, 221, 217, 0.98);
    background: rgba(255, 253, 249, 0.96);
    box-shadow: 0 18px 42px rgba(25, 44, 49, 0.08);
    padding: 16px;
}

.dashboard-matrix .filters {
    padding: 10px 12px 12px;
}

.dashboard-matrix .filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(218, 223, 219, 0.92);
}

.dashboard-matrix .filters-head h2 {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.dashboard-matrix .filters-head-main {
    display: grid;
    gap: 0;
}

.dashboard-matrix .filters-action-cluster {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-matrix .dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: stretch;
}

.dashboard-matrix .filters-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
    padding-left: 8px;
    border-left: 1px solid rgba(218, 223, 219, 0.92);
}

.dashboard-matrix .filters-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-matrix .field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dashboard-matrix .field-wide {
    grid-column: span 2;
}

.dashboard-matrix .field label {
    margin-bottom: 0;
    padding-left: 2px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #59706a;
}

.dashboard-matrix .field select,
.dashboard-matrix .field input {
    min-width: 0;
    height: 36px;
    padding: 7px 10px;
    border: 1px solid #d6ddd8;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #f8faf9);
    font: inherit;
}

.dashboard-matrix .field select:focus,
.dashboard-matrix .field input:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.dashboard-matrix .matrix-layout {
    align-items: start;
}

.dashboard-matrix .active-filters-panel {
    padding-bottom: 12px;
}

.dashboard-matrix .active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-matrix .active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid rgba(190, 207, 201, 0.96);
    border-radius: 999px;
    background: #f7fbf9;
    color: #23403b;
    font: inherit;
    cursor: pointer;
}

.dashboard-matrix .active-filter-chip strong {
    font-size: 0.82rem;
    color: #59706a;
}

.dashboard-matrix .active-filter-chip.static {
    background: #fff4ea;
    border-color: rgba(239, 131, 84, 0.28);
    color: #8a4e28;
    cursor: default;
}

.dashboard-matrix .distribution-grid {
    align-items: stretch;
}

.dashboard-matrix .distribution-panel {
    display: grid;
    gap: 12px;
}

.dashboard-matrix .distribution-row {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.dashboard-matrix .distribution-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-matrix .distribution-copy span,
.dashboard-matrix .distribution-empty {
    color: var(--muted);
    font-size: 0.88rem;
}

.dashboard-matrix .distribution-track {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(214, 221, 217, 0.92);
}

.dashboard-matrix .distribution-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #ef8354);
}

.dashboard-matrix .row-button {
    border: 0;
    padding: 0;
    background: none;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.dashboard-matrix .row-button strong,
.dashboard-matrix .row-button small {
    display: block;
}

.dashboard-matrix .row-button small,
.dashboard-matrix td small {
    color: var(--muted);
}

.dashboard-matrix tr.is-selected td {
    background: rgba(13, 124, 102, 0.08);
}

.dashboard-matrix .chip,
.dashboard-matrix .chip-count,
.dashboard-matrix .muted-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    margin: 0 6px 6px 0;
    font-size: 0.78rem;
    line-height: 1.2;
    border: 1px solid rgba(190, 207, 201, 0.96);
    background: #f7fbf9;
    color: #23403b;
}

.dashboard-matrix .chip-program {
    background: #fff4ea;
    border-color: rgba(239, 131, 84, 0.28);
    color: #8a4e28;
}

.dashboard-matrix .chip-count,
.dashboard-matrix .muted-chip {
    color: var(--muted);
}

.dashboard-matrix .detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dashboard-matrix .meta-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.dashboard-matrix .meta-item span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.dashboard-matrix .meta-item strong {
    font-size: 1rem;
}

.dashboard-matrix .detail-chip-group {
    margin-bottom: 10px;
}

.dashboard-matrix .detail-search-field {
    margin-bottom: 12px;
}

.dashboard-matrix .detail-table {
    margin-top: 6px;
}

.dashboard-matrix .pagination {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-matrix .pagination-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.dashboard-matrix .empty-cell {
    color: var(--muted);
    text-align: center;
    padding: 24px 12px;
}

@media (max-width: 1080px) {
    .dashboard-matrix .filters-grid,
    .dashboard-matrix .detail-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .dashboard-matrix .shell {
        width: min(100% - 20px, 1360px);
    }

    .dashboard-matrix .filters-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-matrix .field-wide {
        grid-column: span 1;
    }

    .dashboard-matrix .filters-head,
    .dashboard-matrix .pagination,
    .dashboard-matrix .distribution-copy {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-matrix .filters-action-cluster {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-matrix .dashboard-actions,
    .dashboard-matrix .filters-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .dashboard-matrix .filters-actions {
        padding-left: 0;
        padding-top: 10px;
        border-left: 0;
        border-top: 1px solid rgba(218, 223, 219, 0.92);
    }

    .dashboard-matrix .dashboard-actions .action-link,
    .dashboard-matrix .dashboard-actions .action-button,
    .dashboard-matrix .filters-actions .action-link,
    .dashboard-matrix .filters-actions .action-button,
    .dashboard-matrix .filters-actions .icon-button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .dashboard-matrix .detail-meta {
        grid-template-columns: 1fr;
    }

    .dashboard-matrix .filters-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }
}
