/* Riassunto Saldi - Stili specifici */

.riassunto-saldi {
    padding: 0;
}

/* Header compatto già stilizzato inline nel HTML */

/* Sezione informazioni */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: linear-gradient(135deg, #ff7a00 0%, #ff9f40 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.info-item .value {
    font-weight: 600;
    font-size: 1.1rem;
}

.value-large {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    display: block;
}

/* Loading */
.loading-container {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f2f6;
    border-top: 4px solid #ff7a00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Errore */
.error-message {
    text-align: center;
    padding: 40px;
    color: #ef4444;
    background: #fee2e2;
    border-radius: 12px;
    border: 1px solid #fca5a5;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

/* Sezioni principali */
.saldi-container {
    margin-bottom: 40px;
}

/* Sezione giroconti urgenti */

.giroconti-urgenti-list,
.giroconti-mensili-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.giroconto-urgente-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.giroconto-urgente-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.giroconto-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Link "Vedi N accantonamenti" */
.giroconto-toggle-details {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #0d0d0d;
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 0 0;
    margin-top: 4px;
    border-top: 1px solid #f0f0f0;
    width: auto;
    text-align: left;
}
.giroconto-toggle-details:hover {
    color: #0d0d0d;
    text-decoration: underline;
}
.giroconto-toggle-details i {
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.giroconto-urgente-banca {
    font-weight: 600;
    color: #111827;
    white-space: normal;
    word-break: break-word;
}

.giroconto-urgente-arrow {
    color: #0d0d0d;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.giroconto-urgente-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d0d0d;
    white-space: nowrap;
}

.giroconto-urgente-details {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.giroconto-urgente-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

/* Bottone conferma giroconto */
.giroconto-conferma-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: #f8f9fb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    justify-content: center;
}

.giroconto-conferma-btn:hover {
    background: #f0f2f6;
    border-color: #9ca3af;
    color: #4b5563;
}

.giroconto-conferma-btn.pronto {
    background: #dcfce7;
    border: 1px solid #16a34a;
    color: #166534;
    font-weight: 600;
}

.giroconto-conferma-btn.pronto:hover {
    background: #bbf7d0;
    border-color: #15803d;
}

.giroconto-conferma-btn.confermato {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #10b981;
    border-style: solid;
}

.giroconto-conferma-btn.confermato:hover {
    background: #a7f3d0;
}

.giroconto-conferma-btn i {
    font-size: 0.9rem;
}

/* Stato automatico */
.giroconto-stato-auto {
    text-align: center;
    font-size: 0.8rem;
    color: #10b981;
    padding: 6px 0;
}

/* Stile per giroconti - card con accento laterale */
.giroconto-urgente {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 14px 14px 18px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #0d0d0d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
    transition: all 0.2s ease;
}

.giroconto-urgente:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .09);
    transform: translateY(-1px);
}

/* Stile per giroconti già eseguiti - meno evidenti */
.giroconto-eseguito {
    opacity: 0.6;
    background: #f0fdf4;
    border-left-color: #10b981;
}

.giroconto-eseguito:hover {
    opacity: 0.8;
}

.giroconto-eseguito .giroconto-urgente-amount {
    color: #0d0d0d;
    text-decoration: line-through;
}

.giroconto-eseguito .giroconto-urgente-arrow {
    color: #0d0d0d;
}

.giroconto-eseguito .giroconto-urgente-details {
    color: #9ca3af;
}

.giroconto-eseguito .giroconto-urgente-banca {
    color: #5d7c5d;
}

/* Rimosso badge posizionato per evitare sovrapposizioni */

/* Stili per giroconti mensili - stesso schema colore degli urgenti */
.giroconto-mensile {
    background: white;
}

/* Stili per giroconti mensili eseguiti */
.giroconto-mensile.giroconto-eseguito {
    opacity: 0.6;
    background: #f8faf8;
    border-left-color: #10b981;
}

.giroconto-mensile.giroconto-eseguito:hover {
    opacity: 0.75;
}

.giroconto-mensile.giroconto-eseguito .giroconto-urgente-amount {
    text-decoration: line-through;
}

/* Stili per spese che scadono oggi */
.spesa-scade-oggi {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border: 1px solid #f39c12 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2) !important;
    animation: pulseToday 2s infinite;
}

.spesa-scade-oggi .spesa-nome {
    font-weight: 700 !important;
    color: #d68910 !important;
}

.spesa-scade-oggi .spesa-data,
.spesa-scade-oggi .spesa-accantonato {
    color: #b7950b !important;
    font-weight: 600 !important;
}

.indicatore-oggi {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 8px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
    animation: shimmer 1.5s ease-in-out infinite alternate;
}

/* Animazioni per spese che scadono oggi */
@keyframes pulseToday {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 2px 10px rgba(243, 156, 18, 0.2);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 0 4px 20px rgba(243, 156, 18, 0.4);
    }
}

@keyframes shimmer {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Separatore tra giroconti urgenti e mensili */
.giroconti-separatore {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
}

.giroconti-separatore hr {
    flex: 1;
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0 15px;
}

.giroconti-separatore span {
    white-space: nowrap;
}

.saldi-container h3 {
    color: #111827;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

/* Grid conti */
.conti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.conto-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.conto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .09);
    border-color: transparent;
}

.conto-header {
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.conto-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.banca-info {
    flex: 1;
}

.banca-nome {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conto-scopo {
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: normal;
    margin-left: 24px;
}

.conto-nome-container {
    text-align: left;
}

.conto-nome {
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    margin-left: 24px;
}

/* Stile per saldo consigliato */
.saldo-consigliato {
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saldo-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4b5563;
}

.saldo-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0d0d0d;
}

/* Stili per i costi bancari */
.costi-bancari {
    background-color: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 10px;
    padding: 8px;
}

.costi-bancari .spesa-nome {
    color: #4b5563;
    font-weight: 600;
}

.costi-bancari-dettaglio {
    margin-top: 8px;
    padding: 8px;
    background-color: #f0f2f6;
    border-radius: 4px;
}

.costo-bancario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.85rem;
}

.costo-descrizione {
    color: #4b5563;
}

.costo-importo {
    color: #9ca3af;
    font-weight: 600;
}

.saldo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f0f2f6;
    font-size: 0.9rem;
}

.saldo-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1rem;
    padding-top: 6px;
}

.saldo-item.positivo .value {
    color: #0d0d0d;
}

.saldo-item.negativo .value {
    color: #ef4444;
}

/* Dettagli spese */
.dettagli-spese-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.toggle-dettagli {
    background: linear-gradient(135deg, #ff7a00, #ff9f40);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
    margin-bottom: 8px;
    height: 28px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(255,122,0,.2);
}

.toggle-dettagli:hover {
    opacity: 0.88;
}

.dettagli-spese {
    margin-top: 10px;
}

.dettagli-spese h5 {
    margin: 0 0 10px 0;
    color: #111827;
    font-size: 0.95rem;
}

.dettagli-spese ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dettaglio-spesa {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
}

.dettaglio-spesa:last-child {
    margin-bottom: 0;
}

.spesa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.spesa-nome {
    font-weight: 600;
    color: #111827;
    font-size: 0.95rem;
    flex: 1;
}

.info-rata {
    background: #fff0e0;
    color: #ff7a00;
    border: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.info-rata:hover {
    background: #ff7a00;
    color: white;
}

.spesa-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.spesa-data {
    font-size: 0.8rem;
    color: #0d0d0d;
    font-weight: 500;
}

.spesa-accantonato {
    font-size: 0.85rem;
    color: #ef4444;
    font-weight: 600;
}


/* Responsive */
@media (max-width: 768px) {
    .info-section {
        grid-template-columns: 1fr;
    }

    .conti-grid {
        grid-template-columns: 1fr;
    }

    .conto-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .banca-info {
        text-align: left;
        min-width: auto;
    }

    .info-card {
        text-align: center;
    }

    .info-item {
        justify-content: center;
        flex-direction: column;
        gap: 5px;
    }

    .spesa-info {
        gap: 5px;
    }

    /* Simulation controls responsive */
    .simulation-controls {
        padding: 12px !important;
    }

    .simulation-controls > div {
        gap: 12px !important;
    }

    .simulation-controls span {
        font-size: 0.85rem !important;
    }

    /* Responsive giroconti */
    .giroconti-urgenti-list,
    .giroconti-mensili-list {
        grid-template-columns: 1fr;
    }

    .giroconti-mensili-container,
    .giroconti-urgenti-container {
        margin-bottom: 0.5rem;
    }

    .giroconti-mensili-container h3,
    .giroconti-urgenti-container h3 {
        font-size: 1.1rem;
    }

    .giroconto-urgente {
        padding: 10px 10px 10px 14px;
    }

    .giroconto-urgente-header {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .giroconto-urgente-flow {
        flex: 1;
        min-width: 0;
        flex-wrap: wrap;
    }

    .giroconto-urgente-banca {
        font-size: 0.9rem;
        white-space: normal;
        word-break: break-word;
    }

    .giroconto-urgente-amount {
        font-size: 1rem;
    }

    .giroconto-urgente-details {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .riassunto-saldi {
        padding: 0;
    }

    .info-card,
    .conto-card {
        padding: 15px;
    }

    .value-large {
        font-size: 2rem;
    }

    .dettaglio-spesa {
        padding: 10px;
    }

    .spesa-info span {
        font-size: 0.75rem;
    }
}

/* DESIGN COMPATTO PER GIROCONTI */
.transfer-compact {
    margin: 20px 0;
}

.transfer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #111827;
    font-weight: 600;
    font-size: 0.95rem;
}

.transfer-header i {
    color: #0d0d0d;
}

.transfer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transfer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fb;
    border-radius: 8px;
    border-left: 4px solid transparent;
    border: 1px solid #e5e7eb;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.transfer-item:hover {
    background: #f0f2f6;
    transform: translateX(2px);
}

.transfer-item.in_entrata {
    border-left-color: #0d0d0d;
}

.transfer-item.in_uscita {
    border-left-color: #0d0d0d;
}

.transfer-item.incoming {
    border-left-color: #0d0d0d;
}

.transfer-item.outgoing {
    border-left-color: #0d0d0d;
}

.transfer-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.transfer-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.transfer-direction {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #9ca3af;
    white-space: nowrap;
}

.transfer-direction.in_entrata {
    color: #0d0d0d;
}

.transfer-direction.in_uscita {
    color: #0d0d0d;
}

.transfer-item.incoming .transfer-direction {
    color: #0d0d0d;
}

.transfer-item.outgoing .transfer-direction {
    color: #0d0d0d;
}

.transfer-direction i {
    font-size: 0.8rem;
}

.transfer-amount {
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

.transfer-reason {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 4px;
    line-height: 1.3;
}

.transfer-btn {
    background: linear-gradient(135deg, #ff7a00, #ff9f40);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(255,122,0,.2);
}

.transfer-btn:hover {
    opacity: 0.85;
}

.transfer-btn i {
    font-size: 0.7rem;
}

/* Stili per giroconti automatici (fondi esterni) - appaiono come eseguiti */
.giroconto-automatico {
    opacity: 0.6;
    background: #f0fdf4;
    border-left-color: #10b981;
}

.giroconto-automatico:hover {
    opacity: 0.8;
}

.giroconto-automatico .giroconto-urgente-amount {
    color: #0d0d0d;
    text-decoration: line-through;
}

.giroconto-automatico .giroconto-urgente-arrow {
    color: #0d0d0d;
}

.giroconto-automatico .giroconto-urgente-banca {
    color: #5d7c5d;
}

.giroconto-automatico input[type="checkbox"] {
    cursor: not-allowed;
}

.giroconto-automatico input[type="checkbox"]:disabled + .checkmark {
    background-color: #95a5a6;
    border-color: #95a5a6;
}

.giroconto-automatico input[type="checkbox"]:disabled:checked + .checkmark {
    background-color: #ff9800;
    border-color: #ff9800;
}

.giroconto-automatico input[type="checkbox"]:disabled:checked + .checkmark::after {
    color: white;
}

.giroconto-info-automatico {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.giroconto-info-automatico i {
    color: #f59e0b;
    font-size: 0.9rem;
}

/* Stili per riferimenti temporali */
.temporal-reference {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #065f46;
    font-weight: 500;
}

.temporal-reference i {
    color: #10b981;
    font-size: 0.9rem;
}

/* Pulsante Info Inline */
.info-btn-inline {
    background: #fff0e0;
    color: #ff7a00;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.info-btn-inline:hover {
    background: #ff7a00;
    color: white;
    transform: scale(1.1);
}

.info-btn-inline i {
    font-size: 0.8rem;
}

/* Stili per sezioni espandibili */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 0.85rem 1rem;
    background: #f8f9fb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.section-header h3 {
    margin: 0;
    color: #111827;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-section-btn {
    background: linear-gradient(135deg, #ff7a00, #ff9f40);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.45rem 1rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255,122,0,.2);
}

.toggle-section-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.toggle-section-btn.expanded {
    background: linear-gradient(135deg, #ff7a00, #ff9f40);
    opacity: 0.85;
}

.toggle-section-btn.expanded:hover {
    opacity: 0.75;
}

.toggle-section-btn i {
    transition: transform 0.3s ease;
}

.toggle-section-btn.expanded i {
    transform: rotate(180deg);
}

.section-content {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.section-content.expanded {
    max-height: 2000px;
    opacity: 1;
    padding-top: 0.75rem;
}

.section-description {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Contenitori per le tipologie */
.giroconti-mensili-container,
.giroconti-urgenti-container {
    margin-bottom: 0.75rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .transfer-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .transfer-flow {
        width: 100%;
    }
    
    .transfer-reason {
        font-size: 0.75rem;
    }
    
    .transfer-btn {
        align-self: flex-end;
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* Stili per sezione saldo */
.saldo-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
    margin-top: 15px;
}

.saldo-principale {
    display: block;
    background: linear-gradient(135deg, #f8f9fb 0%, #f0f2f6 100%);
    border-radius: 12px;
    padding: 15px 15px 20px 15px;
    margin-bottom: 15px;
    height: 155px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.saldo-label {
    font-size: 1rem;
    font-weight: 600;
    color: #4b5563;
}

.saldo-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0d0d0d;
}

/* Sezione giroconti — stili base della card (override visivo nell'HTML <style>) */
.giroconti-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
}

.giroconti-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 10px;
}

.giroconti-header i {
    color: #0d0d0d;
}

.giroconti-info {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    justify-content: center;
}

.giroconto-entrata {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    font-weight: 600;
    padding: 6px 12px;
    background: #d1fae5;
    border-radius: 20px;
    border: 1px solid #6ee7b7;
    font-size: 0.85rem;
}

.giroconto-uscita {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ef4444;
    font-weight: 600;
    padding: 6px 12px;
    background: #fee2e2;
    border-radius: 20px;
    border: 1px solid #fca5a5;
    font-size: 0.85rem;
}

.giroconto-entrata i,
.giroconto-uscita i {
    font-size: 0.8rem;
}

/* Stili per spese che scadono oggi */
.spesa-scade-oggi {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%) !important;
    position: relative;
}

.spesa-scade-oggi::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 15px 15px 0;
    border-color: transparent #ff9800 transparent transparent;
}

.indicatore-oggi {
    background: #ff9800;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.spesa-scade-oggi .spesa-data {
    color: #f57c00 !important;
    font-weight: 600;
}

.spesa-scade-oggi .spesa-accantonato {
    color: #e65100 !important;
    font-weight: 600;
}

/* Responsive per giroconti info */
@media (max-width: 768px) {
    .giroconti-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .saldo-principale {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    
    .saldo-label {
        font-size: 0.9rem;
    }
    
    .saldo-amount {
        font-size: 1.2rem;
    }
    
    .giroconti-header {
        font-size: 0.85rem;
    }
    
    .giroconto-entrata,
    .giroconto-uscita {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .indicatore-oggi {
        font-size: 0.65rem;
        padding: 1px 4px;
        margin-left: 4px;
    }
}

/* Pulsante Calcolatrice */
.btn-calcolatrice {
    background: #fff0e0;
    color: #ff7a00;
    border: none;
    border-radius: 20px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
    height: 28px;
    box-sizing: border-box;
}

.btn-calcolatrice:hover {
    background: #ff7a00;
    color: white;
}

.btn-calcolatrice:active {
    transform: scale(0.98);
}

/* Modal Calcolatrice */
.modal-calcolatrice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-calcolatrice-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .11);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    border: 1px solid #e5e7eb;
}

.modal-calcolatrice-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-calcolatrice-header h3 {
    margin: 0;
    color: #111827;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-calcolatrice-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-calcolatrice-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: right;
    flex-shrink: 0;
}

.calcolatrice-info-box {
    background: #f8f9fb;
    border-left: 4px solid #ff7a00;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.calcolatrice-info-box p {
    margin: 0;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.6;
}

.calcolatrice-form-group {
    margin-bottom: 1.5rem;
}

.calcolatrice-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #111827;
    font-weight: 600;
    font-size: 0.9rem;
}

.calcolatrice-input {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.calcolatrice-input:focus {
    outline: none;
    border-color: #ff7a00;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.12);
}

.calcolatrice-risultato {
    background: linear-gradient(135deg, #ff7a00, #ff9f40);
    color: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin-top: 1.5rem;
}

.calcolatrice-risultato h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.differenza-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.differenza-descrizione {
    font-size: 0.9rem;
    opacity: 0.9;
}

.calcolatrice-confronto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.confronto-item {
    background: #f8f9fb;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.confronto-label {
    display: block;
    color: #9ca3af;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confronto-value {
    display: block;
    color: #111827;
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 560px) {
    .confronto-value { font-size: 1.05rem; }
    .confronto-item { padding: 0.85rem 0.6rem; }
}