/* SGTC v28 - Relatórios Gerenciais Avançados */

.page-v28 {
    max-width: 1580px;
}

.v28-hero,
.v28-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    border-radius: 24px;
    padding: 24px 26px;
    margin-bottom: 14px;
    background:
        radial-gradient(circle at 86% 18%, rgba(255, 210, 26, .18), transparent 28%),
        linear-gradient(135deg, #07362f, #0d6a60 58%, #128778);
    color: #fff;
    box-shadow: 0 22px 48px rgba(4, 45, 39, .17);
}

.v28-page-head {
    min-height: 120px;
}

.v28-hero h1,
.v28-page-head h1 {
    margin: 4px 0 6px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1;
    letter-spacing: -.6px;
}

.v28-hero p,
.v28-page-head p {
    margin: 0;
    color: rgba(255,255,255,.83);
    font-weight: 750;
}

.v28-kicker {
    display: inline-flex;
    color: #ffe36e;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .13em;
}

.v28-period-badge {
    min-width: 290px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 18px;
    background: rgba(255,255,255,.11);
}

.v28-period-badge span,
.v28-period-badge small {
    display: block;
    color: rgba(255,255,255,.8);
    font-weight: 750;
}

.v28-period-badge strong {
    display: block;
    margin: 4px 0;
    font-size: 17px;
}

.v28-report-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.v28-report-nav a {
    text-decoration: none;
    color: #075a52;
    background: #e9f7f3;
    border: 1px solid #cde8e1;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 950;
}

.v28-report-nav a.active {
    color: #fff;
    background: #0f766e;
    border-color: #0f766e;
}

.v28-filter-card,
.v28-card {
    border: 1px solid #d9e9e4;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(249,253,251,.99));
    box-shadow: 0 15px 34px rgba(4,45,39,.09);
}

.v28-filter-card {
    padding: 14px;
    margin-bottom: 14px;
}

.v28-filter-form {
    display: grid;
    grid-template-columns: 160px 160px minmax(190px, .8fr) minmax(260px, 1.2fr) auto;
    gap: 10px;
    align-items: end;
}

.v28-filter-form label,
.v28-save-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    color: #214c47;
    font-size: 11px;
    font-weight: 950;
}

.v28-filter-form input,
.v28-filter-form select,
.v28-save-form input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cfe0da;
    border-radius: 11px;
    padding: 9px 10px;
    background: #fff;
    font-family: inherit;
    color: #173c38;
}

.v28-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.v28-filter-actions .btn {
    white-space: nowrap;
}

.v28-saved-filter {
    margin-top: 10px;
    border-top: 1px solid #e2ece9;
    padding-top: 9px;
}

.v28-saved-filter summary {
    cursor: pointer;
    color: #075a52;
    font-size: 12px;
    font-weight: 950;
}

.v28-save-form {
    display: flex;
    align-items: end;
    gap: 8px;
    margin-top: 10px;
}

.v28-save-form label {
    min-width: 260px;
}

.v28-saved-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.v28-saved-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #cfe4de;
    border-radius: 999px;
    padding: 4px 5px 4px 11px;
    background: #f4fbf8;
}

.v28-saved-item a {
    color: #075a52;
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
}

.v28-saved-item form {
    display: inline-flex;
    margin: 0;
}

.v28-icon-danger,
.v28-icon-edit {
    border: 0;
    border-radius: 999px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-weight: 950;
}

.v28-icon-danger {
    color: #a51d1d;
    background: #ffe9e7;
}

.v28-icon-edit {
    color: #075a52;
    background: #dff4ed;
    font-size: 10px;
    width: auto;
    padding: 0 8px;
}

.v28-alert-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.v28-alert {
    display: block;
    text-decoration: none;
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid #dce9e5;
    background: #fff;
    color: #173c38;
}

.v28-alert strong,
.v28-alert span {
    display: block;
}

.v28-alert strong {
    margin-bottom: 3px;
    font-weight: 950;
}

.v28-alert span {
    color: #617d77;
    font-size: 12px;
    font-weight: 700;
}

.v28-alert.danger { background: #fff1ef; border-color: #f5c4bc; }
.v28-alert.warning { background: #fff9e7; border-color: #f0d88e; }
.v28-alert.info { background: #eef8ff; border-color: #c8e2f2; }
.v28-alert.success { background: #effcf6; border-color: #bfe9d4; }

.v28-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.v28-kpi-grid.compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.v28-kpi {
    min-height: 118px;
    padding: 15px;
    border-radius: 19px;
    border: 1px solid #dce9e5;
    background: #fff;
    box-shadow: 0 14px 30px rgba(4,45,39,.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.v28-kpi span {
    color: #5b7771;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.v28-kpi strong {
    color: #06372f;
    font-size: clamp(21px, 2.2vw, 29px);
    line-height: 1.05;
    font-weight: 950;
    word-break: break-word;
}

.v28-kpi small {
    color: #6d8882;
    font-size: 11px;
    font-weight: 750;
}

.v28-kpi.primary {
    background: linear-gradient(135deg, #07362f, #0f766e);
}

.v28-kpi.primary span,
.v28-kpi.primary strong,
.v28-kpi.primary small {
    color: #fff;
}

.v28-kpi.money { background: linear-gradient(135deg, #eefaf5, #fff); }
.v28-kpi.accent { background: linear-gradient(135deg, #fff1aa, #fff); border-color: #f0d56d; }
.v28-kpi.warning { background: linear-gradient(135deg, #fff7d8, #fff); border-color: #f2d889; }
.v28-kpi.danger { background: linear-gradient(135deg, #ffecea, #fff); border-color: #f2c0b9; }

.v28-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.v28-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v28-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.v28-card {
    padding: 15px;
    overflow: hidden;
    min-width: 0;
    margin-bottom: 14px;
}

.v28-grid .v28-card {
    margin-bottom: 0;
}

.v28-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
}

.v28-card-head h2 {
    margin: 0 0 3px;
    color: #053047;
    font-size: 18px;
    font-weight: 950;
}

.v28-card-head p {
    margin: 0;
    color: #647f79;
    font-size: 12px;
    font-weight: 750;
}

.v28-card-head > a {
    color: #075a52;
    text-decoration: none;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}

.v28-chart-list,
.v28-ranking,
.v28-status-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.v28-chart-row {
    display: grid;
    grid-template-columns: 64px minmax(110px, 1fr) 130px;
    gap: 10px;
    align-items: center;
}

.v28-chart-row > span {
    color: #52716b;
    font-size: 11px;
    font-weight: 900;
}

.v28-chart-row > strong {
    text-align: right;
    color: #07362f;
    font-size: 12px;
}

.v28-chart-track,
.v28-mini-track {
    height: 11px;
    border-radius: 999px;
    background: #e5f0ed;
    overflow: hidden;
    display: flex;
}

.v28-chart-track i,
.v28-mini-track i {
    display: block;
    height: 100%;
}

.v28-chart-track i.office { background: #0f766e; }
.v28-chart-track i.purchase { background: #ffd21a; }
.v28-mini-track i { background: linear-gradient(90deg, #0f766e, #6dcbb9); border-radius: 999px; }

.v28-legend {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    margin-top: 10px;
    color: #617d77;
    font-size: 11px;
    font-weight: 850;
}

.v28-legend span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    border-radius: 3px;
    vertical-align: -1px;
}

.v28-legend .office::before { background: #0f766e; }
.v28-legend .purchase::before { background: #ffd21a; }

.v28-ranking-item {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(80px, .8fr) 120px;
    gap: 9px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #e7efec;
}

.v28-ranking-item:last-child {
    border-bottom: 0;
}

.v28-ranking-item strong,
.v28-ranking-item small {
    display: block;
}

.v28-ranking-item strong {
    color: #06372f;
    font-size: 12px;
}

.v28-ranking-item small {
    color: #6e8883;
    font-size: 10px;
    font-weight: 750;
}

.v28-ranking-item b {
    text-align: right;
    color: #075a52;
    font-size: 12px;
}

.v28-status-list > div,
.v28-status-grid article {
    border: 1px solid #e0ece8;
    border-radius: 13px;
    background: #fff;
    padding: 10px 11px;
}

.v28-status-list > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
}

.v28-status-list span,
.v28-status-grid span {
    color: #214c47;
    font-size: 11px;
    font-weight: 950;
}

.v28-status-list strong,
.v28-status-grid strong {
    color: #075a52;
    font-size: 19px;
}

.v28-status-list small {
    grid-column: 1 / -1;
    color: #6e8883;
    font-size: 10px;
    font-weight: 750;
}

.v28-status-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 10px;
}

.v28-status-grid article {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.v28-status-grid small {
    color: #6e8883;
    font-size: 10px;
    font-weight: 750;
}

.v28-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 12px;
}

.v28-table th {
    background: #e9f4f0;
    color: #06372f;
    text-align: left;
    padding: 9px 8px;
    font-size: 10px;
    font-weight: 950;
    white-space: normal;
}

.v28-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #e5eeeb;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.v28-table td strong {
    color: #06372f;
}

.v28-table small {
    color: #6c8580;
    font-weight: 700;
}

.v28-empty,
.v28-empty-cell {
    color: #78908b;
    text-align: center;
    padding: 18px;
    font-weight: 850;
}

@media (max-width: 1380px) {
    .v28-kpi-grid.compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .v28-filter-form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .v28-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1080px) {
    .v28-hero,
    .v28-page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .v28-alert-grid,
    .v28-grid-2,
    .v28-grid-3 {
        grid-template-columns: 1fr;
    }

    .v28-kpi-grid,
    .v28-kpi-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v28-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .v28-filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .v28-filter-actions {
        grid-column: 1 / -1;
    }

    .v28-chart-row,
    .v28-ranking-item {
        grid-template-columns: 1fr;
    }

    .v28-chart-row > strong,
    .v28-ranking-item b {
        text-align: left;
    }

    .v28-table,
    .v28-table thead,
    .v28-table tbody,
    .v28-table tr,
    .v28-table th,
    .v28-table td {
        display: block;
        width: 100%;
    }

    .v28-table thead {
        display: none;
    }

    .v28-table tr {
        border: 1px solid #dce9e5;
        border-radius: 14px;
        margin-bottom: 9px;
        padding: 8px;
        background: #fff;
    }

    .v28-table td {
        border: 0;
        display: grid;
        grid-template-columns: minmax(100px, 38%) 1fr;
        gap: 8px;
        padding: 6px 4px;
    }

    .v28-table td::before {
        content: attr(data-label);
        color: #52716b;
        font-size: 10px;
        font-weight: 950;
        text-transform: uppercase;
    }

    .v28-table .v28-empty-cell {
        display: block;
    }

    .v28-table .v28-empty-cell::before {
        display: none;
    }
}

@media (max-width: 580px) {
    .v28-kpi-grid,
    .v28-kpi-grid.compact,
    .v28-filter-form,
    .v28-status-grid {
        grid-template-columns: 1fr;
    }

    .v28-save-form {
        flex-direction: column;
        align-items: stretch;
    }

    .v28-save-form label {
        min-width: 0;
    }

    .v28-period-badge {
        min-width: 0;
    }
}
