/* Material Design 3 (Material You) - Dashboard System */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Roboto+Flex:wght@300;400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Round');

:root {
    /* Material 3 - Color System (Dynamic Color Tokens) */
    /* Primary Palette - Green Theme */
    --md-sys-color-primary: #4CAF50;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #C8E6C9;
    --md-sys-color-on-primary-container: #1B5E20;
    
    /* Secondary Palette */
    --md-sys-color-secondary: #5F6368;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E0F2F1;
    --md-sys-color-on-secondary-container: #1A4D43;
    
    /* Tertiary Palette */
    --md-sys-color-tertiary: #0097A7;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #B2EBF2;
    --md-sys-color-on-tertiary-container: #004D57;
    
    /* Error Palette */
    --md-sys-color-error: #B3261E;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #F9DEDC;
    --md-sys-color-on-error-container: #410E0B;
    
    /* Surface & Background */
    --md-sys-color-surface: #FAFAFA;
    --md-sys-color-on-surface: #1C1B1F;
    --md-sys-color-surface-variant: #E0E0E0;
    --md-sys-color-on-surface-variant: #424242;
    --md-sys-color-background: #FAFAFA;
    --md-sys-color-on-background: #1C1B1F;
    
    /* Surface Containers */
    --md-sys-color-surface-container-lowest: #FFFFFF;
    --md-sys-color-surface-container-low: #F5F5F5;
    --md-sys-color-surface-container: #EEEEEE;
    --md-sys-color-surface-container-high: #E8E8E8;
    --md-sys-color-surface-container-highest: #E0E0E0;
    
    /* Outline */
    --md-sys-color-outline: #757575;
    --md-sys-color-outline-variant: #BDBDBD;
    
    /* Success (Custom) */
    --md-sys-color-success: #2E7D32;
    --md-sys-color-on-success: #FFFFFF;
    --md-sys-color-success-container: #C8E6C9;
    
    /* Warning (Custom) */
    --md-sys-color-warning: #F57C00;
    --md-sys-color-on-warning: #FFFFFF;
    --md-sys-color-warning-container: #FFE0B2;
    
    /* Info (Custom) */
    --md-sys-color-info: #0288D1;
    --md-sys-color-on-info: #FFFFFF;
    --md-sys-color-info-container: #B3E5FC;
    
    /* Material 3 - Elevation (Shadows) */
    --md-sys-elevation-level0: none;
    --md-sys-elevation-level1: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level2: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-level4: 0px 6px 10px 4px rgba(0, 0, 0, 0.15), 0px 2px 3px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-level5: 0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px rgba(0, 0, 0, 0.3);
    
    /* Material 3 - Shape (Border Radius) */
    --md-sys-shape-corner-none: 0px;
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    --md-sys-shape-corner-full: 9999px;
    
    /* Material 3 - Motion (Easing) */
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
    --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
    --md-sys-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
    --md-sys-motion-easing-legacy: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Material 3 - Duration */
    --md-sys-motion-duration-short1: 50ms;
    --md-sys-motion-duration-short2: 100ms;
    --md-sys-motion-duration-short3: 150ms;
    --md-sys-motion-duration-short4: 200ms;
    --md-sys-motion-duration-medium1: 250ms;
    --md-sys-motion-duration-medium2: 300ms;
    --md-sys-motion-duration-medium3: 350ms;
    --md-sys-motion-duration-medium4: 400ms;
    --md-sys-motion-duration-long1: 450ms;
    --md-sys-motion-duration-long2: 500ms;
    --md-sys-motion-duration-long3: 550ms;
    --md-sys-motion-duration-long4: 600ms;
    
    /* State Layers (Hover/Focus/Pressed) */
    --md-sys-state-hover-opacity: 0.08;
    --md-sys-state-focus-opacity: 0.12;
    --md-sys-state-pressed-opacity: 0.12;
    --md-sys-state-dragged-opacity: 0.16;
    
    /* Compatibility Variables (per componenti legacy) */
    --bg-primary: var(--md-sys-color-background);
    --bg-secondary: var(--md-sys-color-surface-container-low);
    --bg-card: var(--md-sys-color-surface-container);
    --bg-surface: var(--md-sys-color-surface-container-high);
    --text-primary: var(--md-sys-color-on-surface);
    --text-secondary: var(--md-sys-color-on-surface-variant);
    --text-muted: var(--md-sys-color-outline);
    --border-color: var(--md-sys-color-outline-variant);
    --color-accent-blue: var(--md-sys-color-primary);
    --color-accent-green: var(--md-sys-color-success);
    --color-accent-cyan: var(--md-sys-color-info);
    --shadow-sm: var(--md-sys-elevation-level1);
    --shadow-md: var(--md-sys-elevation-level2);
}

/* Dark Theme */
[data-theme="dark"] {
    /* Primary Palette - Green Theme */
    --md-sys-color-primary: #81C784;
    --md-sys-color-on-primary: #1B5E20;
    --md-sys-color-primary-container: #2E7D32;
    --md-sys-color-on-primary-container: #C8E6C9;
    
    /* Secondary Palette */
    --md-sys-color-secondary: #B0BEC5;
    --md-sys-color-on-secondary: #263238;
    --md-sys-color-secondary-container: #37474F;
    --md-sys-color-on-secondary-container: #E0F2F1;
    
    /* Tertiary Palette */
    --md-sys-color-tertiary: #4DD0E1;
    --md-sys-color-on-tertiary: #00363A;
    --md-sys-color-tertiary-container: #00838F;
    --md-sys-color-on-tertiary-container: #B2EBF2;
    
    /* Error Palette */
    --md-sys-color-error: #F2B8B5;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8C1D18;
    --md-sys-color-on-error-container: #F9DEDC;
    
    /* Surface & Background */
    --md-sys-color-surface: #1C1C1E;
    --md-sys-color-on-surface: #E5E5E7;
    --md-sys-color-surface-variant: #3A3A3C;
    --md-sys-color-on-surface-variant: #C7C7CC;
    --md-sys-color-background: #1C1C1E;
    --md-sys-color-on-background: #E5E5E7;
    
    /* Surface Containers */
    --md-sys-color-surface-container-lowest: #121212;
    --md-sys-color-surface-container-low: #1C1C1E;
    --md-sys-color-surface-container: #2C2C2E;
    --md-sys-color-surface-container-high: #3A3A3C;
    --md-sys-color-surface-container-highest: #48484A;
    
    /* Outline */
    --md-sys-color-outline: #8E8E93;
    --md-sys-color-outline-variant: #48484A;
    
    /* Success (Custom) */
    --md-sys-color-success: #81C784;
    --md-sys-color-on-success: #1B5E20;
    --md-sys-color-success-container: #2E7D32;
    
    /* Warning (Custom) */
    --md-sys-color-warning: #FFB74D;
    --md-sys-color-on-warning: #E65100;
    --md-sys-color-warning-container: #F57C00;
    
    /* Info (Custom) */
    --md-sys-color-info: #4FC3F7;
    --md-sys-color-on-info: #01579B;
    --md-sys-color-info-container: #0288D1;
    
    /* Compatibility Variables (per componenti legacy) */
    --bg-primary: var(--md-sys-color-background);
    --bg-secondary: var(--md-sys-color-surface-container-low);
    --bg-card: var(--md-sys-color-surface-container);
    --bg-surface: var(--md-sys-color-surface-container-high);
    --text-primary: var(--md-sys-color-on-surface);
    --text-secondary: var(--md-sys-color-on-surface-variant);
    --text-muted: var(--md-sys-color-outline);
    --border-color: var(--md-sys-color-outline-variant);
    --color-accent-blue: var(--md-sys-color-primary);
    --color-accent-green: var(--md-sys-color-success);
    --color-accent-cyan: var(--md-sys-color-info);
    --shadow-sm: var(--md-sys-elevation-level1);
    --shadow-md: var(--md-sys-elevation-level2);
    --shadow-lg: var(--md-sys-elevation-level3);
}

/* Material 3 - Typography Scale */
.md3-display-large {
    font-family: 'Roboto', sans-serif;
    font-size: 57px;
    font-weight: 400;
    line-height: 64px;
    letter-spacing: -0.25px;
}

.md3-display-medium {
    font-family: 'Roboto', sans-serif;
    font-size: 45px;
    font-weight: 400;
    line-height: 52px;
}

.md3-display-small {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 44px;
}

.md3-headline-large {
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 40px;
}

.md3-headline-medium {
    font-family: 'Roboto', sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 36px;
}

.md3-headline-small {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
}

.md3-title-large {
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
}

.md3-title-medium {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.15px;
}

.md3-title-small {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.1px;
}

.md3-body-large {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.5px;
}

.md3-body-medium {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.25px;
}

.md3-body-small {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    letter-spacing: 0.4px;
}

.md3-label-large {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.1px;
}

.md3-label-medium {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0.5px;
}

.md3-label-small {
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0.5px;
}

/* Global Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Material 3 - Theme Toggle (FAB) */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: none;
    border-radius: var(--md-sys-shape-corner-large);
    width: 56px;
    height: 56px;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-level3);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.theme-toggle:hover {
    box-shadow: var(--md-sys-elevation-level4);
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 92%, var(--md-sys-color-on-primary-container) 8%);
}

.theme-toggle:active {
    box-shadow: var(--md-sys-elevation-level3);
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 88%, var(--md-sys-color-on-primary-container) 12%);
}

.theme-toggle .material-icons-round {
    font-size: 24px;
}

/* Material 3 - Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   Material Design 3 - Top App Bar
   Spec: https://m3.material.io/components/top-app-bar
   ============================================ */

/* MD3 Top App Bar Container */
.md3-top-app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    min-height: 64px;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    margin-bottom: 24px;
    gap: 16px;
}

/* MD3 Top App Bar - Leading Section (Brand) */
.md3-top-app-bar-leading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.md3-top-app-bar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
}

.md3-top-app-bar-brand-icon {
    font-size: 28px;
}

.md3-top-app-bar-title {
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    letter-spacing: 0;
    margin: 0;
    color: var(--md-sys-color-on-surface);
}

/* MD3 Top App Bar - Trailing Actions */
.md3-top-app-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* MD3 Top App Bar - User Info Chip */
.md3-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--md-sys-color-surface-container-high);
    padding: 6px 16px 6px 8px;
    border-radius: var(--md-sys-shape-corner-full);
    transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.md3-user-chip:hover {
    background: var(--md-sys-color-surface-container-highest);
}

.md3-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
}

.md3-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
}

/* MD3 Icon Button (for Top App Bar actions) */
.md3-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.md3-icon-button .material-icons,
.md3-icon-button .material-icons-round {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.md3-icon-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-on-surface-variant);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short2);
}

.md3-icon-button:hover::before {
    opacity: var(--md-sys-state-hover-opacity);
}

.md3-icon-button:active::before {
    opacity: var(--md-sys-state-pressed-opacity);
}

/* MD3 Icon Button - Filled Variant */
.md3-icon-button-filled {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.md3-icon-button-filled::before {
    background: var(--md-sys-color-on-primary);
}

/* MD3 Icon Button - Text with Icon (for labeled buttons) */
.md3-icon-button-text {
    width: auto;
    padding: 8px 16px;
    gap: 8px;
}

.md3-icon-button-text .button-label {
    font-size: 14px;
    font-weight: 500;
}

/* MD3 Top App Bar - Action Buttons with Background */
.md3-top-app-bar-actions .md3-icon-button,
.md3-top-app-bar-actions .md3-icon-button-text {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
}

.md3-top-app-bar-actions .md3-icon-button::before,
.md3-top-app-bar-actions .md3-icon-button-text::before {
    background: var(--md-sys-color-on-surface);
}

.md3-top-app-bar-actions .md3-icon-button:hover,
.md3-top-app-bar-actions .md3-icon-button-text:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

/* MD3 Icon Button - Toggle State */
.md3-icon-button[aria-pressed="true"] {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

/* Legacy compatibility - keep old classes for existing HTML */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title h1 {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 40px;
    color: var(--md-sys-color-on-background);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--md-sys-color-surface-container);
    padding: 12px 20px;
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-level1);
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.user-info:hover {
    box-shadow: var(--md-sys-elevation-level2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
}

.appointments-visibility-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.appointments-visibility-toggle .material-icons,
.appointments-visibility-toggle .material-icons-round {
    font-size: 20px;
}

.appointments-visibility-toggle .toggle-label {
    font-weight: 500;
}

.appointments-visibility-toggle:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
    border-color: var(--md-sys-color-primary);
}

/* Material 3 - Navbar Clients Dropdown */
.navbar-clients-dropdown {
    position: relative;
}

.navbar-clients-btn {
    /* Dropdown button styling - inherits from .md3-icon-button */
    width: auto;
    padding: 8px 12px;
    gap: 4px;
}

.navbar-clients-btn .material-icons-round {
    font-size: 20px;
}

.navbar-clients-btn .dropdown-arrow {
    font-size: 20px;
    transition: transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.navbar-clients-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.navbar-clients-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    box-shadow: var(--md-sys-elevation-level2);
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.navbar-clients-menu.active {
    display: block;
    animation: menuSlideIn var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-decelerate);
}

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

.navbar-client-item {
    padding: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    cursor: pointer;
    transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    display: block;
}

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

.navbar-client-item:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

.client-item-name {
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.client-item-info {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    display: block;
}

/* Material 3 - Clients Search */
.clients-search-wrapper {
    padding: 12px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    position: sticky;
    top: 0;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium) var(--md-sys-shape-corner-medium) 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.clients-search-input {
    flex: 1;
    background: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
    padding: 10px 12px;
    border-radius: var(--md-sys-shape-corner-small);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 20px;
    transition: border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    outline: none;
}

.clients-search-input:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 9px 11px;
}

.clients-search-input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
}

.search-icon {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 20px;
}

.clients-list {
    max-height: 340px;
    overflow-y: auto;
}

.navbar-client-item.hidden {
    display: none;
}

/* Material 3 - Admin Client Filter Toggle */
/* 
   Utilizzo HTML:
   <div class="clients-filter-admin">
       <label class="clients-filter-admin-label" for="show-all-clients">
           <span class="material-icons-round">people</span>
           <span>Mostra tutti i clienti</span>
           <span class="clients-filter-count" id="total-clients">0</span>
       </label>
       <label class="md3-switch">
           <input type="checkbox" id="show-all-clients">
           <span class="md3-switch-track">
               <span class="md3-switch-thumb">
                   <span class="material-icons-round md3-switch-thumb-icon">check</span>
               </span>
           </span>
       </label>
   </div>
*/
.clients-filter-admin {
    padding: 12px 16px;
    background: var(--md-sys-color-surface-container);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clients-filter-admin-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    user-select: none;
}

.clients-filter-admin-label .material-icons,
.clients-filter-admin-label .material-icons-round {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
}

/* Material 3 - Switch Component */
.md3-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 32px;
}

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

.md3-switch-track {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--md-sys-color-surface-variant);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
}

.md3-switch-track:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-variant));
}

.md3-switch-thumb {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 6px;
    bottom: 6px;
    background: var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
    box-shadow: var(--md-sys-elevation-level1);
}

.md3-switch input:checked + .md3-switch-track {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.md3-switch input:checked + .md3-switch-track:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 92%, white 8%);
}

.md3-switch input:checked + .md3-switch-track .md3-switch-thumb {
    background: var(--md-sys-color-on-primary);
    transform: translateX(20px);
    width: 24px;
    height: 24px;
    left: 4px;
    bottom: 2px;
}

.md3-switch input:focus + .md3-switch-track {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
}

.md3-switch input:disabled + .md3-switch-track {
    opacity: 0.38;
    cursor: not-allowed;
}

.md3-switch input:disabled + .md3-switch-track:hover {
    background: var(--md-sys-color-surface-variant);
}

/* Switch con icone (opzionale) */
.md3-switch-thumb-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: var(--md-sys-color-surface-container-highest);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short2);
}

.md3-switch input:checked + .md3-switch-track .md3-switch-thumb-icon {
    opacity: 1;
    color: var(--md-sys-color-primary);
}

.clients-filter-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    padding: 4px 8px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--md-sys-shape-corner-small);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

/* Material 3 - Cards */
.form-section,
.results-section,
.table-section {
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 24px;
    box-shadow: var(--md-sys-elevation-level1);
    transition: box-shadow var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.form-section h2,
.results-section h2,
.table-section h2 {
    margin: 0 0 24px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    color: var(--md-sys-color-on-surface);
}

.card {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 24px;
    box-shadow: var(--md-sys-elevation-level1);
    margin-bottom: 24px;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group-full {
    grid-column: 1 / -1;
}

/* Material 3 - Results Section */

.results-section h2 {
    margin: 0 0 24px 0;
    font-size: 22px;
    font-weight: 400;
    color: var(--md-sys-color-primary);
}

.results-grid {
    display: grid;
    gap: 16px;
}

.result-card {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 20px;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.result-card:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

.result-card-header {
    font-size: 12px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.result-card-value {
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
    color: var(--md-sys-color-primary);
}

/* Material 3 - Table Section */
.table-section h2 {
    margin: 0 0 24px 0;
    font-size: 22px;
    font-weight: 400;
    color: var(--md-sys-color-on-surface);
}

.table-container {
    overflow-x: auto;
    border-radius: var(--md-sys-shape-corner-medium);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.provvigioni-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--md-sys-color-surface);
    margin: 0;
    font-size: 14px;
}

.provvigioni-table th {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-weight: 500;
    padding: 16px;
    text-align: left;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.1px;
}

.provvigioni-table td {
    padding: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
}

.provvigioni-table tbody tr {
    transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.provvigioni-table tbody tr:hover {
    background: var(--md-sys-color-surface-container);
}

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

/* Material 3 - Form Elements */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.5px;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    outline: none;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--md-sys-color-on-surface);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 15px;
}

input::placeholder,
textarea::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
}

/* Material 3 - Buttons */
/* Filled Button (Primary) */
.button-primary {
    width: 100%;
    padding: 10px 24px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.1px;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-level0);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    position: relative;
    overflow: hidden;
}

.button-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-on-primary);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short4);
}

.button-primary:hover::before {
    opacity: var(--md-sys-state-hover-opacity);
}

.button-primary:focus::before {
    opacity: var(--md-sys-state-focus-opacity);
}

.button-primary:active::before {
    opacity: var(--md-sys-state-pressed-opacity);
}

.button-primary:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

/* Outlined Button (Secondary) */
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.1px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    position: relative;
    overflow: hidden;
}

.button-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-primary);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short4);
}

.button-secondary:hover::before {
    opacity: var(--md-sys-state-hover-opacity);
}

.button-secondary:focus::before {
    opacity: var(--md-sys-state-focus-opacity);
}

.button-secondary:active::before {
    opacity: var(--md-sys-state-pressed-opacity);
}

/* Filled Tonal Button (Tasks) */
.button-tasks {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.1px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    position: relative;
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-level0);
}

.button-tasks::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-on-secondary-container);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short4);
}

.button-tasks:hover::before {
    opacity: var(--md-sys-state-hover-opacity);
}

.button-tasks:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

/* Material 3 - Kanban Board */
.kanban-intro {
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--md-sys-elevation-level1);
}

.kanban-intro h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 400;
    color: var(--md-sys-color-on-surface);
}

.kanban-intro p {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
}

.kanban-board {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    overflow-x: auto;
    padding-bottom: 16px;
    height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
}

.kanban-board::-webkit-scrollbar {
    height: 12px;
}

.kanban-board::-webkit-scrollbar-track {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-small);
}

.kanban-board::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-small);
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 80%, black 20%);
}

.kanban-column {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 20px;
    box-shadow: var(--md-sys-elevation-level1);
    display: flex;
    flex-direction: column;
    min-height: 360px;
    flex: 1;
    min-width: 0;
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.kanban-column:hover {
    box-shadow: var(--md-sys-elevation-level2);
}

/* Material 3 - Kanban Column Header & Cards */
.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.column-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.column-add-btn {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    box-shadow: var(--md-sys-elevation-level0);
    position: relative;
    overflow: hidden;
}

.column-add-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-on-primary);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short4);
}

.column-add-btn:hover::before {
    opacity: var(--md-sys-state-hover-opacity);
}

.column-add-btn:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

.column-add-btn:active {
    box-shadow: var(--md-sys-elevation-level0);
}

.column-add-btn .material-icons-round {
    font-size: 24px;
    position: relative;
    z-index: 1;
}

.kanban-column-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.kanban-count {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-radius: var(--md-sys-shape-corner-full);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Material 3 - Kanban Cards */
.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 100px;
    max-height: 100%;
    overflow-y: auto;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    border-radius: var(--md-sys-shape-corner-medium);
    padding-right: 4px;
}

.kanban-cards::-webkit-scrollbar {
    width: 8px;
}

.kanban-cards::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-cards::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-small);
}

.kanban-cards::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-outline);
}

.kanban-cards.drag-over {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
    border-radius: var(--md-sys-shape-corner-medium);
    animation: column-pulse 1s ease-in-out infinite;
}

@keyframes column-pulse {
    0%, 100% {
        background-color: color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
    }
    50% {
        background-color: color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent);
    }
}

.kanban-card {
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 16px;
    box-shadow: var(--md-sys-elevation-level1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
    position: relative;
    border: 1px solid transparent;
}

.kanban-card:hover {
    box-shadow: var(--md-sys-elevation-level2);
}

.kanban-card[draggable="true"] {
    cursor: move;
    cursor: grab;
}

.kanban-card[draggable="true"]:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.6;
    cursor: grabbing;
    transform: rotate(3deg);
    box-shadow: var(--md-sys-elevation-level4);
    z-index: 1000;
}

.kanban-card-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--md-sys-color-on-surface);
    flex: 1;
}

.kanban-card-badge {
    align-self: flex-start;
    background: var(--md-sys-color-tertiary-container);
    color: var(--md-sys-color-on-tertiary-container);
    border-radius: var(--md-sys-shape-corner-small);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.kanban-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 16px;
    color: var(--md-sys-color-on-surface-variant);
}

.kanban-card-footer {
    margin-top: 4px;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

.kanban-card-note {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-small);
    padding: 8px;
    line-height: 16px;
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-edit-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-edit-btn:hover {
    background: var(--bg-secondary);
    color: var(--color-accent-blue);
}

.card-edit-btn .material-icons {
    font-size: 18px;
}

.kanban-card[draggable="true"] {
    cursor: move;
    cursor: grab;
}

.kanban-card[draggable="true"]:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kanban-card[draggable="true"]:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.6;
    cursor: grabbing;
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kanban-card.drag-over-top {
    border-top: 3px solid var(--color-accent-blue);
    animation: pulse-top 0.6s ease-in-out infinite;
}

.kanban-card.drag-over-bottom {
    border-bottom: 3px solid var(--color-accent-blue);
    animation: pulse-bottom 0.6s ease-in-out infinite;
}

.kanban-card.dropping {
    animation: drop-animation 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pulse-top {
    0%, 100% {
        border-top-color: var(--color-accent-blue);
        box-shadow: 0 -4px 10px rgba(59, 130, 246, 0.3);
    }
    50% {
        border-top-color: var(--color-accent-cyan);
        box-shadow: 0 -6px 15px rgba(59, 130, 246, 0.5);
    }
}

@keyframes pulse-bottom {
    0%, 100% {
        border-bottom-color: var(--color-accent-blue);
        box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
    }
    50% {
        border-bottom-color: var(--color-accent-cyan);
        box-shadow: 0 6px 15px rgba(59, 130, 246, 0.5);
    }
}

@keyframes drop-animation {
    0% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Kanban - Menu animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

@keyframes moving {
    0% {
        opacity: 0.7;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.kanban-card.moving {
    animation: moving 0.3s ease-out;
}

.kanban-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    flex: 1;
}

.kanban-card-badge {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-accent-blue);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.kanban-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.kanban-card-footer {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.kanban-card-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
}

.kanban-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 24px 0;
}

/* Material 3 - Address Autocomplete Suggestions */
.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--md-sys-color-surface-container-high);
    border: 2px solid var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-medium);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--md-sys-elevation-level3);
    margin-top: 8px;
}

.address-suggestions.show {
    display: block;
}

.address-suggestion-item {
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    transition: background-color var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
    color: var(--md-sys-color-on-surface);
}

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

.address-suggestion-item:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

.address-suggestion-item.selected {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
}

.address-suggestion-main {
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 6px;
    color: var(--md-sys-color-on-surface);
}

.address-suggestion-detail {
    font-size: 12px;
    line-height: 16px;
    color: var(--md-sys-color-on-surface-variant);
    word-wrap: break-word;
    white-space: normal;
}

.address-suggestions-loading {
    padding: 16px;
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
}

.address-suggestions-empty {
    padding: 16px;
    text-align: center;
    color: var(--md-sys-color-outline);
    font-size: 14px;
}

/* Material 3 - Admin Dashboard */
.admin-dashboard {
    margin-top: 32px;
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 24px;
    box-shadow: var(--md-sys-elevation-level1);
}

.admin-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
    color: var(--md-sys-color-on-surface);
}

.admin-header p {
    margin: 0 0 24px 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--md-sys-color-on-surface-variant);
}

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

.admin-card {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 20px;
    box-shadow: var(--md-sys-elevation-level1);
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
}

.admin-card:hover {
    box-shadow: var(--md-sys-elevation-level2);
}

.admin-card h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--md-sys-color-on-surface);
}

/* Material 3 - Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 0;
    box-shadow: var(--md-sys-elevation-level3);
    width: 90%;
    max-width: 600px;
    max-height: 95vh;
    overflow-y: auto;
    animation: modalSlideIn var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
}

#modalIndirizzo .modal-content {
    max-width: 800px;
    max-height: 700px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    color: var(--md-sys-color-on-surface);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    position: relative;
    overflow: hidden;
}

.modal-close::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-on-surface);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short4);
}

.modal-close:hover::before {
    opacity: var(--md-sys-state-hover-opacity);
}

.modal-content form {
    padding: 24px;
}

#modalIndirizzo .modal-body {
    padding: 24px;
    min-height: 500px;
}

/* Material 3 - Client Modal */
.client-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.client-modal.active {
    display: flex;
}

.client-modal-content {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 0;
    box-shadow: var(--md-sys-elevation-level3);
    width: 90%;
    max-width: 500px;
    animation: modalSlideIn var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
}

.client-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.client-modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
    line-height: 28px;
    color: var(--md-sys-color-on-surface);
}

.client-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    position: relative;
    overflow: hidden;
}

.client-modal-close::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-on-surface);
    opacity: 0;
    transition: opacity var(--md-sys-motion-duration-short4);
}

.client-modal-close:hover::before {
    opacity: var(--md-sys-state-hover-opacity);
}

.client-modal-body {
    padding: 24px;
}

.client-detail-item {
    margin-bottom: 16px;
}

.client-detail-item label {
    display: block;
    font-weight: 500;
    font-size: 11px;
    line-height: 16px;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.client-detail-item span {
    display: block;
    color: var(--md-sys-color-on-surface);
    padding: 12px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-small);
    border: 1px solid var(--md-sys-color-outline-variant);
    word-break: break-word;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 14px;
    line-height: 20px;
}

.client-detail-item span:empty::before {
    content: "—";
    color: var(--md-sys-color-on-surface-variant);
}

.client-modal-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    justify-content: flex-end;
}

.client-modal-footer button {
    flex: 1;
}

/* Bottom Navigation Mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 70px;
}

.bottom-nav .nav-item .material-icons {
    font-size: 24px;
}

.bottom-nav .nav-item .nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

.bottom-nav .nav-item:hover,
.bottom-nav .nav-item.active {
    color: var(--color-accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* MD3 Top App Bar - Tablet */
    .md3-top-app-bar-actions {
        gap: 8px;
    }
    
    .md3-icon-button-text .button-label {
        font-size: 13px;
    }
    
    .md3-user-chip {
        padding: 6px 12px 6px 8px;
    }
    
    .md3-user-name {
        font-size: 13px;
    }
    
    /* Kanban Board migliorato per tablet */
    .kanban-board {
        gap: 16px;
        height: auto;
        max-height: none;
    }
    
    .kanban-column {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }

    html, body {
        width: 100%;
        overflow-x: hidden;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    body {
        padding-bottom: 80px;
        margin: 0;
        padding-top: 0;
    }

    .container {
        padding: 12px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* MD3 Top App Bar - Mobile */
    .md3-top-app-bar {
        padding: 8px 12px;
        min-height: 56px;
        margin-bottom: 16px;
    }
    
    .md3-top-app-bar-title {
        font-size: 20px;
        line-height: 24px;
    }
    
    .md3-top-app-bar-brand-icon {
        font-size: 24px;
    }
    
    .header-section {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .welcome-section {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .form-section,
    .results-section,
    .table-section {
        padding: 20px;
        border-radius: 16px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    
    .provvigioni-table {
        font-size: 0.75rem;
    }
    
    .provvigioni-table th,
    .provvigioni-table td {
        padding: 12px 8px;
    }
    
    .result-card-value {
        font-size: 1.25rem;
    }
    
    /* Kanban Board Mobile Ottimizzato */
    .kanban-board {
        flex-direction: column;
        gap: 12px;
        height: auto;
        max-height: none;
        overflow: visible;
        overflow-x: hidden;
        padding: 0 0 20px 0;
        margin: 0;
        width: 100%;
    }
    
    .kanban-column {
        min-width: 100%;
        width: 100%;
        min-height: auto;
        padding: 12px;
        margin: 0;
        border-radius: 12px;
    }
    
    .kanban-column-header {
        margin-bottom: 12px;
        flex-wrap: wrap;
    }
    
    .kanban-column-header h3 {
        font-size: 0.95rem;
    }
    
    .kanban-count {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    
    .column-add-btn {
        width: 26px;
        height: 26px;
    }
    
    .column-add-btn .material-icons {
        font-size: 18px;
    }
    
    .kanban-cards {
        gap: 12px;
        max-height: 400px;
        overflow-y: auto;
    }
    
    .kanban-card {
        padding: 12px;
        border-radius: 10px;
        gap: 6px;
    }
    
    .kanban-card-header {
        gap: 6px;
    }
    
    .kanban-card-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .card-edit-btn {
        padding: 2px;
    }
    
    .card-edit-btn .material-icons {
        font-size: 16px;
    }
    
    .kanban-card-badge {
        padding: 3px 8px;
        font-size: 0.65rem;
        margin-top: 2px;
    }
    
    .kanban-card-meta {
        gap: 3px;
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    .kanban-card-meta span {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .kanban-card-footer {
        margin-top: 2px;
        font-size: 0.75rem;
    }
    
    .kanban-card-note {
        font-size: 0.75rem;
        padding: 6px 8px;
        border-radius: 6px;
        line-height: 1.4;
    }
    
    .kanban-empty {
        padding: 20px 0;
        font-size: 0.8rem;
    }
    
    /* Client Filter Admin - Mobile */
    .clients-filter-admin {
        padding: 10px 12px;
        flex-wrap: wrap;
    }
    
    .clients-filter-admin-label {
        font-size: 13px;
        flex: 1;
    }
    
    .clients-filter-count {
        font-size: 11px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .provvigioni-table th,
    .provvigioni-table td {
        padding: 8px 6px;
        font-size: 0.7rem;
    }
    
    /* Kanban Card Extra Small Screen */
    .kanban-card {
        padding: 10px;
    }
    
    .kanban-card-title {
        font-size: 0.85rem;
    }
    
    .kanban-card-meta {
        font-size: 0.7rem;
    }
    
    .kanban-card-footer {
        font-size: 0.7rem;
    }
    
    .kanban-card-note {
        font-size: 0.7rem;
        padding: 5px 6px;
    }
    
    .kanban-column {
        padding: 12px;
    }
    
    .column-header-left {
        gap: 8px;
    }
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

p {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-section .user-info {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.welcome-section .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent-green), var(--color-accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.875rem;
}

input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

input:focus {
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

input:hover:not(:focus) {
    border-color: var(--text-muted);
}

input[readonly] {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Buttons */
.button-primary {
    width: 100%;
    padding: 16px 24px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    text-transform: none;
    letter-spacing: normal;
}

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

.button-primary:active {
    transform: translateY(0);
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-secondary:hover {
    background: var(--color-accent-blue);
    color: white;
    border-color: var(--color-accent-blue);
    transform: translateY(-1px);
}

/* Results Section */
.results {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    margin: 32px 0;
    box-shadow: var(--shadow-lg);
}

.results h2 {
    background: linear-gradient(135deg, var(--color-accent-green), var(--color-accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

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

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-accent-green);
}

/* Table Styles */
.provvigioni-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 32px 0;
}

.provvigioni-table thead {
    background: var(--md-sys-color-primary);
}

.provvigioni-table th {
    padding: 20px 16px;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.provvigioni-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

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

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

/* Error Messages */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    font-size: 0.875rem;
}

/* Success Messages */
.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--color-accent-green);
    color: var(--color-accent-green);
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    font-size: 0.875rem;
}

/* Material 3 - Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--md-sys-color-background);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 48px 32px;
    box-shadow: var(--md-sys-elevation-level2);
}

.login-card h1 {
    margin-bottom: 32px;
    font-size: 32px;
    font-weight: 400;
    line-height: 40px;
    color: var(--md-sys-color-on-surface);
    text-align: center;
}

/* Material 3 - Messages */
.error-message {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    padding: 16px;
    border-radius: var(--md-sys-shape-corner-medium);
    margin-top: 16px;
    font-size: 14px;
    line-height: 20px;
    border: 1px solid var(--md-sys-color-error);
}

.success-message {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success);
    padding: 16px;
    border-radius: var(--md-sys-shape-corner-medium);
    margin-top: 16px;
    font-size: 14px;
    line-height: 20px;
    border: 1px solid var(--md-sys-color-success);
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-level3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle .material-icons {
    font-size: 24px;
}

h1 {
    text-align: center;
    color: var(--md-sys-color-primary);
    margin: 40px 0;
    font-weight: 500;
    font-size: 2.5rem;
}

.container {
    /* max-width: 600px; */
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--md-sys-color-surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--md-sys-elevation-level2);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
}

input {
    width: 100%;
    padding: 16px 16px 16px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 8px;
    font-size: 16px;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.2);
}

input:hover {
    border-color: var(--md-sys-color-on-surface);
}

.button-primary {
    width: 100%;
    padding: 16px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--md-sys-elevation-level1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button-primary:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-sys-elevation-level2);
    transform: translateY(-1px);
}

.results {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--md-sys-elevation-level1);
}

.results h2 {
    color: var(--md-sys-color-on-secondary-container);
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 500;
}

.results p {
    margin: 12px 0;
    font-size: 1.1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

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

.result-label {
    font-weight: 500;
}

.result-value {
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

/* Stile per il messaggio di benvenuto */
p {
    font-size: 1.2rem;
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
    margin-bottom: 20px;
}

/* Stile per il pulsante di logout */
.button-secondary {
    display: inline-block;
    padding: 10px 20px;
    background: var(--md-sys-color-secondary);
    color: var(--md-sys-color-on-secondary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--md-sys-elevation-level1);
}

.button-secondary:hover {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    box-shadow: var(--md-sys-elevation-level2);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    h1 {
        font-size: 2rem;
        margin: 20px 0;
    }
    
    .card {
        padding: 16px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

/* Material 3 - Stats Section */
.stats-section {
    margin-top: 48px;
    padding: 32px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-extra-large);
    box-shadow: var(--md-sys-elevation-level1);
}

.stats-title {
    font-size: 32px;
    font-weight: 400;
    line-height: 40px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 32px;
    text-align: center;
}

.stats-wrapper {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--md-sys-elevation-level1);
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.stat-card:hover {
    box-shadow: var(--md-sys-elevation-level2);
    border-color: var(--md-sys-color-primary);
}

.stat-icon {
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-radius: var(--md-sys-shape-corner-medium);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 400;
    line-height: 40px;
    color: var(--md-sys-color-primary);
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.1px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
}

/* Material 3 - Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 8px;
}

.chart-card {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 24px;
    box-shadow: var(--md-sys-elevation-level1);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
}

.chart-title {
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 20px;
    text-align: center;
}

.chart-card canvas {
    max-height: 280px;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-section {
        margin-top: 24px;
        padding: 16px 12px;
        margin-bottom: 20px;
    }
    
    .stats-title {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        font-size: 2rem;
        min-width: 48px;
        height: 48px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .chart-card {
        padding: 12px;
        overflow: hidden;
        width: 100%;
    }
    
    .chart-card canvas {
        max-width: 100%;
        max-height: 200px;
    }
    
    .chart-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
    }
}
/* Material 3 - Timeline */
.timeline-modern {
    position: relative;
    padding-left: 40px;
}

.timeline-modern::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--md-sys-color-outline-variant);
}

.timeline-item {
    position: relative;
    padding-bottom: 40px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:last-child .timeline-connector {
    display: none;
}

.timeline-icon {
    position: absolute;
    left: -40px;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--md-sys-color-surface);
}

.timeline-icon.success {
    background: var(--md-sys-color-success);
    color: var(--md-sys-color-on-success);
}

.timeline-icon.info {
    background: var(--md-sys-color-info);
    color: var(--md-sys-color-on-info);
}

.timeline-icon.warning {
    background: var(--md-sys-color-warning);
    color: var(--md-sys-color-on-warning);
}

.timeline-icon.neutral {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface-variant);
    border: 2px solid var(--md-sys-color-outline-variant);
}

.timeline-content {
    padding: 0 0 0 20px;
}

.timeline-date {
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 6px;
}

.timeline-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 8px 0;
}

.timeline-link {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.timeline-link:hover {
    color: color-mix(in srgb, var(--md-sys-color-primary) 80%, black 20%);
    text-decoration: underline;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    font-size: 12px;
    line-height: 16px;
    color: var(--md-sys-color-on-surface-variant);
}

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

.timeline-meta-item .material-icons,
.timeline-meta-item .material-icons-round {
    font-size: 16px;
}

.timeline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.timeline-badge.success {
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success);
}

.timeline-badge.info {
    background: var(--md-sys-color-info-container);
    color: var(--md-sys-color-on-info);
}

.timeline-badge.warning {
    background: var(--md-sys-color-warning-container);
    color: var(--md-sys-color-on-warning);
}

.timeline-details {
    margin-top: 16px;
    padding: 16px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    border-left: 3px solid var(--md-sys-color-primary);
}

.timeline-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.timeline-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-detail-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    color: var(--md-sys-color-outline);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-detail-value {
    font-size: 14px;
    line-height: 20px;
    color: var(--md-sys-color-on-surface);
    font-weight: 400;
}

/* Mobile Timeline */
@media (max-width: 768px) {
    .timeline-modern {
        padding-left: 30px;
    }
    
    .timeline-modern::before {
        left: 13px;
    }
    
    .timeline-icon {
        left: -30px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .timeline-content {
        padding-left: 12px;
    }
    
    .timeline-title {
        font-size: 0.95rem;
    }
    
    .timeline-date {
        font-size: 0.8rem;
    }
    
    .timeline-details-grid {
        grid-template-columns: 1fr;
    }
}