@import url('tokens.css');

.mat-container { max-width: 1600px; }

.mat-filter-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: minmax(100px, 0.55fr) minmax(100px, 0.55fr) minmax(240px, 1.45fr) repeat(3, minmax(145px, 1fr));
    margin-top: 1rem;
}

.mat-analysis-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(420px, 0.9fr);
    margin-bottom: 1rem;
}

.mat-ranking-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 0.55rem;
}

.mat-ranking-select { min-width: 235px; }
.mat-chart { height: 430px !important; margin-top: 0.45rem; min-width: 0; }
.mat-ranking-panel:has(input[value="todos"]:checked) .mat-ranking-chart { height: 720px !important; }

.mat-profile-tabs {
    border-bottom: 1px solid var(--border);
    flex-wrap: nowrap;
    margin-top: 0.85rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.mat-profile-tabs .nav-link {
    border: 0;
    color: #536b7d;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.62rem 0.75rem;
    white-space: nowrap;
}

.mat-profile-tabs .nav-link.active {
    border-bottom: 3px solid var(--funasa-red);
    color: var(--funasa-blue-dark);
}

.mat-derived-note,
.mat-infrastructure-note,
.mat-table-note {
    background: #f7fafc;
    border-left: 3px solid var(--funasa-blue);
    border-radius: 0.4rem;
    color: #536b7d;
    font-size: 0.73rem;
    margin: 0.35rem 0 0;
    padding: 0.6rem 0.7rem;
}

.mat-infrastructure-panel,
.mat-table-panel { margin-bottom: 1rem; }
.mat-infrastructure-chart { height: 330px !important; margin-top: 0.4rem; min-width: 0; }
.mat-infrastructure-note { border-left-color: var(--funasa-red); }
.mat-table-note { margin: 0.75rem 0 0; }
.mat-table-panel .export::before { content: "Exportar aba"; }
.mat-table-panel .show-hide {
    background: #f7fafc;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--funasa-blue-dark);
    font-size: 0;
    font-weight: 700;
    margin-right: 0.4rem;
    padding: 0.4rem 0.65rem;
}
.mat-table-panel .show-hide::before { content: "Selecionar colunas"; font-size: 0.75rem; }

@media (max-width: 1199.98px) {
    .mat-analysis-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
    .mat-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mat-filter-grid .filter-field-wide { grid-column: auto; }
    .mat-ranking-panel .panel-header-with-action {
        align-items: stretch;
        flex-direction: column;
    }
    .mat-ranking-actions { align-items: stretch; flex-direction: column; width: 100%; }
    .mat-ranking-select { min-width: 0; width: 100%; }
}

@media (max-width: 767.98px) {
    .mat-filter-grid { grid-template-columns: 1fr; }
    .mat-filter-grid .filter-field-wide { grid-column: auto; }
    .mat-chart { height: 420px !important; }
    .mat-ranking-panel:has(input[value="todos"]:checked) .mat-ranking-chart { height: 700px !important; }
    .mat-infrastructure-chart { height: 360px !important; }
}

@media (max-width: 575.98px) {
    .mat-ranking-actions .segmented-control { width: 100%; }
    .mat-ranking-actions .segmented-control label { flex: 1 1 50%; text-align: center; }
    .mat-infrastructure-chart { height: 390px !important; }
}
