/* SGTC v29.2 - Layout global de cards amplos */

.page-v292-wide,
.page-v281,
.page-v29,
.page-v28,
.page-v27,
.page-v23 {
    max-width: 1640px;
}

/* Preventivas: 1 card largo por linha */
.v281-record-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
}

.v281-record-card {
    padding: 18px 20px !important;
}

.v281-record-card-head {
    grid-template-columns: 170px minmax(0, 1fr) !important;
}

.v281-record-fields,
.v281-record-fields.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* Abastecimento: listas e tanques mais largos */
.v29-record-grid {
    grid-template-columns: 1fr !important;
}

.v29-record {
    padding: 18px 20px !important;
    border-radius: 22px !important;
}

.v29-record dl {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

.v29-tank-grid,
.v29-tank-grid.large {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Relatórios: seções densas em largura total */
.page-v28 .v28-grid-2,
.page-v28 .v28-grid-3 {
    grid-template-columns: 1fr !important;
}

.page-v28 .v28-card {
    padding: 18px 20px !important;
}

/* Compras e Oficina */
.v292-filter-shell,
.v292-list-shell {
    padding: 18px !important;
}

.v292-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(190px, .7fr) minmax(190px, .7fr) auto;
    gap: 12px;
    align-items: end;
}

.v292-filter label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #214c47;
    font-size: 12px;
    font-weight: 900;
}

.v292-filter input,
.v292-filter select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cfe0da;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: #173c38;
    font-family: inherit;
}

.v292-wide-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.v292-wide-card {
    border: 1px solid #d9e9e4;
    border-radius: 22px;
    background: linear-gradient(180deg, #fff, #f9fdfb);
    box-shadow: 0 16px 36px rgba(4,45,39,.08);
    padding: 18px 20px;
    min-width: 0;
}

.v292-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e6efec;
}

.v292-card-head h3 {
    margin: 3px 0 4px;
    color: #06372f;
    font-size: clamp(24px, 2.4vw, 31px);
    line-height: 1;
}

.v292-card-head small {
    color: #667f78;
    font-weight: 750;
}

.v292-label,
.v292-card-grid span {
    display: block;
    color: #5a7771;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.v292-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.v292-card-grid > div {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #e6efec;
    border-radius: 14px;
    background: #f7fbf9;
}

.v292-card-grid strong {
    display: block;
    margin-top: 5px;
    color: #06372f;
    font-size: 19px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.v292-card-grid small {
    display: block;
    margin-top: 3px;
    color: #6a8580;
}

.v292-card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #e6efec;
}

.v292-card-footer form {
    margin: 0;
}

.v292-empty {
    padding: 30px;
    text-align: center;
    border: 1px dashed #cfe0da;
    border-radius: 18px;
    color: #6a8580;
    font-weight: 850;
}

.v292-hidden {
    display: none !important;
}

.v292-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #d9e8e3;
    border-radius: 16px;
    background: #f9fdfb;
}

.v292-pagination-summary {
    color: #617d77;
    font-size: 12px;
    font-weight: 850;
}

.v292-pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v292-pagination-links button {
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #cfe3dd;
    border-radius: 9px;
    background: #fff;
    color: #075a52;
    font-size: 11px;
    font-weight: 950;
    cursor: pointer;
}

.v292-pagination-links button.active {
    color: #fff;
    background: #0f766e;
    border-color: #0f766e;
}

.v292-pagination-links button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Tabelas existentes: sem largura mínima e sem barra horizontal */
.page-v292-wide .v23-table-wrap,
.page-v29 .v29-card,
.page-v28 .v28-card {
    overflow-x: hidden !important;
}

.page-v292-wide .v23-table,
.page-v29 .v29-table,
.page-v28 .v28-table {
    min-width: 0 !important;
    width: 100% !important;
}

@media (max-width: 1280px) {
    .v292-card-grid,
    .v29-record dl,
    .v281-record-fields,
    .v281-record-fields.compact {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

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

@media (max-width: 900px) {
    .v29-tank-grid,
    .v29-tank-grid.large {
        grid-template-columns: 1fr !important;
    }

    .v292-card-grid,
    .v29-record dl,
    .v281-record-fields,
    .v281-record-fields.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .v292-filter {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .v292-card-head,
    .v292-card-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .v292-card-grid,
    .v29-record dl,
    .v281-record-fields,
    .v281-record-fields.compact {
        grid-template-columns: 1fr !important;
    }
}
