/* Header */
.abonos-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.abonos-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.abonos-header-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.btn-exportar-abonos {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn-exportar-abonos:hover {
    background: #f3f4f6;
}

.btn-nuevo-abono {
    background-color: #e02020;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    text-decoration: none;
}

.btn-nuevo-abono:hover {
    background-color: #c01a1a;
    color: #fff;
}

/* Página */
.abonos-page {
    padding: 0;
}

/* Tabla */
.abonos-table-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.abonos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.abonos-table thead tr {
    border-bottom: 1px solid #e5e7eb;
}

.abonos-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.abonos-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    color: #374151;
}

.abonos-table tbody tr:last-child td {
    border-bottom: none;
}

.abonos-table tbody tr:hover {
    background-color: #f9fafb;
}

.abonos-estado {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.abonos-estado-pendiente {
    background: #fef3c7;
    color: #b45309;
}

.abonos-estado-cobrado {
    background: #d1fae5;
    color: #065f46;
}

/* Filtros */
.abonos-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.abonos-filter-btn {
    padding: 0.5rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
}

.abonos-filter-btn:hover {
    background: #f3f4f6;
}

.abonos-filter-active {
    border-color: #e5e7eb;
    background: #fff;
    color: #1a1a1a;
}

.abonos-select {
    padding: 0.5rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    cursor: pointer;
    color: #374151;
}

/* Selector de periodo */
.abonos-periodo-wrapper {
    position: relative;
}

.abonos-periodo-popup {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    width: 520px;
    padding: 1rem;
}

.abonos-periodo-main {
    display: flex;
    gap: 1rem;
}

.abonos-periodo-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 140px;
}

.abonos-periodo-item {
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
}

.abonos-periodo-item:hover {
    background: #f3f4f6;
}

.abonos-periodo-item-active {
    background: #fef2f2;
    color: #e02020;
    font-weight: 600;
}

.abonos-calendario {
    flex: 1;
}

.abonos-calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: capitalize;
}

.abonos-calendario-nav {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 1rem;
    padding: 0.25rem;
}

.abonos-calendario-nav:hover {
    color: #1a1a1a;
}

.abonos-calendario-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.35rem;
}

.abonos-calendario-dias {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.abonos-calendario-dia {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #374151;
    border-radius: 50%;
    cursor: pointer;
}

.abonos-calendario-dia:hover {
    background: #f3f4f6;
}

.abonos-calendario-dia-vacio {
    cursor: default;
    pointer-events: none;
}

.abonos-calendario-dia-hoy {
    background: #e02020;
    color: #fff;
    font-weight: 700;
}

.abonos-calendario-dia-seleccionado {
    background: #fef2f2;
    color: #e02020;
    font-weight: 700;
}

.abonos-calendario-dia-rango {
    background: #fee2e2;
    color: #e02020;
}

.abonos-periodo-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.abonos-periodo-limpiar {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.abonos-periodo-limpiar:hover {
    color: #1a1a1a;
}

.abonos-periodo-aplicar {
    background: #e02020;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.abonos-periodo-aplicar:hover {
    background: #c01a1a;
}

/* Estado vacío */
.abonos-empty-state {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

.abonos-empty-icon {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: #9ca3af;
    font-size: 1.4rem;
}

.abonos-empty-text {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.abonos-clear-btn {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.abonos-clear-btn:hover {
    background: #f3f4f6;
}

/* Tarjetas resumen */
.abonos-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.abonos-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.abonos-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.abonos-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.abonos-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
}

.abonos-card-icon {
    font-size: 1.4rem;
    color: #d1d5db;
}

@media (max-width: 1200px) {
    .abonos-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .abonos-header {
        flex-direction: column;
        gap: 1rem;
    }

    .abonos-header-actions {
        width: 100%;
    }

    .btn-exportar-abonos,
    .btn-nuevo-abono {
        flex: 1;
        justify-content: center;
    }

    .abonos-cards {
        grid-template-columns: 1fr;
    }
}
