/* ================================================
   GASTOS 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;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

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

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

.gastos-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
   ============================================ */
.gastos-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.gastos-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);
}

.gastos-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

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

.section-icon {
    font-size: 1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.section-icon.paused {
    background: var(--danger-subtle);
}

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

/* ============================================
   GASTO CARD - Slim/Stretched
   ============================================ */
.gasto-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);
}

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

/* Card pagado: borde verde sutil */
.gasto-card.pagado {
    border-color: rgba(52, 211, 153, 0.15);
    opacity: 0.75;
}

.gasto-card.pagado:hover {
    opacity: 1;
}

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

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

.gasto-card.pagado .gasto-card-name {
    color: var(--text-secondary);
}

.gasto-card-categoria {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255,255,255,0.04);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    white-space: nowrap;
}

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

.gasto-card-amount.pagado {
    color: var(--success);
    text-decoration: line-through;
    opacity: 0.7;
}

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

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

/* Barra de progreso */
.gasto-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.pagado {
    color: var(--success);
}

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

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

.gasto-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;
}

/* ============================================
   FORMULARIOS (page-specific)
   ============================================ */
form {
    padding: 1.5rem;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
}

.checkbox-group,
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.checkbox-group label,
.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border);
    transition: all var(--transition);
    font-size: 0.9rem;
}

.checkbox-group label:hover,
.radio-group label:hover {
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

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

    .gastos-summary-row {
        gap: 0.5rem;
    }

    .gastos-summary-item {
        padding: 0.6rem 0.5rem;
    }

    .summary-value {
        font-size: 0.95rem;
    }

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

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

    .gasto-card-name {
        min-width: unset;
    }

    .gasto-card-progress {
        min-width: 100px;
    }

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

    .checkbox-group,
    .radio-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.5rem;
    }

    .gasto-card-progress {
        min-width: 80px;
    }

    .gasto-card-name {
        font-size: 0.82rem;
    }

    .gasto-card-amount {
        font-size: 0.88rem;
    }
}
