/* Stili specifici per la sezione Conti Bancari */

/* Testo responsivo pulsanti header */
.btn-label-mobile { display: none; }
.btn-label-desktop { display: inline; }
@media (max-width: 575px) {
    .btn-label-mobile { display: inline; }
    .btn-label-desktop { display: none; }
}

/* Hero Section Style - Matching Spese Extra and Saldi */
.page-hero {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.hero-text {
    flex: 1;
    min-width: 250px;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: #1e293b;
}

.hero-description {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

/* Responsive */
@media (max-width: 768px) {
    .page-hero {
        padding: 1.25rem 1.5rem;
        margin-bottom: 1rem;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }
}

/* Stili per il pulsante "Carica altri" */
.load-more-container {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.load-more-stipendi {
    padding: 8px 16px;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    transition: all 0.2s ease;
}

.load-more-stipendi:hover:not(:disabled) {
    background-color: #e9ecef;
    color: #212529;
}

.load-more-stipendi:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.section-desc {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Stili per la sezione informazioni stipendio */
.stipendio-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group small {
    display: block;
    color: #95a5a6;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 10px;
    color: #7f8c8d;
}

.input-with-icon input,
.input-with-icon select {
    padding-left: 35px;
}

input, select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: #0d0d0d !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(13, 13, 13, 0.2) !important;
    background-color: #f8f9fb !important;
}

/* Sezione Stipendio - legacy, mantenuto per compatibilità */
.stipendio-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stipendio-display {
    margin-top: 1rem;
}

/* Layout compatto per le info */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.info-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.info-item-compact .label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.info-item-compact .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Grafico stipendi */
.grafico-stipendi-container {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 280px;
}

.grafico-stipendi-container canvas {
    max-height: 220px !important;
    height: 220px !important;
}

/* Controlli grafico stipendi */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .chart-controls .btn-group {
        justify-content: center;
    }

    .chart-controls > div:last-child {
        justify-content: center;
    }
}

/* Pulsanti vista grafico */
.btn-vista:hover {
    background: #f3f4f6 !important;
}

.btn-vista.active {
    background: #0d0d0d !important;
    color: white !important;
}

.btn-nav:hover {
    background: #f3f4f6 !important;
    border-color: #9ca3af !important;
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-nav:disabled:hover {
    background: white !important;
    border-color: #d1d5db !important;
}

/* Vecchi stili mantenuti per compatibilità */
.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.info-item {
    flex: 1;
    min-width: 200px;
}

.info-item .label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.3rem;
}

.info-item .value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Mobile layout compatto per sezione stipendio */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr !important;
    }

    .grafico-stipendi-container > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    .grafico-stipendi-container > div:first-child > div:last-child {
        width: 100%;
        justify-content: space-between;
    }
}

    .info-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        row-gap: 1.2rem;
    }

    .info-item {
        min-width: auto;
    }
    
    .info-item .label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .info-item .value {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .stipendio-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stipendio-display {
        margin-top: 0.8rem;
    }
}

/* Layout ultra-compatto per schermi molto piccoli */
@media (max-width: 480px) {
    .info-item .label {
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }
    
    .info-item .value {
        font-size: 0.9rem;
        line-height: 1.1;
    }
    
    .stipendio-section {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .info-row {
        gap: 0.8rem;
        row-gap: 1rem;
    }
}

.stipendio-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Bottoni */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: #0d0d0d;
    color: white;
}

.btn-primary:hover {
    background-color: #0d0d0d;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.btn-secondary:hover {
    background-color: #dfe6e9;
}

.btn-icon {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
    padding: 5px;
}

.edit-conto:hover {
    color: #0d0d0d;
}

.delete-conto:hover {
    color: #e74c3c;
}

/* Header con azioni */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Cards per i conti */
.conti-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.conto-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.2s ease;
}

.conto-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.conto-header {
    padding: 1.5rem 1.2rem;
    background: #475569;
    color: #fff;
    border-bottom: 1px solid #364152;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Pulsanti moderni nell'header */
.conto-actions {
    display: flex;
    gap: 8px;
}

.conto-actions .btn-icon {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.conto-actions .edit-conto:hover {
    background: #0d0d0d;
    border-color: #0d0d0d;
    color: white;
    transform: translateY(-1px);
}

.conto-actions .delete-conto:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
    transform: translateY(-1px);
}
.conto-info {
    /* Rimosso z-index non necessario */
}

.conto-header h4 {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.bank-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conto-toggle {
    padding: 1.2rem;
    background: #f8f9fa;
}

.toggle-details-btn {
    width: 100%;
    background: white;
    border: 1px solid #e9ecef;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toggle-details-btn:hover {
    background: #0d0d0d;
    border-color: #0d0d0d;
    color: white;
    transform: translateY(-1px);
}

.toggle-details-btn i {
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.toggle-details-btn:hover i {
    transform: scale(1.1);
}

.conto-details {
    padding: 1.2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 400px;
        transform: translateY(0);
    }
}


.detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.detail:hover {
    background: #f8f9fa;
    border-color: #0d0d0d;
}

.detail:last-child {
    margin-bottom: 0;
}

.detail .label {
    color: #5a6c7d;
    font-weight: 500;
    flex: 1;
}

.detail .value {
    font-weight: 600;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.detail .note-value {
    font-weight: 400;
    background: none;
    padding: 0;
    border-radius: 0;
}

.conto-note-inline {
    padding: 8px 1.2rem;
    font-size: .82rem;
    color: #64748b;
    font-weight: 400;
    border-bottom: 1px solid #e9ecef;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    background: #f8f9fa;
}

.conto-pari .conto-note-inline {
    background: #e8f0fe;
    border-bottom-color: #c7d9f8;
    color: #4a5568;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.4s;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

.toggle-switch input:checked + label {
    background-color: #0d0d0d;
}

.toggle-switch input:checked + label:before {
    transform: translateX(26px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 1.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Pulse animation per evidenziare il conto stipendio non configurato */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* Alternanza cromatica per distinguere le card visivamente */
.conto-dispari .conto-header {
    background: #475569;
    border-bottom-color: #364152;
}
.conto-pari .conto-header {
    background: #e2e8f0;
    border-bottom-color: #cbd5e1;
}
.conto-pari .conto-header h4 {
    color: #1e293b;
}
.conto-pari .bank-name {
    color: #64748b;
}
.conto-pari .conto-actions .btn-icon {
    color: #475569;
    background: rgba(0,0,0,0.05);
    border-color: #cbd5e1;
}
.conto-pari .conto-details {
    background: #dce8fc;
    border-top-color: #c7d9f8;
}
.conto-pari .detail {
    background: #eef4ff;
    border-color: #c7d9f8;
}
.conto-pari .detail:hover {
    background: #e0ecff;
}

.conto-incomplete {
    border: 2px solid #ff7a00;
    background-color: #fff8f0;
}

.conto-incomplete .conto-header {
    background: #ff7a00;
    color: white;
}

.conto-incomplete .conto-header h4,
.conto-incomplete .bank-name {
    color: white;
}

.conto-incomplete .conto-actions .btn-icon {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.conto-incomplete .conto-actions .btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Stile per il conto stipendio configurato (obbligatorio) */
.conto-stipendio {
    border: 2px solid #0d0d0d;
    background: white;
    box-shadow: 0 4px 15px rgba(13, 13, 13, 0.15);
    position: relative;
}

.conto-stipendio .conto-header {
    background: #0d0d0d;
    color: white;
    position: relative;
}

.conto-stipendio .conto-header h4,
.conto-stipendio .bank-name {
    color: white;
}

/* Pulsanti bianchi nel conto stipendio */
.conto-stipendio .conto-actions .btn-icon {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.conto-stipendio .conto-actions .edit-conto:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
}

.conto-stipendio .conto-actions .delete-conto:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* Badge OBBLIGATORIO posizionato sopra il nome della banca */
.conto-stipendio .bank-name::after {
    content: 'OBBLIGATORIO';
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    text-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-left: 6px;
    vertical-align: middle;
}

/* Stili per conti chiusi */
.conti-chiusi-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.toggle-conti-chiusi {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-conti-chiusi:hover {
    background: #7f8c8d;
}

.toggle-conti-chiusi.expanded {
    background: #e67e22;
}

.toggle-conti-chiusi.expanded:hover {
    background: #d35400;
}

.conto-chiuso {
    background: white;
    border: 2px solid #95a5a6;
    position: relative;
    opacity: 0.7;
}

.conto-chiuso .conto-header {
    background: #95a5a6;
    color: white;
}

.conto-chiuso .conto-header h4,
.conto-chiuso .bank-name {
    color: white;
}

.conto-chiuso::before {
    content: 'ARCHIVIATO';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #95a5a6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
}

.chiusura-info {
    background: #fef5e7;
    border: 1px solid #f39c12;
    padding: 12px;
    margin-top: 10px;
    border-radius: 8px;
}

.chiusura-info .data-chiusura {
    font-weight: 600;
    color: #e67e22;
    font-size: 0.9rem;
}

.chiusura-info .note-chiusura {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 4px;
    font-style: italic;
}

/* Warning box nel modal */
.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.warning-box i {
    color: #f39c12;
    font-size: 1.2rem;
    margin-top: 2px;
}

.warning-box p {
    margin: 0;
    color: #856404;
}

/* Pulsante chiusura conto */
.btn-close-account {
    background: #f39c12;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-close-account:hover {
    background: #e67e22;
}

/* Pulsante ripristino conto */
.restore-conto {
    background: rgba(39, 174, 96, 0.15) !important;
    border-color: rgba(39, 174, 96, 0.2) !important;
    color: #0d0d0d !important;
}

.restore-conto:hover {
    background: rgba(39, 174, 96, 0.8) !important;
    border-color: rgba(39, 174, 96, 0.4) !important;
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3) !important;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

/* Pulsante danger per eliminazione */
.btn-danger {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Warning box rosso (blocco spese collegate) */
.warning-box-danger {
    background: #fde8e8;
    border-color: #f5c6cb;
}

.warning-box-danger i {
    color: #e74c3c;
}

.warning-box-danger p {
    color: #721c24;
}

/* Lista spese collegate nel modal */
.spese-collegate-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.spesa-collegata-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f8f9fa;
}

.spesa-collegata-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.spesa-collegata-info .fa-receipt,
.spesa-collegata-info .fa-piggy-bank {
    color: #0d0d0d;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.spesa-collegata-nome {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spesa-collegata-tipo {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.spesa-collegata-tipo.tipo-addebito {
    background: #e8f0fe;
    color: #1a73e8;
}

.spesa-collegata-tipo.tipo-accumulo {
    background: #fef3e0;
    color: #e67e22;
}

.spesa-collegata-importo {
    font-weight: 600;
    color: #e74c3c;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 10px;
}

.spese-collegate-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.spese-collegate-hint i {
    color: #0d0d0d;
    margin-right: 4px;
}

.conferma-elimina-testo {
    text-align: center;
    color: #495057;
    font-size: 1rem;
    margin: 10px 0 0 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .conti-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .conto-header {
        padding: 1.2rem 1rem;
    }
    
    .conto-toggle {
        padding: 1rem;
    }
    
    .conto-details {
        padding: 1rem;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .conto-actions .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Stili per la gestione stipendio avanzata */

/* Toggle icon storico */
.toggle-icon {
    transition: transform 0.3s ease;
    color: #9ca3af;
}
.toggle-icon.rotated {
    transform: rotate(180deg);
}

.storico-content {
    padding-top: 8px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.storico-actions {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(33, 150, 243, 0.1);
}

.storico-list {
    max-height: 480px;
    overflow-y: auto;
}

.storico-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background-color: #fff;
    transition: box-shadow 0.2s ease;
}

.storico-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.storico-item.automatico {
    /* Rimosso border-left colorato */
}

.storico-item.manuale {
    /* Rimosso border-left colorato */
}

.storico-info {
    flex: 1;
}

.storico-data {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.storico-importo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d0d0d;
}

.storico-tipo {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-style: italic;
}

.storico-note {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-top: 0.25rem;
}

/* Entrata secondaria - distinzione discreta */
.storico-item.entrata-secondaria {
    border-left: 3px solid #a78bfa;
}

.storico-item.entrata-secondaria .storico-importo {
    color: #0d0d0d;
}

.badge-entrata {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
}

.badge-entrata.secondaria {
    background: #f3f4f6;
    color: #0d0d0d;
}

.storico-actions-item {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.storico-actions-item .btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem;
    font-style: italic;
}

/* Responsive storico stipendi */
@media (max-width: 480px) {
    .storico-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.6rem;
    }

    .storico-actions-item {
        justify-content: flex-end;
        border-top: 1px solid #f0f0f0;
        padding-top: 0.5rem;
    }

    .storico-data {
        font-size: 0.85rem;
    }

    .storico-importo {
        font-size: 1rem;
    }

    .storico-content {
        padding: 0.75rem;
    }

    .storico-actions {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
}

.no-data {
    text-align: center;
    color: #95a5a6;
    padding: 2rem;
    font-style: italic;
    line-height: 1.5;
}

.no-data small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #b0b0b0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #d4edda;
    color: #064e5a;
    border: 1px solid #c3e6cb;
}

.badge-success i {
    font-size: 0.7rem;
}

/* Responsive: pulsante modifica stipendio compatto su schermi piccoli */
@media (max-width: 768px) {
    #modifica-stipendio .btn-text {
        display: none;
    }

    #modifica-stipendio {
        padding: 0.5rem 0.65rem;
        min-width: auto;
        width: auto;
        aspect-ratio: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #modifica-stipendio i {
        margin: 0;
    }
}

/* Schermi molto piccoli - pulsante ancora più compatto */
@media (max-width: 480px) {
    #modifica-stipendio {
        padding: 0.45rem 0.55rem;
        font-size: 0.9rem;
    }
}

/* Empty state styling per grafico stipendi */
.chart-wrapper {
    position: relative;
    min-height: 180px;
}

.chart-empty-state {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

.chart-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.chart-empty-state p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.7;
}

/* Quando il grafico è vuoto */
.grafico-stipendi-container.empty .chart-wrapper canvas {
    opacity: 0.25;
    filter: grayscale(50%);
}

.grafico-stipendi-container.empty .chart-empty-state {
    display: block;
}