/* =========================================================
   WC Tesorería – Estilos front-end
   ========================================================= */

.wctes-debts-wrapper {
    margin-top: 1em;
}

.wctes-title {
    font-size: 1.4em;
    margin-bottom: .75em;
}

/* ── Resumen superior ───────────────────────── */
.wctes-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1.2em;
}

.wctes-summary-item {
    display: flex;
    flex-direction: column;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: .7em 1.2em;
    min-width: 140px;
}

.wctes-summary-label {
    font-size: .8em;
    color: #777;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .2em;
}

.wctes-summary-value {
    font-size: 1.25em;
    font-weight: 700;
}

.wctes-summary-amount .wctes-summary-value {
    color: #c0392b;
}

/* ── Info de página ─────────────────────────── */
.wctes-page-info {
    color: #555;
    font-size: .9em;
    margin-bottom: .8em;
}

/* ── Aviso sin deudas ───────────────────────── */
.wctes-notice--ok {
    background: #edfaed !important;
    border-left-color: #46b450 !important;
    color: #2d7a2d;
}

.wctes-ok-icon {
    margin-right: .4em;
    font-weight: 700;
    color: #46b450;
}

/* ── Tabla ──────────────────────────────────── */
.wctes-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wctes-debts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85em;
}

.wctes-debts-table thead th {
    background-color: #f7f7f7;
    border-bottom: 2px solid #e0e0e0;
    padding: .6em .7em;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.wctes-debts-table tbody tr {
    border-bottom: 1px solid #ebebeb;
    transition: background-color .15s ease;
}

.wctes-debts-table tbody tr:last-child {
    border-bottom: none;
}

.wctes-debts-table tbody tr:hover {
    background-color: #fafafa;
}

.wctes-debts-table td {
    padding: .6em .7em;
    vertical-align: middle;
}

/* ── Columnas ───────────────────────────────── */
.wctes-col-factura {
    font-weight: 600;
}

.wctes-col-importe {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.wctes-debts-table thead .wctes-col-importe {
    text-align: right;
}

.wctes-col-vencimiento {
    white-space: normal;
}

/* ── Fila vencida ───────────────────────────── */
.wctes-row-vencido {
    background-color: #fff8f8 !important;
}

.wctes-row-vencido:hover {
    background-color: #fff0f0 !important;
}

.wctes-row-vencido .wctes-col-vencimiento {
    color: #c0392b;
}

.wctes-badge-vencido {
    display: inline-block;
    margin-left: .3em;
    padding: .1em .4em;
    background: #c0392b;
    color: #fff;
    font-size: .68em;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: middle;
}

/* ── Pie de tabla (total) ───────────────────── */
.wctes-tfoot-total {
    border-top: 2px solid #e0e0e0;
    background: #f7f7f7;
}

.wctes-tfoot-label {
    padding: .75em 1em;
    font-weight: 600;
    color: #555;
    text-align: right;
}

.wctes-tfoot-amount {
    color: #c0392b;
    font-size: 1.05em;
}

/* ── Paginación ─────────────────────────────── */
.wctes-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4em;
    margin-top: 1.4em;
}

.wctes-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .7em;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: .9em;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: background-color .15s ease, border-color .15s ease;
}

.wctes-page-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.wctes-page-btn.wctes-page-current {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}

.wctes-page-btn.wctes-disabled {
    opacity: .4;
    cursor: default;
    pointer-events: none;
}

.wctes-page-prev,
.wctes-page-next {
    min-width: auto;
    padding: 0 .9em;
}

/* ── Responsive (móvil) ─────────────────────── */
@media ( max-width: 600px ) {

    .wctes-summary {
        flex-direction: column;
    }

    .wctes-debts-table,
    .wctes-debts-table thead,
    .wctes-debts-table tbody,
    .wctes-debts-table tfoot,
    .wctes-debts-table th,
    .wctes-debts-table td,
    .wctes-debts-table tr {
        display: block;
    }

    .wctes-debts-table thead {
        display: none;
    }

    .wctes-debts-table tbody tr {
        margin-bottom: 1em;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        padding: .5em;
    }

    .wctes-debts-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .5em .75em;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
    }

    .wctes-debts-table td:last-child {
        border-bottom: none;
    }

    .wctes-debts-table td::before {
        content: attr(data-title) ": ";
        font-weight: 600;
        margin-right: 1em;
        min-width: 110px;
        flex-shrink: 0;
    }

    .wctes-col-importe {
        text-align: left;
    }

    .wctes-tfoot-total {
        display: flex;
        justify-content: space-between;
        padding: .75em;
        border-top: 2px solid #e0e0e0;
        margin-top: .5em;
    }

    .wctes-tfoot-total td {
        display: inline;
        border: none;
        padding: 0;
    }

    .wctes-tfoot-total td::before {
        display: none;
    }
}
