/* Gestnico */

/* Import Google Fonts - Postman style */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette colori blu elettrico - Postman inspired */
    --electric-blue-light: #3b82f6;
    --electric-blue: #1d4ed8;
    --electric-blue-dark: #1e3a8a;
    --electric-blue-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 50%, #1e3a8a 100%);
    
    /* Postman color scheme con blu elettrico */
    --primary: var(--electric-blue);
    --primary-hover: var(--electric-blue-dark);
    --secondary: #f8f9fa;
    --accent: var(--electric-blue-light);
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Grigi Postman-style */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    /* Sfondo e testo Postman-style */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --text-primary: #212121;
    --text-secondary: #616161;
    --text-muted: #9e9e9e;
    
    /* Bordi sottili Postman-style */
    --border-light: #e0e0e0;
    --border-medium: #bdbdbd;
    --border-dark: #757575;
    
    /* Ombre sottili Postman-style */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    
    /* Spaziatura precisa Postman-style */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    
    /* Border radius sottili */
    --radius-sm: 2px;
    --radius: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    /* Font sizes Postman-style */
    --font-xs: 13px;
    --font-sm: 15px;
    --font-base: 15px;
    --font-md: 16px;
    --font-lg: 18px;
    --font-xl: 20px;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-base);
    line-height: 1.5;
    min-height: 100vh;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Griglia/puntini leggermente più marcata con gradiente verso basso-destra */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Gradiente di opacità verso basso-destra */ 
        linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.08) 50%, rgba(59, 130, 246, 0.18) 100%), 
        /* Puntini più visibili */ 
        radial-gradient(circle, rgb(207 207 207 / 15%) 1px, transparent 1px);
    background-size: 
        100% 100%,
        20px 20px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

.mobile-only {
    display: none;
}
.desktop-only {
    display: block;
}

/* Container principale */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Header Postman-style */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.footer {
    font-size: 12px;
    text-align: right;
    color: var(--gray-600);
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    min-height: 56px;
}

.logo {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    font-family: 'Source Sans Pro', sans-serif;
    text-decoration: none;
}

.logo .logo-img {
    width: 170px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.user-info-mobile {
    display: none; /* Hidden on desktop */
}

.user-info .badge {
    background: var(--electric-blue-gradient);
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-logout {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    border: none;
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Navigation moderna */
.nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-4);
    padding: var(--space-3) 0;
}

.nav-list {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: var(--space-2);
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 6px var(--space-3);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-sm);
    font-family: 'Source Sans Pro', sans-serif;
    transition: all 0.15s ease;
    border-radius: 16px; /* Pill shape */
    border: 1px solid transparent;
    white-space: nowrap;
    min-height: 28px;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Main content */
.main {
    padding: var(--space-4) 0 var(--space-20) 0;
    min-height: calc(100vh - 200px);
}

/* Cards Postman-style */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-4);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--bg-secondary);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.card-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    font-family: 'Source Sans Pro', sans-serif;
}

.card-title svg {
    width: 20px;
    height: 20px;
    margin-right: var(--space-2);
    fill: var(--primary);
}

.card-body {
    padding: var(--space-4);
}

/* Stats grid Postman-style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    padding: var(--space-4);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.stat-card:hover {
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 32px;
    height: 32px;
    padding: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}

.stat-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Forms Postman-style */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-sm);
    font-family: 'Source Sans Pro', sans-serif;
}

.form-control {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: var(--font-base);
    font-family: 'Source Sans Pro', sans-serif;
    transition: all 0.15s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02), 0 0 0 1px var(--primary);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

/* Buttons Postman-style pills */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px var(--space-3);
    border: 1px solid transparent;
    border-radius: 16px; /* Pill shape */
    font-size: var(--font-sm);
    font-weight: 500;
    font-family: 'Source Sans Pro', sans-serif;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 28px;
    line-height: 1.2;
    white-space: nowrap;
    margin: 2px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--border-medium);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 4px var(--space-2);
    font-size: var(--font-xs);
    min-height: 24px;
    border-radius: 12px;
}

.btn-lg {
    padding: 8px var(--space-4);
    font-size: var(--font-md);
    min-height: 36px;
    border-radius: 18px;
}

/* Button groups for dashboard */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-4) 0;
}

/* Dashboard actions area */
.dashboard-actions {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-light);
}

.dashboard-actions .btn-group {
    margin: 0;
    gap: var(--space-3);
}

.dashboard-actions h3 {
    font-size: var(--font-md);
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background: #2e7d32;
    border-color: #2e7d32;
}

.btn-warning {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

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

.btn-info {
    background: var(--info);
    color: white;
    border-color: var(--info);
}

.btn-info:hover {
    background: #0288d1;
    border-color: #0288d1;
}

/* Action buttons for tables - extra small pills */
.btn-action {
    padding: 3px 8px;
    font-size: 10px;
    min-height: 20px;
    border-radius: 10px;
    margin: 1px;
}

/* Tables Postman-style */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    background: var(--bg-primary);
    font-size: var(--font-base);
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-family: 'Source Sans Pro', sans-serif;
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-sm);
    border-bottom: 1px solid var(--border-medium);
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges Postman-style - Balanced visibility */
.status-badge {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 600;
    font-family: 'Source Sans Pro', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    border: 1.5px solid;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    line-height: 1;
}

.status-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-to-do {
    background: #fff8e1;
    color: #ff8f00;
    border-color: #ffcc02;
}

.status-in-progress {
    background: #e3f2fd;
    color: var(--primary);
    border-color: var(--primary);
}

.status-suspended {
    background: #ffebee;
    color: #d32f2f;
    border-color: #f44336;
}

.status-done {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
}

/* Action buttons */
.actions {
    display: flex;
    gap: var(--space-2);
}

/* Intervention actions specific styles */
.intervention-card .actions {
    flex-grow: 1;
    flex-direction: row;
    justify-content: flex-end;
    margin-top: var(--space-2);
}

.intervention-card .actions .btn {
    white-space: nowrap;
    font-weight: 500;
}

/* Table actions */
.table .actions {
    justify-content: start;
    gap: var(--space-1);
}

.table .actions .btn {
    white-space: nowrap;
    font-weight: 500;
}

/* Button disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button focus state for accessibility */
.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat-style notes moderne */
.notes-container {
    max-height: 500px;
    overflow-y: auto;
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    backdrop-filter: blur(10px);
}

.note-item {
    background: white;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    border-left: 4px solid var(--electric-blue);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.note-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.note-text {
    color: var(--text-primary);
    line-height: 1.6;
}

/* Alert messages moderne */
.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    border-left: 4px solid;
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-left-color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-left-color: var(--danger);
}

/* Toggle sections moderne */
.toggle-section {
    margin-top: var(--space-6);
}

.toggle-btn {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border: 1px solid var(--gray-300);
    color: var(--primary);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.toggle-btn:hover {
    background: var(--electric-blue-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.toggle-content {
    display: none;
    margin-top: var(--space-6);
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toggle-content.show {
    display: block;
}

/* Responsive Design moderno */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    .desktop-only {
        display: none;
    }
    .container {
        margin: 0;
        padding: 0 var(--space-4);
    }
    
    /* Compact mobile header */
    .header-content {
        flex-direction: row;
        gap: var(--space-2);
        padding: var(--space-2) 0;
        align-items: center;
        justify-content: space-between;
    }
    
    .logo {
        font-size: var(--font-md);
        gap: var(--space-1);
    }
    
    .logo svg {
        width: 20px;
        height: 20px;
    }
    
    .user-menu {
        gap: var(--space-2);
    }
    
    .user-info {
        display: none; /* Hide full user info on mobile */
    }
    
    /* Show just user initials on mobile */
    .user-info-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background: var(--primary);
        color: white;
        border-radius: 50%;
        font-size: var(--font-xs);
        font-weight: 600;
    }
    
    .btn-logout {
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-xs);
        border-radius: var(--radius);
        min-height: 28px;
    }
    
    /* Hide desktop nav on mobile */
    .nav {
        display: none;
    }
    
    /* Mobile bottom navigation */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-light);
        z-index: 100;
        padding: var(--space-2);
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    }
    
    .mobile-nav-list {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
        justify-content: space-around;
    }
    
    .mobile-nav-item {
        flex: 1;
    }
    
    .mobile-nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: var(--space-2);
        color: var(--text-muted);
        text-decoration: none;
        font-size: var(--font-xs);
        font-weight: 500;
        transition: all 0.15s ease;
        border-radius: var(--radius);
    }
    
    .mobile-nav-link.active {
        color: var(--primary);
        background: rgba(59, 130, 246, 0.05);
    }
    
    .mobile-nav-link:hover {
        color: var(--primary);
    }
    
    .mobile-nav-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 2px;
        fill: currentColor;
    }
    
    .mobile-nav-text {
        font-size: 10px;
        line-height: 1;
    }
    
    /* Add bottom padding to main content to avoid overlap */
    .main {
        padding-bottom: 80px;
        padding-top: var(--space-2); /* Reduce top padding since header is smaller */
        display: flex;
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--space-2);
        margin-bottom: var(--space-3);
    }
    
    /* Quick actions mobile optimization */
    .quick-actions-card {
        order: -1; /* Move quick actions before interventions list on mobile */
        margin-bottom: var(--space-4);
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--space-2) !important;
    }
    
    .quick-action-btn {
        padding: var(--space-2) !important;
        font-size: var(--font-xs) !important;
        min-height: 60px !important;
    }
    
    .quick-action-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: var(--space-1);
        padding: var(--space-2);
        min-height: auto;
    }
    
    .stat-icon {
        margin: 0 auto;
        width: 24px;
        height: 24px;
        padding: 4px;
    }
    
    .stat-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .stat-number {
        font-size: var(--font-lg);
        margin-bottom: 2px;
    }
    
    .stat-label {
        font-size: var(--font-xs);
        line-height: 1.2;
    }
    
    .stat-label {
        font-size: var(--font-xs);
    }
    
    /* Intervention cards for mobile */
    .intervention-cards {
        display: block;
    }
    
    .intervention-card {
        background: var(--bg-primary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius);
        padding: var(--space-3);
        margin-bottom: var(--space-3);
        box-shadow: var(--shadow-sm);
    }
    
    .intervention-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: var(--space-2);
        gap: var(--space-2);
    }
    
    /* Compact status badges on mobile */
    .intervention-card .status-badge {
        padding: var(--space-1) 6px;
        font-size: 9px;
        letter-spacing: 0.2px;
        flex-shrink: 0;
        min-width: fit-content;
    }
    
    .intervention-card .status-badge::before {
        width: 4px;
        height: 4px;
    }
    
    .intervention-card-title {
        font-weight: 600;
        font-size: var(--font-sm);
        color: var(--text-primary);
        margin-bottom: 2px;
    }

    .intervention-card .actions .btn {
        white-space: nowrap;
        font-weight: 500;
        padding: 10px;
    }
    
    .intervention-card-subtitle {
        font-size: var(--font-xs);
        color: var(--text-muted);
    }
    
    .intervention-card-body {
        margin-bottom: var(--space-3);
    }
    
    .intervention-card-footer {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    .intervention-meta {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .intervention-meta-item {
        font-size: var(--font-xs);
        color: var(--text-secondary);
    }
    
    /* Hide table on mobile */
    .table-responsive {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }

    .form-actions svg {
        width: 24px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: var(--space-2);
    }
    
    .card-header,
    .card-body {
        padding: var(--space-4);
    }
    
    .stat-number {
        font-size: var(--font-lg);
    }

    .form-group {
        margin-bottom: var(--space-1);
    }
    
    /* Page actions mobile styles */
    .page-actions {
        width: 100%;
    }
    
    .date-filter-group input[type="date"] {
        min-width: 120px;
        font-size: var(--font-sm);
    }
    
    .date-filter-group button {
        min-width: 80px;
        font-size: var(--font-xs);
        padding: 4px var(--space-2);
    }
}

/* Desktop: hide mobile intervention cards */
@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
    
    .intervention-cards {
        display: none;
    }
}

/* Utilities moderne */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: var(--space-20); }
.mb-20 { margin-bottom: var(--space-20); }
.p-20 { padding: var(--space-20); }

/* Animazioni moderne */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Aggiunta di un terzo layer per effetto tridimensionale */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Scrollbar moderna */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Focus states Postman-style */
*:focus {
    outline: 1px solid var(--primary);
    outline-offset: 1px;
}

/* Utility classes Postman-style */
.text-xs { font-size: var(--font-xs); }
.text-sm { font-size: var(--font-sm); }
.text-base { font-size: var(--font-base); }
.text-md { font-size: var(--font-md); }
.text-lg { font-size: var(--font-lg); }
.text-xl { font-size: var(--font-xl); }

.font-mono { font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace; }
.font-sans { font-family: 'Source Sans Pro', sans-serif; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }

.bg-light { background-color: var(--bg-secondary); }
.bg-white { background-color: var(--bg-primary); }

.border { border: 1px solid var(--border-light); }
.border-0 { border: none; }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Code blocks Postman-style */
.code-block {
    background: #f8f9fa;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--space-3);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-sm);
    overflow-x: auto;
}

.inline-code {
    background: #f8f9fa;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 2px var(--space-1);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-xs);
}

/* Interventions Grid Layout */
.interventions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.intervention-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.intervention-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.intervention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.intervention-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.intervention-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.intervention-issue {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    line-height: 1.4;
}

.intervention-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Technicians Grid Layout */
.technicians-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.technician-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.technician-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.technician-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.technician-avatar, .admin-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--electric-blue-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-sm);
}

.technician-name, .admin-name {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.technician-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.detail-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.technician-stats {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-light);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    display: block;
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* Admins Grid Layout */
.admins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.admin-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.admin-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.admin-badge {
    display: inline-block;
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 500;
    margin-left: var(--space-2);
}

.admin-badge.current-user {
    background: var(--electric-blue);
    color: white;
}

.admin-badge.technician {
    background: var(--success);
    color: white;
}

/* Detail Layouts */
.intervention-detail-layout,
.technician-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-6);
    margin-top: var(--space-4);
}

.intervention-main-info,
.technician-main-info {
    min-width: 0;
}

.intervention-sidebar,
.technician-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.card-title-with-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.technician-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.technician-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--electric-blue-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-lg);
}

.technician-role {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin: 0;
}

/* Statistics Layouts */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stats-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    box-shadow: var(--shadow-sm);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stats-icon.to_do {
    background: var(--warning);
}

.stats-icon.to_return {
    background: var(--info);
}

.stats-icon.cancelled {
    background: var(--danger);
}

.stats-icon.done {
    background: var(--success);
}

.stats-icon svg {
    width: 24px;
    height: 24px;
}

.stats-value {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stats-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.statistics-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-6);
    margin-top: var(--space-4);
}

.statistics-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.statistics-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Filters */
.filters-card {
    margin-bottom: var(--space-4);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 500;
}

.status-badge.status-to_do {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-to_return {
    background: #bfdbfe;
    color: #1e40af;
}

.status-badge.status-cancelled {
    background: #fecaca;
    color: #b91c1c;
}

.status-badge.status-done {
    background: #bbf7d0;
    color: #065f46;
}

/* Notes and Timeline */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.note-item {
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.note-type {
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 500;
}

.note-type-suspension {
    background: #fecaca;
    color: #b91c1c;
}

.note-type-closure {
    background: #bbf7d0;
    color: #065f46;
}

.note-type-status_change {
    background: #bfdbfe;
    color: #1e40af;
}

.note-date {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.note-content {
    font-size: var(--font-sm);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.note-author {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    font-style: italic;
}

.status-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.timeline-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-marker.status-to_do {
    background: var(--warning);
}

.timeline-marker.status-to_return {
    background: var(--info);
}

.timeline-marker.status-cancelled {
    background: var(--danger);
}

.timeline-marker.status-done {
    background: var(--success);
}

.timeline-content {
    flex: 1;
}

.timeline-status {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.timeline-date {
    font-size: var(--font-xs);
    color: var(--text-muted);
}
.timeline-note {
    font-size: 0.9em;
    color: #373737;
    /* font-style: italic; */
}

/* Completion Bars */
.completion-rate {
    margin-top: var(--space-3);
}

.completion-rate-label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.completion-rate-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.completion-rate-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.completion-rate-value {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-top: var(--space-1);
    text-align: right;
}

.completion-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: var(--space-1);
}

.completion-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

/* Client/Technician Info */
.client-info, .technician-info {
    text-align: center;
}

.client-name, .technician-name {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.client-details, .technician-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.client-contact, .technician-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.client-contact svg, .technician-contact svg {
    width: 14px;
    height: 14px;
}

.no-technician {
    text-align: center;
    padding: var(--space-4);
    color: var(--text-muted);
}

.no-technician svg {
    width: 32px;
    height: 32px;
    margin-bottom: var(--space-2);
}

.no-technician p {
    margin-bottom: var(--space-3);
}

/* Performance Stats */
.technicians-performance {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.technician-stat {
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.technician-name {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.technician-metrics {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
}

.metric-label {
    display: block;
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* Quick Stats */
.quick-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.quick-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--electric-blue);
    color: white;
}

.quick-stat-icon.success {
    background: var(--success);
}

.quick-stat-icon.warning {
    background: var(--warning);
}

.quick-stat-icon.info {
    background: var(--info);
}

.quick-stat-icon svg {
    width: 16px;
    height: 16px;
}

.quick-stat-value {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.quick-stat-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

/* Interventions List */
.interventions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.intervention-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.intervention-details {
    flex: 1;
    min-width: 0;
}

.intervention-actions {
    flex-shrink: 0;
}

/* Info Sections */
.info-section {
    margin-top: var(--space-4);
}

.info-section-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.info-description {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.info-stat:last-child {
    border-bottom: none;
}

.info-stat-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.info-stat-value {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.admin-info-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.stats-row {
    display: flex;
    gap: var(--space-4);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.stat-card {
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-align: center;
    background: var(--bg-secondary);
}

.stat-card.success {
    border-color: var(--success);
    background: #f0fdf4;
}

.stat-card.warning {
    border-color: var(--warning);
    background: #fffbeb;
}

.stat-card.info {
    border-color: var(--info);
    background: #f0f9ff;
}

.stat-card.danger {
    border-color: var(--danger);
    background: #fef2f2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .intervention-detail-layout,
    .technician-detail-layout,
    .statistics-layout {
        grid-template-columns: 1fr;
    }
    
    .interventions-grid,
    .technicians-grid,
    .admins-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* === STILI AGGIUNTIVI PER INTERVENTI E GESTIONE === */

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--electric-blue-light) 100%);
    color: white;
    padding: var(--space-6) var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-lg);
}

.welcome-content {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.welcome-title {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.welcome-title svg {
    width: 28px;
    height: 28px;
}

.welcome-subtitle {
    font-size: var(--font-base);
    opacity: 0.9;
    margin-bottom: var(--space-3);
    line-height: 1.5;
}

.welcome-meta {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    font-size: var(--font-sm);
    opacity: 0.8;
    margin-bottom: var(--space-4);
}

.welcome-date,
.welcome-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.welcome-date svg,
.welcome-user svg {
    width: 16px;
    height: 16px;
}

/* Welcome Stats */
.welcome-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin: var(--space-4) 0 var(--space-3) 0;
    padding: var(--space-3) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-stat-item {
    text-align: center;
}

.welcome-stat-number {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.welcome-stat-label {
    font-size: var(--font-xs);
    opacity: 0.8;
    line-height: 1.2;
}

/* Welcome Actions */
.welcome-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.welcome-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: var(--font-xs);
    font-weight: 500;
    min-height: 60px;
    justify-content: center;
}

.welcome-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.welcome-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Desktop Large Optimization */
@media (min-width: 1024px) {
    .welcome-section {
        padding: var(--space-5) var(--space-8);
    }
    
    .welcome-content {
        max-width: 1200px;
    }
    
    .welcome-title {
        font-size: var(--font-2xl);
        margin-bottom: var(--space-3);
    }
    
    .welcome-title svg {
        width: 32px;
        height: 32px;
    }
    
    .welcome-subtitle {
        font-size: var(--font-lg);
        margin-bottom: var(--space-4);
    }
    
    .welcome-meta {
        margin-bottom: var(--space-5);
    }
    
    .welcome-stats {
        margin: var(--space-5) 0 var(--space-4) 0;
        padding: var(--space-4) 0;
    }
    
    .welcome-stat-number {
        font-size: var(--font-2xl);
    }
    
    .welcome-stat-label {
        font-size: var(--font-sm);
    }
    
    .welcome-actions {
        gap: var(--space-3);
        margin-top: var(--space-4);
    }
    
    .welcome-action-btn {
        padding: var(--space-3);
        gap: var(--space-2);
        font-size: var(--font-sm);
        min-height: 80px;
    }
    
    .welcome-action-btn svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 768px) {
    .welcome-section {
        padding: var(--space-6) var(--space-4);
        margin-bottom: var(--space-4);
    }
    
    .welcome-title {
        font-size: var(--font-xl);
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .welcome-title svg {
        width: 28px;
        height: 28px;
    }
    
    .welcome-subtitle {
        font-size: var(--font-base);
    }
    
    .welcome-meta {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .welcome-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
        margin: var(--space-4) 0;
    }
    
    .welcome-stat-number {
        font-size: var(--font-xl);
    }
    
    .welcome-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }
    
    .welcome-action-btn {
        padding: var(--space-2);
        font-size: var(--font-xs);
    }
    
    .welcome-action-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.page-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.page-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.date-filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (min-width: 768px) {
    .page-actions {
        flex-direction: row;
        align-items: center;
        gap: var(--space-4);
    }
    
    .date-filter-group {
        flex: 1;
        justify-content: flex-end;
    }
}

/* Ensure date inputs are readable on mobile */
.date-filter-group input[type="date"] {
    min-width: 130px;
    flex: 1;
}

.date-filter-group button {
    flex-shrink: 0;
    min-width: 80px;
}

.page-title svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.page-actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

/* Card Grid System */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.intervention-card,
.technician-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

.intervention-card:hover,
.technician-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.card-content {
    padding: var(--space-5);
}

.card-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.card-subtitle {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.card-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-sm);
}

.card-info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.card-info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.card-actions {
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}

/* Dropdown Actions */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
    color: var(--text-secondary);
}

.dropdown-toggle:hover {
    background-color: var(--gray-100);
    color: var(--text-primary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: var(--text-primary);
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: var(--font-sm);
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    text-decoration: none;
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
}

/* Filters Section */
.filters {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-6);
}

.filters-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filters-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    align-items: end;
}

/* Timeline Component */
.timeline {
    position: relative;
    padding-left: var(--space-8);
    margin-top: var(--space-4);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-6);
}

.timeline-content {
    background: var(--bg-primary);
    padding: var(--space-4);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.timeline-date {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.timeline-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.timeline-description {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    margin-top: var(--space-4);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-sm);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-xl);
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--gray-100);
}

.modal-body {
    padding: var(--space-5);
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
    color: var(--success-color);
}

.empty-state h3 {
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

/* Interventions Summary */
.interventions-summary {
    background: var(--bg-secondary);
    padding: var(--space-3);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .interventions-summary {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }
    
    .interventions-summary > div {
        flex-direction: column;
        gap: var(--space-1);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 1;
}

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

/* Client Search */
.client-search {
    position: relative;
}

.client-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.client-search-results.active {
    display: block;
}

.client-search-item {
    padding: var(--space-3);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.client-search-item:hover {
    background: var(--bg-secondary);
}

.client-search-item:last-child {
    border-bottom: none;
}

.client-search-name {
    font-weight: 600;
    color: var(--text-primary);
}

.client-search-details {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
    }
    
    .page-actions {
        justify-content: stretch;
    }

    .page-actions svg {
        width: 24px;
    }
    
    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        font-size: var(--font-sm);
    }
    
    .table th,
    .table td {
        padding: var(--space-2) var(--space-3);
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .dropdown-menu {
        position: fixed;
        bottom: var(--space-4);
        left: var(--space-4);
        right: var(--space-4);
        top: auto;
    }
    
    .modal-content {
        margin: var(--space-4);
        width: calc(100% - var(--space-8));
        max-height: calc(100vh - var(--space-8));
    }
}

@media (max-width: 480px) {
    .timeline {
        padding-left: var(--space-6);
    }
    
    .timeline::before {
        left: 11px;
    }
    
    .timeline-item::before {
        left: -18px;
        width: 8px;
        height: 8px;
    }
    
    .modal-body {
        padding: var(--space-4);
    }
    
    .card-content {
        padding: var(--space-4);
    }
}

/* Paginazione */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-6);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border-light);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.pagination-links nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pagination-links .pagination {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: var(--space-2) var(--space-3);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-primary);
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all 0.15s ease;
}

.pagination .page-link:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-color: var(--border-light);
    cursor: not-allowed;
}

.pagination .page-item.disabled .page-link:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-muted);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }
    
    .pagination-info {
        order: 2;
    }
    
    .pagination-links {
        order: 1;
    }
    
    .pagination .page-link {
        min-width: 32px;
        height: 32px;
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-xs);
    }
}

/* Stili per interventi completati */
.intervention-card[data-status="4_done"],
.table tbody tr[data-status="4_done"] {
    opacity: 0.7;
    background: var(--bg-secondary);
}

.intervention-card[data-status="4_done"] {
    border-color: var(--border-light);
}

.intervention-card[data-status="4_done"] .intervention-card-title,
.table tbody tr[data-status="4_done"] td {
    color: var(--text-secondary);
}

/* Separatore visuale tra interventi attivi e completati */
.intervention-card[data-status="4_done"]:first-of-type {
    margin-top: var(--space-6);
    border-top: 2px solid var(--border-medium);
    padding-top: var(--space-4);
}

.table tbody tr[data-status="4_done"]:first-of-type td {
    border-top: 2px solid var(--border-medium);
    padding-top: var(--space-4);
}

/* Autocompletamento città */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: var(--space-3);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--bg-secondary);
    color: var(--primary);
}

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

.autocomplete-city {
    font-weight: 500;
    color: var(--text-primary);
}

.autocomplete-province {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-left: var(--space-2);
}

.autocomplete-region {
    font-size: var(--font-xs);
    color: var(--text-muted);
    display: block;
    margin-top: var(--space-1);
}

/* Stili per la timeline degli stati - VERSIONE MIGLIORATA */
.status-timeline {
    position: relative;
    padding: 20px 0;
    border-left: 2px solid #ccc;
    margin-left: 20px;
}

.timeline-item {
    position: relative;
    padding-left: 5px;
    margin-bottom: 25px;
    margin-left: 0;
}

.timeline-item:last-child {
    margin-bottom: 0;
    border-left: 3px solid transparent;
}

.timeline-item:last-child::after {
    content: '';
    position: absolute;
    left: -3px;
    top: 35px;
    width: 3px;
    height: calc(100% - 35px);
    background: transparent;
}

.timeline-marker-dot {
    position: absolute;
    left: -12px;
    top: 16px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #6c757d;
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px #e9ecef;
    z-index: 2;
}

.timeline-item-current .timeline-marker-dot {
    background-color: #28a745;
    box-shadow: 0 0 0 2px #d4edda;
    border-color: #fff;
}

.timeline-content {
    padding: 12px 10px;
    min-height: 35px;
}

.timeline-status {
    margin-bottom: 8px;
}

.timeline-status .status-badge {
    font-size: 0.85em;
    padding: 4px 8px;
}

.timeline-date {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 4px;
}

.timeline-user {
    font-size: 0.8em;
    color: #6c757d;
    font-style: italic;
}

/* Stili per le note */
.note-item {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
}

.note-item.technical {
    border-left-color: #28a745;
}

.note-item.client {
    border-left-color: #ffc107;
}

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

.note-type {
    background-color: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    text-transform: uppercase;
}

.note-type.technical {
    background-color: #28a745;
}

.note-type.client {
    background-color: #ffc107;
    color: #212529;
}

.note-meta {
    font-size: 0.85em;
    color: #6c757d;
}

.note-content {
    line-height: 1.5;
    margin-bottom: 0;
}

/* Stili modal note */
.modal-textarea {
    min-height: 120px;
    resize: vertical;
}

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

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 10px 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive timeline */
@media (max-width: 768px) {
    .timeline-item {
        padding-left: 25px;
    }
    
    .timeline-dot {
        left: -6px;
        width: 10px;
        height: 10px;
        box-shadow: 0 0 0 2px #e9ecef;
    }
    
    .timeline-content {
        padding: 8px 12px;
    }
    
    .timeline-status {
        font-size: 0.9em;
    }
    
    .timeline-meta {
        font-size: 0.8em;
    }
}

/* Agenda Scheduler Modal - Timeline Style */
.agenda-timeline {
    background: white;
    margin-bottom: 20px;
}

.agenda-timeline h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.schedule-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.date-quick-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.date-btn {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.timeline-wrapper {
    overflow-x: auto;
    margin-left: -17px;
    margin-right: -17px;
}

.timeline-container {
    min-width: 1000px;
}

.date-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.date-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.date-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.timeline-header {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.timeline-label {
    width: 200px;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-right: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-hours {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(13, 1fr);
}

.hour-label {
    padding: 12px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border-right: 1px solid var(--gray-200);
}

.hour-label:last-child {
    border-right: none;
}

.timeline-grid {
    border: 1px solid var(--gray-200);
    border-top: none;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    height: 100%;
}

/* Stile per le celle delle ore nella griglia */
.timeline-grid .timeline-cell {
    border-right: 1px solid var(--gray-50);
    background: var(--bg-primary);
    min-height: 35px;
    position: relative;
}

.timeline-grid .timeline-cell:last-child {
    border-right: none;
}

/* Aggiungi indicatori delle ore */
.timeline-grid .timeline-cell[data-hour]::before {
    content: attr(data-hour) ":00";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 4px;
    border: 1px solid var(--gray-200);
    border-radius: 3px;
    z-index: 10;
}

.timeline-row {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
}

.timeline-row:last-child {
    border-bottom: none;
}

.technician-label {
    width: 200px;
    padding: 16px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.technician-label strong {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.technician-label small {
    font-size: 12px;
    color: var(--text-secondary);
}

.timeline-bar {
    flex: 1;
    min-height: 60px;
}

.timeline-cell {
    border-right: 1px solid var(--gray-200);
    position: relative;
    background: white;
    transition: background-color 0.2s ease;
}

.timeline-cell:last-child {
    border-right: none;
}

.timeline-cell.occupied {
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px;
    overflow: hidden;
    position: relative;
}

.timeline-cell.occupied.multiple {
    background: var(--warning);
    color: var(--text-primary);
}

.intervention-block {
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    width: 100%;
    overflow: hidden;
}

.intervention-block .client-city {
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-size: 11px;
}

.intervention-block .intervention-time {
    font-size: 10px;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
}

.timeline-cell:hover {
    background: var(--bg-tertiary);
}

.timeline-cell.occupied:hover {
    background: var(--primary-hover);
}

.timeline-cell.occupied.multiple:hover {
    background: #e6a700;
}

/* Stili per interventi sovrapposti */
.timeline-cell.overlapped {
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.2);
    background: var(--accent);
    min-height: 40px;
}

.timeline-cell.overlapped:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
    z-index: 1000 !important;
}

/* Legenda */
.timeline-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.free {
    background: white;
    border: 1px solid var(--border-light);
}

.legend-color.occupied {
    background: var(--primary);
}

.legend-color.multiple {
    background: var(--warning);
}

/* Responsive timeline */
@media (max-width: 768px) {
    .schedule-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .date-quick-select {
        justify-content: center;
    }
    
    .date-btn {
        flex: 1;
        min-width: 0;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .timeline-label {
        width: 150px;
        padding: 8px 12px;
    }
    
    .technician-label {
        width: 150px;
        padding: 12px;
    }
    
    .technician-label strong {
        font-size: 12px;
    }
    
    .technician-label small {
        font-size: 10px;
    }
    
    .hour-label {
        padding: 8px 2px;
        font-size: 10px;
    }
    
    .timeline-bar {
        min-height: 50px;
    }
    
    .intervention-block {
        font-size: 9px;
    }
    
    .intervention-block .intervention-time {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .date-btn {
        font-size: 10px;
        padding: 4px 6px;
    }
    
    .timeline-label {
        width: 120px;
        font-size: 12px;
    }
    
    .technician-label {
        width: 120px;
    }
    
    .hour-label {
        font-size: 9px;
        padding: 6px 1px;
    }
    
    .timeline-cell {
        min-height: 40px;
    }
}

/* Animazioni */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-row {
    animation: slideIn 0.3s ease-out;
}