/* ================================================
   INGRESOS CSS - GAMMA FINANZAS
   Page-specific styles (base in theme.css)
   ================================================ */

/* ============================================
   LAYOUT
   ============================================ */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.container {
    display: grid;
    gap: 1.5rem;
}

.section-header button {
    padding: 0.5rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    font-size: 0.85rem;
}

/* ============================================
   RESUMEN RÁPIDO
   ============================================ */
.ingresos-summary-row {
    display: flex;
    gap: 1rem;
}

.ingresos-summary-item {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.summary-value.success {
    color: var(--success);
}

.summary-value.warning {
    color: var(--warning);
}

/* ============================================
   SECCIÓN
   ============================================ */
.ingresos-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.ingresos-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
    border-bottom: 1px solid var(--border);
}

.ingresos-section-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.ingresos-section-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ============================================
   INGRESO CARD - Slim/Stretched
   ============================================ */
.ingreso-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.ingreso-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-border);
    box-shadow: var(--shadow-sm);
}

.ingreso-card.cobrado {
    border-color: rgba(52, 211, 153, 0.15);
    opacity: 0.75;
}

.ingreso-card.cobrado:hover {
    opacity: 1;
}

.ingreso-card-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.ingreso-card-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 120px;
}

.ingreso-card.cobrado .ingreso-card-name {
    color: var(--text-secondary);
}

.ingreso-card-concepto {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.ingreso-card-categoria {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 500;
    background: var(--primary-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-border);
    white-space: nowrap;
}

.ingreso-card-persona {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.ingreso-card-amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

.ingreso-card-amount.cobrado {
    text-decoration: line-through;
    opacity: 0.7;
}

.ingreso-card-amount.parcial {
    color: var(--info);
}

.ingreso-card-amount.parcial small {
    color: var(--text-muted);
    font-weight: 500;
}

/* Barra de progreso */
.ingreso-card-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 130px;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar-fill.empty {
    width: 0;
}

.progress-bar-fill.partial {
    background: linear-gradient(90deg, var(--info), #a78bfa);
}

.progress-bar-fill.complete {
    background: linear-gradient(90deg, var(--success-hover), var(--success));
}

.progress-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 24px;
    text-align: right;
}

.progress-text.cobrado {
    color: var(--success);
}

.progress-text.parcial {
    color: var(--info);
}

.ingreso-card-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0;
}

.ingreso-card-actions button {
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-column {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    opacity: 0.3;
}

.empty-text {
    font-size: 0.82rem;
    font-weight: 500;
}

/* ============================================
   PERSONA SELECTOR & FORMS
   ============================================ */
.persona-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.persona-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.personas-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

form {
    padding: 1.5rem;
}

/* ============================================
   HISTORIAL (detail modal)
   ============================================ */
.historial-section {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

.historial-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.historial-list {
    max-height: 300px;
    overflow-y: auto;
}

.historial-mes {
    margin-bottom: 0.75rem;
}

.historial-mes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    text-transform: capitalize;
}

.historial-mes-total {
    color: var(--success);
    font-weight: 700;
}

.historial-cobro-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-subtle);
}

.historial-cobro-item:last-child {
    border-bottom: none;
}

.historial-cobro-fecha { color: var(--text-muted); font-size: 0.75rem; }
.historial-cobro-monto { color: var(--success); font-weight: 600; }
.historial-cobro-fondo { color: var(--text-secondary); font-size: 0.75rem; }

.historial-cobro-tipo {
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.historial-cobro-tipo.regular { background: rgba(52, 211, 153, 0.1); color: var(--success); }
.historial-cobro-tipo.manual { background: rgba(251, 191, 36, 0.1); color: var(--warning); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    main { padding: 1rem; }

    .ingresos-summary-row { gap: 0.5rem; }
    .ingresos-summary-item { padding: 0.6rem 0.5rem; }
    .summary-value { font-size: 0.95rem; }

    .ingreso-card {
        flex-wrap: wrap;
        padding: 0.6rem 0.75rem;
        gap: 0.5rem;
    }

    .ingreso-card-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .ingreso-card-name { min-width: unset; }
    .ingreso-card-progress { min-width: 100px; }

    .ingreso-card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .historial-cobro-item {
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    main { padding: 0.5rem; }
    .ingreso-card-progress { min-width: 80px; }
    .ingreso-card-name { font-size: 0.82rem; }
    .ingreso-card-amount { font-size: 0.88rem; }
}
