/* Reset e base - STILE GESTIONALE AZIENDALE ANNI '90 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Arial', 'Verdana', sans-serif;
    background: #e8e8e8;
    color: #000000;
    font-size: 13px;
    line-height: 1.4;
}

/* Scrollbar stile classico */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-track {
    background: #d4d0c8;
    border: 1px solid #808080;
}
::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid #808080;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Login - STILE GESTIONALE CLASSICO */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e8e8e8;
    padding: 20px;
}

.login-box {
    background: #e8e8e8;
    padding: 35px 45px;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    text-align: center;
    color: #1a3a6a;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 0.9rem;
    border-bottom: 1px solid #c0c0c0;
    padding-bottom: 15px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    background: #ffffff;
    border: 2px solid #c0c0c0;
    border-top-color: #808080;
    border-left-color: #808080;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: #1a3a6a;
    border-top-color: #1a3a6a;
    border-left-color: #1a3a6a;
    background: #f8faff;
}

.btn-primary {
    width: 100%;
    padding: 10px;
    background: #e8e8e8;
    color: #000;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: #d4d4d4;
    border-top-color: #c0c0c0;
    border-left-color: #c0c0c0;
}

.btn-primary:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

.btn-secondary {
    padding: 7px 16px;
    background: #e8e8e8;
    color: #000;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover {
    background: #d4d4d4;
}

.btn-secondary:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

.error-message {
    color: #cc0000;
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
}

.login-info {
    margin-top: 18px;
    text-align: center;
    color: #888;
    font-size: 0.75rem;
    border-top: 1px solid #c0c0c0;
    padding-top: 12px;
}

/* Header - STILE GESTIONALE */
.header {
    background: #e8e8e8;
    border-bottom: 2px solid #c0c0c0;
    padding: 10px 25px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a3a6a;
    letter-spacing: 0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

#userName {
    color: #000;
    font-weight: 600;
}

.user-role {
    background: #1a3a6a;
    color: #ffffff;
    padding: 2px 12px;
    border: 1px solid #0a1a3a;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-logout {
    padding: 4px 14px;
    background: #e8e8e8;
    color: #cc0000;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-logout:hover {
    background: #d4d4d4;
}

.btn-logout:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

/* Navigation - STILE GESTIONALE */
.nav-menu {
    background: #d4d0c8;
    padding: 6px 25px;
    border-bottom: 2px solid #c0c0c0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 7px 18px;
    background: #d4d0c8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    cursor: pointer;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    transition: all 0.15s;
}

.nav-btn:hover {
    background: #c8c4bc;
}

.nav-btn.active {
    background: #e8e8e8;
    border: 2px solid #1a3a6a;
    border-top-color: #1a3a6a;
    border-left-color: #1a3a6a;
    color: #1a3a6a;
}

.nav-btn:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

/* Content */
.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 25px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    color: #1a3a6a;
    font-size: 1.3rem;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c0c0c0;
    letter-spacing: 0.5px;
}

.section-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: center;
}

/* Stats Grid - STILE GESTIONALE */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #e8e8e8;
    padding: 18px 20px;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    transition: all 0.15s;
}

.stat-card h3 {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a3a6a;
}

.stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

/* Data Lists - STILE GESTIONALE */
.data-list {
    background: #f0f0f0;
    padding: 10px;
    border: 2px solid #c0c0c0;
    border-top-color: #a0a0a0;
    border-left-color: #a0a0a0;
    overflow-x: auto;
    min-height: 80px;
}

.data-item {
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.1s;
}

.data-item:last-child {
    margin-bottom: 0;
}

.data-item:hover {
    border-color: #1a3a6a;
    background: #f8faff;
}

.data-item .actions {
    display: flex;
    gap: 6px;
}

/* Bottoni piccoli - STILE GESTIONALE */
.btn-small {
    padding: 3px 12px;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    background: #e8e8e8;
    color: #000;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-small:hover {
    background: #d4d4d4;
}

.btn-small:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

.btn-edit {
    border-color: #cc9900;
    border-top-color: #ffcc33;
    border-left-color: #ffcc33;
    color: #664400;
}

.btn-edit:hover {
    background: #ffeedd;
}

.btn-delete {
    border-color: #cc0000;
    border-top-color: #ff4444;
    border-left-color: #ff4444;
    color: #990000;
}

.btn-delete:hover {
    background: #ffdddd;
}

.btn-pdf {
    border-color: #0066cc;
    border-top-color: #4488ff;
    border-left-color: #4488ff;
    color: #003366;
}

.btn-pdf:hover {
    background: #ddeeff;
}

/* Modal - STILE GESTIONALE */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #e8e8e8;
    padding: 25px 30px;
    border: 3px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 8px 8px 30px rgba(0,0,0,0.4);
}

.modal-content-xl {
    max-width: 950px;
    width: 95%;
}

.modal-content .form-group textarea,
.modal-content .form-group input,
.modal-content .form-group select {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 2px solid #c0c0c0;
    border-top-color: #808080;
    border-left-color: #808080;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    padding: 7px 11px;
    outline: none;
}

.modal-content .form-group textarea:focus,
.modal-content .form-group input:focus,
.modal-content .form-group select:focus {
    border-color: #1a3a6a;
    border-top-color: #1a3a6a;
    border-left-color: #1a3a6a;
}

.modal-content .form-group select {
    background: #ffffff;
    padding: 7px 11px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    color: #888;
    transition: color 0.15s;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.modal-close:hover {
    color: #000;
}

.modal form .form-group {
    margin-bottom: 14px;
}

.modal form label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
}

.modal form input,
.modal form select,
.modal form textarea {
    width: 100%;
    padding: 7px 11px;
    background: #ffffff;
    border: 2px solid #c0c0c0;
    border-top-color: #808080;
    border-left-color: #808080;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    outline: none;
}

.modal form textarea {
    min-height: 80px;
    resize: vertical;
}

.modal form input:focus,
.modal form select:focus,
.modal form textarea:focus {
    border-color: #1a3a6a;
    border-top-color: #1a3a6a;
    border-left-color: #1a3a6a;
}

.modal h3 {
    color: #1a3a6a;
    font-size: 1.2rem;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c0c0c0;
    letter-spacing: 0.5px;
}

.modal h4 {
    color: #1a3a6a;
    font-size: 0.9rem;
    margin: 16px 0 8px 0;
    border-top: 1px solid #c0c0c0;
    padding-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
        text-align: center;
    }
    
    .content {
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .data-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .login-box {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Descrizione multiriga */
.descrizione-multiriga {
    word-wrap: break-word;
    display: block;
    margin-top: 3px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #000;
}

.descrizione-dettaglio {
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    color: #000 !important;
    background: #ffffff !important;
    padding: 10px 14px !important;
    border: 1px solid #c0c0c0 !important;
    min-height: 50px !important;
}

/* ==================== CALENDARIO - STILE GESTIONALE ==================== */
.calendar-container {
    background: #f0f0f0;
    padding: 18px;
    margin-bottom: 20px;
    border: 2px solid #c0c0c0;
    border-top-color: #a0a0a0;
    border-left-color: #a0a0a0;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.calendar-header h3 {
    min-width: 170px;
    text-align: center;
    color: #1a3a6a;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.calendar-day-header {
    text-align: center;
    color: #666;
    padding: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #d4d0c8;
    border: 1px solid #c0c0c0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    min-height: 55px;
    background: #ffffff;
    border: 1px solid #c0c0c0;
    padding: 3px;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.calendar-day:hover {
    border-color: #1a3a6a;
    background: #f8faff;
}

.calendar-day .day-number {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    text-align: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.calendar-day.other-month .day-number {
    color: #bbb;
}

.calendar-day.today {
    border: 3px solid #cc0000 !important;
    background: #fff0f0;
    box-shadow: 0 0 15px rgba(204, 0, 0, 0.3);
    position: relative;
}

.calendar-day.today .day-number {
    color: #cc0000;
    font-weight: 700;
}
.calendar-day.today::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #ff4444;
    pointer-events: none;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.calendar-day.has-event {
    border-color: #006600;
    border-width: 2px;
}

.calendar-day .event-item {
    font-size: 0.55rem;
    background: #e8f5e9;
    padding: 1px 4px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #006600;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #a0c0a0;
    text-align: center;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
}

.calendar-day.today .event-item {
    background: #d4e8ff;
    border-color: #1a3a6a;
    color: #1a3a6a;
}

/* PAGINA IN COSTRUZIONE - STILE GESTIONALE */
.costruzione-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    background: #f0f0f0;
    border: 2px solid #c0c0c0;
    border-top-color: #a0a0a0;
    border-left-color: #a0a0a0;
    min-height: 250px;
    text-align: center;
}

.costruzione-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.4;
}

.costruzione-container h3 {
    font-size: 1.2rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.costruzione-container p {
    color: #888;
    font-size: 0.9rem;
}

/* Stili per il form cliente con griglie */
.modal-content .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-content .form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .modal-content .form-grid,
    .modal-content .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Stili per la griglia di dettaglio clienti */
.clienti-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2px 15px;
    background: #f8f8f8;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    margin: 3px 0;
    font-size: 0.85rem;
}

.clienti-detail-grid .label {
    color: #666;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.clienti-detail-grid .value {
    color: #000;
}

.clienti-detail-grid .section-divider {
    grid-column: 1 / -1;
    border-top: 1px dashed #c0c0c0;
    padding-top: 3px;
    margin-top: 2px;
    color: #1a3a6a;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Tabelle - STILE GESTIONALE */
.clienti-tabella {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.85rem;
}

.clienti-tabella th {
    background: #d4d0c8;
    padding: 8px 12px;
    text-align: left;
    color: #333;
    border-bottom: 2px solid #c0c0c0;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.clienti-tabella td {
    padding: 7px 12px;
    border-bottom: 1px solid #d0d0d0;
    vertical-align: middle;
    color: #000;
}

.clienti-tabella tr:hover {
    background: #f8faff;
}

.clienti-tabella .descrizione-cell {
    max-width: 250px;
    word-wrap: break-word;
    font-size: 0.8rem;
    color: #444;
}

/* Stili per elemento vuoto e messaggi */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 0.9rem;
}

/* Contatore clienti */
#clientiCounter {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    align-self: center;
}

/* Input di ricerca - STILE GESTIONALE */
#clientiSearchInput {
    padding: 7px 12px;
    background: #ffffff;
    border: 2px solid #c0c0c0;
    border-top-color: #808080;
    border-left-color: #808080;
    color: #000;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    outline: none;
    min-width: 150px;
}

#clientiSearchInput:focus {
    border-color: #1a3a6a;
    border-top-color: #1a3a6a;
    border-left-color: #1a3a6a;
}

#clientiSearchInput::placeholder {
    color: #aaa;
}

/* Paginazione - STILE GESTIONALE */
#clientiPagination button {
    padding: 4px 14px;
    background: #e8e8e8;
    color: #000;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

#clientiPagination button:hover:not([disabled]) {
    background: #d4d4d4;
}

#clientiPagination button:active:not([disabled]) {
    border-top-color: #808080;
    border-left-color: #808080;
}

#clientiPagination button[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

#clientiPagination span {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Bottoni nei modali */
.modal-content .btn-primary {
    width: auto;
    padding: 8px 25px;
}

.modal-content button[type="submit"] {
    width: auto;
    padding: 8px 30px;
}

/* Stile per i dati dei clienti */
#clientiList .data-item strong {
    color: #1a3a6a;
    font-weight: 700;
}

#clientiList .data-item .label {
    color: #666;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Stile per i link nel modal */
.modal-content a {
    color: #1a3a6a;
    text-decoration: underline;
    cursor: pointer;
}

.modal-content a:hover {
    color: #3355aa;
}

/* Piccole migliorie per la leggibilità */
.small-text {
    font-size: 0.7rem;
    color: #666;
    letter-spacing: 0.3px;
}

/* Logo */
.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.login-logo {
    text-align: center;
    margin-bottom: 15px;
}

.login-logo-img {
    height: 60px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* Se vuoi mantenere il testo come fallback */
.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a3a6a;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

/* ==================== NOTIFICHE - STILE GESTIONALE ==================== */
.notifications-wrapper {
    position: relative;
    display: inline-block;
}

.notifications-btn {
    position: relative;
    padding: 6px 10px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1;
}

.notifications-btn:hover {
    background: #d4d4d4;
}

.notifications-btn:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

.notifications-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #cc0000;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    border: 2px solid #e8e8e8;
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    width: 380px;
    max-height: 450px;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.2);
    display: none;
}

.notifications-dropdown.show {
    display: block;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 2px solid #c0c0c0;
    background: #d4d0c8;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a3a6a;
}

.btn-clear-notifications {
    padding: 3px 12px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #333;
}

.btn-clear-notifications:hover {
    background: #d4d4d4;
}

.notifications-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 5px;
}

.notification-item {
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    margin-bottom: 4px;
    transition: all 0.1s;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8faff;
    border-color: #1a3a6a;
}

.notification-item.unread {
    border-left: 4px solid #1a3a6a;
    background: #f0f5ff;
}

.notification-item .notification-title {
    font-weight: 600;
    color: #1a3a6a;
    font-size: 0.85rem;
}

.notification-item .notification-message {
    color: #444;
    font-size: 0.8rem;
    margin-top: 3px;
    word-wrap: break-word;
}

.notification-item .notification-time {
    color: #888;
    font-size: 0.65rem;
    margin-top: 4px;
    display: block;
}

.notification-empty {
    padding: 30px 15px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.notification-item .notification-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.notification-item .notification-actions button {
    padding: 2px 10px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.15s;
}

.notification-item .notification-actions button:hover {
    background: #d4d4d4;
}

.notification-item .notification-actions .btn-mark-read {
    color: #1a3a6a;
}

.notification-item .notification-actions .btn-delete-notification {
    color: #cc0000;
}

/* Responsive notifiche */
@media (max-width: 768px) {
    .notifications-dropdown {
        width: 300px;
        right: -60px;
    }
}

@media (max-width: 480px) {
    .notifications-dropdown {
        width: 280px;
        right: -80px;
    }
}

/* ==================== RICERCA CLIENTI PER EVENTO ==================== */
.cliente-search-wrapper {
    position: relative;
    width: 100%;
}

.cliente-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #c0c0c0;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0;
}

.cliente-search-results .search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.1s;
}

.cliente-search-results .search-result-item:hover {
    background: #f0f5ff;
    border-left: 3px solid #1a3a6a;
}

.cliente-search-results .search-result-item:last-child {
    border-bottom: none;
}

.cliente-search-results .search-loading,
.cliente-search-results .search-no-results,
.cliente-search-results .search-error {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

.cliente-search-results .search-error {
    color: #cc0000;
}

/* ==================== RAGGRUPPAMENTO PRODOTTI ==================== */
.prodotto-gruppo {
    transition: all 0.2s ease;
}

.prodotto-gruppo:hover {
    border-color: #0044aa;
    background: #e8f0ff;
}

.prodotto-gruppo .search-result-item {
    transition: all 0.15s ease;
}

.prodotto-gruppo .search-result-item:hover {
    background: #f0f5ff;
    border-color: #1a3a6a;
}

/* Stile per le varianti all'interno del gruppo */
#ordineProdottiList .prodotto-gruppo .search-result-item {
    border-left: 3px solid #1a3a6a;
    margin-left: 5px;
}

#ordineProdottiList .prodotto-gruppo .search-result-item:last-child {
    margin-bottom: 0;
}

/* Animazione per l'apertura/chiusura gruppi */
#ordineProdottiList .prodotto-gruppo .varianti-container {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

/* Immagini prodotti */
.prodotto-immagine {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ccc;
    transition: all 0.2s;
}

.prodotto-immagine:hover {
    transform: scale(1.5);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.prodotto-immagine-thumb {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Upload immagine */
.upload-immagine-btn {
    padding: 2px 10px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}

.upload-immagine-btn:hover {
    background: #d4d4d4;
}

.immagine-container {
    position: relative;
    display: inline-block;
}

.immagine-container .btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #cc0000;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s;
}

.immagine-container .btn-remove:hover {
    transform: scale(1.2);
}

/* Stili per le categorie di prodotti nel menù ordine */
.prodotto-gruppo {
    transition: all 0.2s ease;
}

.prodotto-gruppo:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#ordineProdottiList .prodotto-gruppo .search-result-item {
    transition: all 0.15s ease;
}

#ordineProdottiList .prodotto-gruppo .search-result-item:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* Badge colori per categoria */
.badge-categoria {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-personalizzato { background: #cc0000; }
.badge-farmacia { background: #006600; }
.badge-parafarmacia { background: #1a3a6a; }
.badge-carta { background: #888888; }

/* ==================== GRIGLIA PRODOTTI - 2 PER FILA ==================== */
#prodottiList .data-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 120px;
}

/* Responsive per schermi medi - mantiene 2 colonne fino a 600px */
@media (max-width: 768px) {
    #prodottiList > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
}

/* Su schermi molto piccoli (telefoni) passa a 1 colonna */
@media (max-width: 480px) {
    #prodottiList > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Stile per i pulsanti nella griglia prodotti */
#prodottiList .data-item .btn-small {
    font-size: 0.65rem;
    padding: 2px 8px;
}

/* Migliora la visualizzazione delle varianti nei box */
#prodottiList .data-item .varianti-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#prodottiList .data-item .variante-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #e8e8e8;
}

#prodottiList .data-item .variante-row:last-child {
    border-bottom: none;
}

/* ==================== DROPDOWN MENU NAVIGAZIONE ==================== */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown-toggle .dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 4px;
    transition: transform 0.2s;
}

.nav-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #d4d0c8;
    border: 2px solid #c0c0c0;
    border-top: none;
    min-width: 180px;
    z-index: 1000;
    padding: 4px 0;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.15);
    transition: opacity 0.15s ease;
}

.nav-dropdown-menu.open {
    display: block;
}

.nav-sub-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 18px;
    background: #d4d0c8;
    border: none;
    border-bottom: 1px solid #c0c0c0;
    cursor: pointer;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    transition: all 0.15s;
    border-radius: 0;
}

.nav-sub-btn:hover {
    background: #c8c4bc;
}

.nav-sub-btn.active {
    background: #e8e8e8;
    color: #1a3a6a;
    border-left: 3px solid #1a3a6a;
}

.nav-sub-btn:last-child {
    border-bottom: none;
}

/* Responsive per dropdown */
@media (max-width: 768px) {
    .nav-dropdown {
        display: block;
        width: 100%;
    }
    
    .nav-dropdown-menu {
        position: static;
        width: 100%;
        border: none;
        border-left: 2px solid #c0c0c0;
        margin-left: 10px;
        box-shadow: none;
    }
    
    .nav-dropdown-menu .nav-sub-btn {
        padding-left: 25px;
        font-size: 0.75rem;
    }
}

/* ==================== MODAL PER NUOVO ORDINE - PIÙ LARGO ==================== */
.modal-content-ordine {
    max-width: 1200px !important;
    width: 98% !important;
    padding: 25px 30px;
}

/* Per il contenuto interno quando si apre il form ordine */
.modal-content-ordine .prodotto-gruppo {
    padding: 6px 10px;
}

.modal-content-ordine #ordineProdottiList {
    max-height: 350px !important;
    overflow-y: auto;
}

.modal-content-ordine #ordineProdottiList .prodotto-gruppo {
    margin-bottom: 4px;
}

.modal-content-ordine .search-result-item {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Tabella carrello più larga nel modal ordine */
.modal-content-ordine table {
    font-size: 0.8rem !important;
}

.modal-content-ordine table th,
.modal-content-ordine table td {
    padding: 4px 6px !important;
}

/* Rende il modal ancora più largo su schermi grandi */
@media (min-width: 1200px) {
    .modal-content-ordine {
        max-width: 1400px !important;
        width: 96% !important;
    }
}

/* ==================== MODAL PER NUOVO ORDINE - PIÙ LARGO ==================== */
.modal-content-ordine {
    max-width: 1200px !important;
    width: 98% !important;
    padding: 25px 30px;
    max-height: 92vh !important;
    overflow-y: auto !important; /* Scroll dell'intero pannello */
    display: block !important;
}

/* Rimuovi gli overflow-y limitati per far scrollare tutto il pannello */
.modal-content-ordine #ordineProdottiList {
    max-height: none !important;
    overflow-y: visible !important;
    flex-shrink: 0 !important;
}

.modal-content-ordine #ordineProdottiList > div {
    max-height: none !important;
    overflow-y: visible !important;
}

.modal-content-ordine #ordineProdottiSelezionati {
    max-height: none !important;
    overflow-y: visible !important;
}

/* Contenitore prodotti - nessun limite di altezza */
.modal-content-ordine .ordine-prodotti-scroll {
    max-height: none !important;
    overflow-y: visible !important;
    flex: none !important;
    min-height: auto !important;
}

/* Rende il modal ancora più largo su schermi grandi */
@media (min-width: 1200px) {
    .modal-content-ordine {
        max-width: 1400px !important;
        width: 96% !important;
    }
}

/* Layout a griglia per il form ordine */
.modal-content-ordine .ordine-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-content-ordine .ordine-form-grid .full-width {
    grid-column: 1 / -1;
}

/* Assicura che il form non limiti l'altezza */
.modal-content-ordine form {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

.modal-content-ordine form > * {
    flex-shrink: 0;
}

.btn-primary.btn-genera-gruppo {
    background: #28a745;
    border-color: #1a7a2a;
    border-top-color: #3a9a5a;
    border-left-color: #3a9a5a;
}

.btn-primary.btn-genera-gruppo:hover {
    background: #218838;
}

/* ==================== PULSANTI LIBERA / ASSEGNA ==================== */
.btn-libera {
    border-color: #cc6600 !important;
    border-top-color: #ff8833 !important;
    border-left-color: #ff8833 !important;
    color: #885500 !important;
}

.btn-libera:hover {
    background: #ffeedd !important;
}

.btn-assegna {
    border-color: #0066cc !important;
    border-top-color: #4488ff !important;
    border-left-color: #4488ff !important;
    color: #003366 !important;
}

.btn-assegna:hover {
    background: #ddeeff !important;
}

/* ==================== DASHBOARD AVANZATA ==================== */
#statsAvanzate .stat-card {
    padding: 15px 18px;
}

#statsAvanzate .stat-card h3 {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#statsAvanzate .stat-card .stat-totale {
    font-size: 1.8rem;
    font-weight: 700;
}

#statsAvanzate .stat-card .stat-stati {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

#statsAvanzate .stat-card .stat-stati-label {
    font-weight: 400;
}

#attivitaRecenti .attivita-item {
    transition: all 0.15s;
    cursor: default;
}

#attivitaRecenti .attivita-item:hover {
    background: #f8faff;
    border-color: #1a3a6a;
}

/* Responsive per dashboard avanzata */
@media (max-width: 768px) {
    #statsAvanzate {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 480px) {
    #statsAvanzate {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== TREND CHART ==================== */
#trendClientiChart svg,
#trendOrdiniChart svg {
    width: 100%;
    height: auto;
}

#trendClientiChart rect,
#trendOrdiniChart rect {
    transition: opacity 0.2s;
}

#trendClientiChart rect:hover,
#trendOrdiniChart rect:hover {
    opacity: 1 !important;
}

#dashboardMetrics .stat-card {
    padding: 10px 14px;
}

#dashboardMetrics .stat-card:hover {
    border-color: #1a3a6a;
    background: #f8faff;
}

/* Responsive per trend */
@media (max-width: 768px) {
    #section-dashboard > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    #dashboardMetrics > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ==================== VERSIONE LOGO ==================== */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-version {
    font-size: 0.65rem;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: #f0f0f0;
    padding: 2px 10px;
    border: 1px solid #c0c0c0;
    border-top-color: #e0e0e0;
    border-left-color: #e0e0e0;
    border-radius: 2px;
    white-space: nowrap;
}

/* Versione sotto il logo nella pagina di login */
.login-logo {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.login-logo .version-info {
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-info small {
    color: #888;
    font-size: 0.7rem;
}

/* Responsive per la versione */
@media (max-width: 600px) {
    .logo-version {
        font-size: 0.55rem;
        padding: 1px 8px;
    }
    
    .logo {
        gap: 5px;
    }
}

/* ==================== POPUP CARRELLO FLOTTANTE ==================== */
#cartPopup {
    font-family: 'Segoe UI', Arial, sans-serif;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
}

#cartPopupBody::-webkit-scrollbar {
    width: 8px;
}
#cartPopupBody::-webkit-scrollbar-track {
    background: #e8e8e8;
}
#cartPopupBody::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid #a0a0a0;
    border-radius: 4px;
}
#cartPopupBody::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

#cartToggleBtn {
    border-radius: 4px;
    transition: all 0.2s ease;
    animation: pulseBtn 2s ease-in-out infinite;
}

#cartToggleBtn:hover {
    transform: scale(1.05);
    background: #2a4a7a;
}

#cartToggleBtn:active {
    transform: scale(0.95);
}

@keyframes pulseBtn {
    0%, 100% { box-shadow: 3px 3px 15px rgba(0,0,0,0.3); }
    50% { box-shadow: 3px 3px 25px rgba(26, 58, 106, 0.5); }
}

#cartToggleBadge {
    background: #ff6600;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

/* Responsive per il popup del carrello */
@media (max-width: 480px) {
    #cartPopup {
        width: 90% !important;
        max-width: 360px;
        right: 5% !important;
        bottom: 10px !important;
        max-height: 60vh !important;
    }
    
    #cartToggleBtn {
        padding: 10px 14px;
        font-size: 0.8rem;
        bottom: 10px;
        right: 10px;
    }
}

/* Animazione di entrata per il popup */
#cartPopup[style*="display: block"] {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== POPUP CARRELLO FLOTTANTE ==================== */
#cartPopup {
    font-family: 'Segoe UI', Arial, sans-serif;
    border-radius: 6px;
    box-shadow: 0 8px 50px rgba(0,0,0,0.4);
    min-width: 320px;
}

#cartPopupBody::-webkit-scrollbar {
    width: 8px;
}
#cartPopupBody::-webkit-scrollbar-track {
    background: #e8e8e8;
    border-radius: 4px;
}
#cartPopupBody::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid #a0a0a0;
    border-radius: 4px;
}
#cartPopupBody::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

#cartToggleBtn {
    border-radius: 6px;
    transition: all 0.2s ease;
    animation: pulseBtn 2s ease-in-out infinite;
    letter-spacing: 0.3px;
}

#cartToggleBtn:hover {
    transform: scale(1.05);
    background: #2a4a7a;
    box-shadow: 3px 3px 25px rgba(0,0,0,0.4);
}

#cartToggleBtn:active {
    transform: scale(0.95);
}

@keyframes pulseBtn {
    0%, 100% { box-shadow: 3px 3px 20px rgba(0,0,0,0.3); }
    50% { box-shadow: 3px 3px 35px rgba(26, 58, 106, 0.6); }
}

#cartToggleBadge {
    background: #ff6600;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

/* Animazione di entrata per il popup */
#cartPopup[style*="display: block"] {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive per il popup del carrello */
@media (max-width: 600px) {
    #cartPopup {
        width: 92% !important;
        max-width: 420px;
        right: 4% !important;
        bottom: 10px !important;
        max-height: 60vh !important;
        min-width: unset !important;
    }
    
    #cartToggleBtn {
        padding: 12px 16px;
        font-size: 0.9rem;
        bottom: 10px;
        right: 10px;
    }
    
    #cartPopupBody .prodotti-item {
        flex-wrap: wrap;
    }
}

@media (max-width: 400px) {
    #cartPopup {
        width: 96% !important;
        right: 2% !important;
        max-height: 55vh !important;
    }
    
    #cartToggleBtn {
        padding: 10px 14px;
        font-size: 0.8rem;
        bottom: 8px;
        right: 8px;
    }
}

/* ==================== CORREZIONE LINEA SOTTO BOTTONI ==================== */
/* Rimuove il bordo inferiore indesiderato dai data-item nel modal */
.modal-content .data-item:last-child {
    border-bottom: none;
}

/* Rimuove il bordo inferiore dai data-item che contengono solo azioni */
.data-item.actions-container {
    border-bottom: none;
}

/* Assicura che i bottoni nel modal non abbiano bordi extra */
.modal-content .data-item .btn-primary,
.modal-content .data-item .btn-secondary,
.modal-content .data-item .btn-small {
    border-bottom: 2px solid #c0c0c0;
    border-bottom-style: solid;
}

/* Rimuove il bordo inferiore dall'ultimo elemento della lista in un data-item */
.data-item:last-child .btn-primary,
.data-item:last-child .btn-secondary,
.data-item:last-child .btn-small {
    border-bottom: 2px solid #c0c0c0;
}

/* Aggiungi questa regola per garantire che lo sfondo venga applicato correttamente */
#modalBody .data-item {
    transition: background 0.15s ease;
}

/* Opzionale: migliora la leggibilità del testo sullo sfondo colorato */
#modalBody .data-item strong,
#modalBody .data-item .cliente-ordine-link {
    color: #1a3a6a;
}

.btn-delete-cliente {
    border-color: #cc0000 !important;
    border-top-color: #ff4444 !important;
    border-left-color: #ff4444 !important;
    color: #990000 !important;
    font-weight: 600 !important;
    padding: 8px 20px !important;
}

.btn-delete-cliente:hover {
    background: #ffdddd !important;
}

/* Note evidenziate nella descrizione - senza bordi */
.descrizione-dettaglio span[style*="background"] {
    display: inline-block;
    padding: 1px 8px;
    margin: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

/* Legenda per le note */
.legenda-note {
    font-size: 0.7rem;
    color: #888;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.legenda-note .esempio {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.legenda-note .giallo { background: #fff3cd; }
.legenda-note .blu { background: #d4edff; color: #1a3a6a; }
.legenda-note .rosso { background: #f8d7da; color: #721c24; }
.legenda-note .verde { background: #d4edda; color: #155724; }

/* ==================== MODAL ORDINE RIDUCIBILE ==================== */
#ordineModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#ordineModalContent {
    background: #e8e8e8;
    border: 3px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    max-width: 1200px;
    width: 98%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 8px 8px 30px rgba(0,0,0,0.4);
    padding: 0;
    display: block;
}

.ordine-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #e8e8e8;
    border-bottom: 2px solid #c0c0c0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ordine-modal-header .modal-close {
    position: static;
    font-size: 24px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0 4px;
}

.ordine-modal-header .modal-close:hover {
    color: #000;
}

.btn-modal-minimize {
    padding: 2px 10px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #666;
    line-height: 1.2;
    border-radius: 2px;
}

.btn-modal-minimize:hover {
    background: #d4d4d4;
    color: #000;
}

.btn-modal-minimize:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

#ordineModalBody {
    padding: 20px 25px 25px;
}

/* Icona ordine ridotto in basso a sinistra */
#ordineMinimizedIcon {
    transition: all 0.2s ease;
    animation: pulseMinimized 2s ease-in-out infinite;
}

#ordineMinimizedIcon:hover {
    transform: scale(1.05);
    background: #2a4a7a;
    box-shadow: 3px 3px 25px rgba(0,0,0,0.4);
}

#ordineMinimizedIcon:active {
    transform: scale(0.95);
}

@keyframes pulseMinimized {
    0%, 100% { box-shadow: 3px 3px 20px rgba(0,0,0,0.3); }
    50% { box-shadow: 3px 3px 35px rgba(26, 58, 106, 0.6); }
}

/* Responsive per il modal ordine */
@media (max-width: 768px) {
    #ordineModalContent {
        width: 98%;
        max-height: 95vh;
        padding: 0;
    }
    
    #ordineModalBody {
        padding: 15px;
    }
    
    .ordine-modal-header {
        padding: 10px 15px;
    }
    
    #ordineMinimizedIcon {
        padding: 8px 14px;
        font-size: 0.8rem;
        bottom: 10px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    #ordineModalContent {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    #ordineMinimizedIcon {
        padding: 6px 12px;
        font-size: 0.7rem;
        bottom: 8px;
        left: 8px;
    }
}

/* ==================== FIX PER PULSANTI ORDINI - SEMPRE A DESTRA ==================== */
.data-item .ordine-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
    margin-left: auto;
}

.data-item .ordine-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.data-item .ordine-info .ordine-testo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

/* Per schermi piccoli, riduci la dimensione dei pulsanti ma mantieni in riga */
@media (max-width: 768px) {
    .data-item .ordine-actions .btn-small {
        padding: 2px 6px;
        font-size: 0.6rem;
        white-space: nowrap;
    }
    
    .data-item .ordine-info .ordine-testo {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .data-item .ordine-actions .btn-small {
        padding: 1px 4px;
        font-size: 0.5rem;
    }
    
    .data-item .ordine-info .ordine-testo {
        font-size: 0.65rem;
    }
}

/* ==================== IMPOSTAZIONI - STILE GESTIONALE ==================== */
.settings-wrapper {
    position: relative;
    display: inline-block;
}

.settings-btn {
    position: relative;
    padding: 6px 10px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1;
}

.settings-btn:hover {
    background: #d4d4d4;
}

.settings-btn:active {
    border-top-color: #808080;
    border-left-color: #808080;
}

.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #e8e8e8;
    border: 2px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    width: 280px;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.2);
    display: none;
}

.settings-dropdown.show {
    display: block;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 2px solid #c0c0c0;
    background: #d4d0c8;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a3a6a;
}

.settings-list {
    padding: 10px 15px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a3a6a;
    margin: 0;
}

.settings-item label {
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
}

.settings-item label:hover {
    color: #1a3a6a;
}

/* Stile per la data dell'ultimo evento */
.cliente-ultimo-evento {
    color: #1a3a6a;
    font-size: 0.75rem;
    background: #e8f0ff;
    padding: 2px 10px;
    border-radius: 3px;
    white-space: nowrap;
    border: 1px solid #1a3a6a;
}

.notifications-dropdown.show {
    display: block !important;
}

/* Aggiungi a style.css */
#nuovaNotaTesto {
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 38px;
    transition: height 0.1s ease;
}

#nuovaNotaTesto:focus {
    border-color: #1a3a6a;
    border-top-color: #1a3a6a;
    border-left-color: #1a3a6a;
}

/* ==================== QUADRATINI COLORATI PER EVIDENZIAZIONE ==================== */
.color-btn {
    transition: all 0.15s ease;
    border-radius: 2px;
}

.color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
    z-index: 2;
    position: relative;
}

.color-btn:active {
    transform: scale(0.9);
}

.color-btn[data-format="clear"]:hover {
    background: #f0f0f0;
    border-color: #888;
}

/* ==================== TOP CLIENTI, PRODOTTI, OPERATORI ==================== */
#topClientiList,
#topProdottiList,
#topOperatoriList {
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #f0f0f0;
}

#topClientiList::-webkit-scrollbar,
#topProdottiList::-webkit-scrollbar,
#topOperatoriList::-webkit-scrollbar {
    width: 4px;
}

#topClientiList::-webkit-scrollbar-track,
#topProdottiList::-webkit-scrollbar-track,
#topOperatoriList::-webkit-scrollbar-track {
    background: #f0f0f0;
}

#topClientiList::-webkit-scrollbar-thumb,
#topProdottiList::-webkit-scrollbar-thumb,
#topOperatoriList::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 2px;
}

#topClientiList > div:hover,
#topProdottiList > div:hover,
#topOperatoriList > div:hover {
    background: #f8faff;
}

/* Aggiungi queste regole a style.css dopo la sezione trend chart */

/* Trend Chart - correzione dimensioni */
#trendClientiChart,
#trendOrdiniChart {
    min-height: 120px;
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 6px;
}

#trendClientiChart svg,
#trendOrdiniChart svg {
    width: 100%;
    height: auto;
    display: block;
}

#trendClientiChart rect,
#trendOrdiniChart rect {
    transition: opacity 0.2s;
    cursor: pointer;
}

#trendClientiChart rect:hover,
#trendOrdiniChart rect:hover {
    opacity: 1 !important;
}

/* Card stats avanzate */
#statsAvanzate .stat-card {
    padding: 14px 16px;
    min-height: 100px;
}

#statsAvanzate .stat-card h3 {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

#statsAvanzate .stat-card .stat-totale {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a3a6a;
}

#statsAvanzate .stat-card .stat-stati {
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
}

/* Metriche dashboard */
#dashboardMetrics .stat-card {
    padding: 10px 14px;
    min-height: 70px;
}

#dashboardMetrics .stat-card:hover {
    border-color: #1a3a6a;
    background: #f8faff;
}

#dashboardMetrics .stat-card .stat-totale {
    font-size: 1.4rem;
    font-weight: 700;
}

/* Trend Chart - correzione dimensioni */
#trendOrdiniGiornalieriChart,
#trendOrdiniMensiliChart {
    min-height: 120px;
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 6px;
}

#trendOrdiniGiornalieriChart svg,
#trendOrdiniMensiliChart svg {
    width: 100%;
    height: auto;
    display: block;
}

#trendOrdiniGiornalieriChart rect,
#trendOrdiniMensiliChart rect {
    transition: opacity 0.2s;
    cursor: pointer;
}

#trendOrdiniGiornalieriChart rect:hover,
#trendOrdiniMensiliChart rect:hover {
    opacity: 1 !important;
}

#trendOrdiniMensiliChart,
#trendOrdiniGiornalieriChart {
    min-height: 160px !important;
    padding-top: 8px;
}

#trendOrdiniMensiliChart svg,
#trendOrdiniGiornalieriChart svg {
    display: block;
    width: 100%;
    height: auto;
}