/* Reset e base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
    color: #333333;
    margin: 0;
    padding: 0;
}

/* Background styles */
body, html {
    height: 100%;
    background-repeat: no-repeat;
    background: white;
    position: relative;
    margin: 0;
    padding: 0;
}

#particles-js {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: 50% 50%;
    position: fixed;
    top: 0px;
    z-index: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.main-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    pointer-events: none;
}

.main-content * {
    pointer-events: auto;
}

/* Sfondo dinamico animato */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #e8e8e8, #f0f0f0, #e8e8e8);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.background-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, var(--color-glass-dark) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(55, 65, 81, 0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

/* Animazioni */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(1deg); }
    66% { transform: translateY(-15px) rotate(-1deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Container principale */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Logo/Titolo */
.logo-section {
    text-align: center;
    margin-bottom: 60px;
    animation: slideDown 1s ease-out;
}

.logo-title {
    width: 375px;
    height: 150px;
    background: url('../SVG/marchioagatos.svg') no-repeat center center;
    background-size: contain;
    margin: 0 auto 10px auto;
    display: block;
    text-indent: -9999px;
    overflow: hidden;
    transition: all 0.3s ease;
    -webkit-mask: url('../SVG/marchioagatos.svg') no-repeat center center;
    mask: url('../SVG/marchioagatos.svg') no-repeat center center;
    -webkit-mask-size: contain;
    mask-size: contain;
    background: var(--color-gray-500);
    cursor: pointer;
    user-select: none;
    transform: translateX(-5px);
}

.logo-title:hover {
    transform: scale(1.05);
    filter: brightness(0.7) contrast(0.9);
}

/* Fallback per il testo se il logo non dovesse caricarsi */
.logo-title-text {
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--color-gray-800);
    text-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.2);
    margin-bottom: 10px;
    letter-spacing: 3px;
    display: none;
}

.logo-subtitle {
    font-size: 1.2rem;
    color: var(--color-gray-500);
    font-weight: 300;
    letter-spacing: 1px;
}

/* Bottoni principali */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 1s ease-out 0.3s both;
}

.primary-button {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-gray-800);
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.primary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--color-glass-dark), transparent);
    transition: left 0.5s ease;
}

.primary-button:hover::before {
    left: 100%;
}

.primary-button:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(var(--color-primary-rgb), 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    color: #ffffff;
}

.create-company-btn {
    background: var(--color-glass-dark);
    border-color: rgba(var(--color-primary-rgb), 0.4);
    color: var(--color-gray-800);
}

.create-company-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.2);
    border-color: rgba(var(--color-primary-rgb), 0.6);
    color: #ffffff;
}

/* Sezione secondaria */
.secondary-actions {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.6s both;
}

.secondary-button {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    color: #555555;
    padding: 12px 20px;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--color-gray-800);
    border-color: rgba(var(--color-primary-rgb), 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Modal per form */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(20px);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal h2 {
    color: var(--color-gray-800);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 300;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--color-gray-500);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--color-gray-800);
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-gray-800);
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 56px;
    line-height: 1.4;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #888888;
}

.form-input:focus {
    outline: none;
    border-color: rgba(var(--color-primary-rgb), 0.6);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-input.error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

.form-input.error:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
}

/* === HOMEPAGE OVERLAY STYLES === */
.homepage-overlay {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.hero-section {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 
        0 8px 32px var(--color-glass-dark),
        0 2px 16px rgba(255, 255, 255, 0.8) inset;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.hero-content:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 16px 48px rgba(55, 65, 81, 0.15),
        0 2px 16px rgba(255, 255, 255, 0.9) inset;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, var(--color-primary), #1f2937);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
    opacity: 0.9;
}

.description {
    font-size: 1.1rem;
    color: #666;
    margin: 2rem 0;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-section {
    margin: 2rem 0;
}

.secondary-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.button-icon {
    margin-right: 0.5rem;
    font-size: 1.2em;
}

.animate-in {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: center;
}

/* === FUTURISTIC BACKGROUND STYLES === */
.futuristic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #f1f3f4 100%);
    z-index: -1;
    overflow: hidden;
    pointer-events: none; /* Assicura che lo sfondo non interferisca con i click */
}

.wave-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(55, 65, 81, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, rgba(55, 65, 81, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: wave-drift 25s ease-in-out infinite;
    transform: scale(1.1);
}

.fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 0%, rgba(55, 65, 81, 0.02) 30%, transparent 60%),
        linear-gradient(-45deg, transparent 20%, rgba(255, 255, 255, 0.05) 50%, transparent 80%);
    animation: fog-drift 30s ease-in-out infinite alternate;
}

.dots-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto; /* Solo i punti sono cliccabili per l'hover */
}

/* Punti in movimento */
.moving-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(var(--color-primary-rgb), 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: gentle-pulse 4s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.2);
    z-index: 2;
}

.moving-dot.small {
    width: 6px;
    height: 6px;
    background: rgba(var(--color-primary-rgb), 0.3);
    animation-duration: 5s;
}

.moving-dot.large {
    width: 10px;
    height: 10px;
    background: rgba(var(--color-primary-rgb), 0.5);
    animation-duration: 3s;
    box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.3);
}

/* Linee di connessione dinamiche con effetto appari/scompari */
.dynamic-connection-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(var(--color-primary-rgb), 0.3) 20%, 
        rgba(var(--color-primary-rgb), 0.6) 50%, 
        rgba(var(--color-primary-rgb), 0.3) 80%, 
        transparent 100%);
    transform-origin: 0 50%; /* Origine dal punto di partenza, centrata verticalmente */
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: line-pulse 4s ease-in-out infinite;
}

/* Animazioni specifiche per movimento */
@keyframes gentle-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes line-pulse {
    0%, 100% {
        filter: brightness(0.8);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* Rimuovo gli stili dei punti fissi non utilizzati */
.fixed-dot, .permanent-connection-line {
    display: none;
}

@keyframes wave-drift {
    0%, 100% {
        transform: scale(1.1) rotate(0deg) translateX(0%);
    }
    25% {
        transform: scale(1.15) rotate(0.5deg) translateX(2%);
    }
    50% {
        transform: scale(1.1) rotate(0deg) translateX(-1%);
    }
    75% {
        transform: scale(1.12) rotate(-0.5deg) translateX(1%);
    }
}

@keyframes fog-drift {
    0% {
        transform: translateX(-5%) translateY(-5%) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateX(5%) translateY(5%) rotate(1deg);
        opacity: 0.5;
    }
    100% {
        transform: translateX(-3%) translateY(-3%) rotate(-0.5deg);
        opacity: 0.4;
    }
}

/* Assicura che il contenuto principale sia sopra lo sfondo */
.main-container {
    position: relative;
    z-index: 100;
}

/* Rimuovo gli stili vecchi non utilizzati */
.animated-dot, .connection-line, .light-particle {
    display: none;
}

/* Switch per le particelle */
.particles-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.particles-toggle:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.particles-toggle label {
    font-size: 10px;
    color: var(--color-primary);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Switch personalizzato */
.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: var(--color-primary);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(16px);
}

/* Nascondi le particelle quando disabilitate */
#particles-js.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-title {
        width: 250px;
        height: 100px;
    }

    .logo-title-text {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    .logo-subtitle {
        font-size: 1rem;
    }

    .action-buttons {
        max-width: 350px;
    }

    .primary-button {
        padding: 16px 25px;
        font-size: 1rem;
    }

    .secondary-actions {
        flex-direction: column;
        align-items: center;
    }

    .homepage-overlay {
        padding: 1rem;
    }
    
    .hero-content {
        padding: 2rem 1.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 15px;
    }

    .logo-title {
        width: 200px;
        height: 80px;
    }

    .logo-title-text {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .action-buttons {
        max-width: 300px;
    }

    .primary-button {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .primary-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Gestione Aziendale Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    color: var(--color-primary);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #666;
    font-size: 1.1em;
    margin-top: 5px;
}

.btn-back {
    background: var(--color-gray-600);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.aziende-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.azienda-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.azienda-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.azienda-nome {
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.azienda-info {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}



.btn-view {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: #1f2937;
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 60px 20px;
}

.empty-state h3 {
    color: var(--color-primary);
    margin-bottom: 15px;
}

.btn-create {
    background: var(--color-success);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.btn-create:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Sede Management Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header h1 {
    color: var(--color-primary);
    font-size: 2.5em;
    margin: 0;
}

.header .subtitle {
    color: #666;
    font-size: 1.1em;
    margin-top: 5px;
}

.btn-back {
    background: var(--color-gray-600);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.sedi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.sede-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.sede-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.sede-nome {
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.sede-indirizzo {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    line-height: 1.4;
}



.reparti-preview {
    margin-bottom: 20px;
}

.reparti-preview h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.reparto-item {
    background: var(--color-glass-dark);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reparto-nome {
    font-weight: 500;
    color: #333;
}

.reparto-piano {
    color: #666;
    font-size: 0.8em;
}

/* Sede Info Styles */
.sede-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sede-info h3 {
    color: #333;
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.info-value {
    color: #333;
}

/* Piani Container Styles */
.piani-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.piano-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.piano-title {
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reparti-count {
    background: var(--color-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
}

.reparto-card {
    background: rgba(55, 65, 81, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--color-glass-dark);
    transition: all 0.3s ease;
}

.reparto-card:hover {
    background: var(--color-glass-dark);
    transform: translateY(-2px);
}

.reparto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.reparto-nome {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.reparto-categoria {
    background: var(--color-success);
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7em;
}

.reparto-descrizione {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.reparto-contatti {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contatti-count {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9em;
}

.btn-view-reparto {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.btn-view-reparto:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.empty-piano {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-style: italic;
}

.btn-add-contatto {
    background: var(--color-success);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.btn-add-contatto:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Reparto Info Styles */
.reparto-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.reparto-info h3 {
    color: #333;
    margin-bottom: 15px;
}

.contatti-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    color: #333;
    font-size: 1.5em;
    margin: 0;
}

.btn-add {
    background: var(--color-success);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: #218838;
    transform: translateY(-2px);
}

.contatti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.contatto-card {
    background: rgba(55, 65, 81, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--color-glass-dark);
    transition: all 0.3s ease;
}

.contatto-card:hover {
    background: var(--color-glass-dark);
    transform: translateY(-2px);
}

.contatto-nome {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.contatto-ruolo {
    background: var(--color-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8em;
    display: inline-block;
    margin-bottom: 15px;
}

.contatto-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contatto-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9em;
}

.contatto-info-item i {
    color: var(--color-primary);
    width: 16px;
}

.contatto-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-edit {
    background: var(--color-warning);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.empty-contatti {
    text-align: center;
    color: #666;
    padding: 60px 20px;
    font-style: italic;
}

.empty-contatti h4 {
    color: var(--color-primary);
    margin-bottom: 15px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.05);
}

.modal-content h2 {
    color: #333;
    margin: 0 0 30px 0;
    font-size: 28px;
    font-weight: 300;
    text-align: center;
}

.step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.step.active {
    display: block;
}

.step h3 {
    color: var(--color-primary);
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 400;
    text-align: center;
}

.step-description {
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 20px;
    height: 56px;
    line-height: 1.4;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-glass-dark);
    background: rgba(255, 255, 255, 1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.step-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
}

.step-buttons button {
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.primary-button {
    background: var(--color-primary);
    color: white;
}

.primary-button:hover {
    background: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--color-primary-rgb), 0.4);
}

.secondary-button {
    background: rgba(55, 65, 81, 0.08);
    color: var(--color-primary);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.secondary-button:hover {
    background: rgba(55, 65, 81, 0.15);
    transform: translateY(-1px);
}

.sede-section {
    background: rgba(55, 65, 81, 0.04);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--color-glass-dark);
    margin-bottom: 20px;
}

.sede-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sede-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-save,
button.btn-save,
.modal-actions .btn-save {
    background: var(--color-success) !important;
    color: white !important;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover,
button.btn-save:hover,
.modal-actions .btn-save:hover {
    background: #218838 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

.btn-save:disabled,
button.btn-save:disabled,
.modal-actions .btn-save:disabled {
    background: var(--color-gray-600) !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-cancel,
button.btn-cancel,
.modal-actions .btn-cancel {
    background: var(--color-gray-600) !important;
    color: white !important;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel:hover,
button.btn-cancel:hover,
.modal-actions .btn-cancel:hover {
    background: #5a6268 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.25);
}

.piano-section-modal {
    background: rgba(55, 65, 81, 0.04);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--color-glass-dark);
    margin-bottom: 15px;
}

.piano-header-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.piano-title-modal {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.reparto-item-modal {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--color-glass-dark);
    margin-bottom: 15px;
}

.reparto-header-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alert-modal {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 14px;
    text-align: center;
}

.alert-success-modal {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #155724;
}

.alert-danger-modal {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #721c24;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-primary);
    font-size: 16px;
}

/* === LOGIN PAGE STYLES === */
.login-main-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-main-content * {
    pointer-events: auto;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    animation: modalSlideIn 0.6s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: slideDown 1s ease-out;
}

.login-header h1 {
    color: var(--color-gray-800);
    font-weight: 300;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    text-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.2);
    letter-spacing: 2px;
    line-height: 1.2;
}

.login-header h1 i {
    display: block;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.login-header p {
    color: var(--color-gray-500);
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.btn-login {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-gray-800);
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-top: 1rem;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--color-glass-dark), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(var(--color-primary-rgb), 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1.5rem;
    padding: 15px;
    backdrop-filter: blur(10px);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #721c24;
}

.remember-me {
    margin: 1rem 0;
}

.remember-me .form-check-input {
    border-radius: 4px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    background: rgba(255, 255, 255, 0.8);
}

.remember-me .form-check-input:checked {
    background-color: rgba(var(--color-primary-rgb), 0.8);
    border-color: rgba(var(--color-primary-rgb), 0.8);
}

.remember-me .form-check-label {
    color: var(--color-gray-500);
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.login-footer a {
    color: rgba(var(--color-primary-rgb), 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: rgba(55, 65, 81, 1);
    text-decoration: underline;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 15px;
    cursor: pointer;
    color: #888888;
    z-index: 10;
    transition: color 0.3s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 20px;
}

.password-toggle:hover {
    color: rgba(var(--color-primary-rgb), 0.8);
}

.password-field-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 0;
    color: #888888;
    z-index: 5;
    pointer-events: none;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 20px;
}

.form-input.with-icon {
    padding-left: 45px;
}

/* Assicura il centramento delle icone in tutti i form-group */
.form-group .input-icon {
    position: absolute;
    left: 15px;
    top: 0;
    color: #888888;
    z-index: 5;
    pointer-events: none;
    line-height: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 56px !important;
    width: 20px;
}

/* Specifico per l'icona del toggle password */
.password-field-container .password-toggle {
    position: absolute;
    top: 0;
    right: 15px;
    cursor: pointer;
    color: #888888;
    z-index: 10;
    transition: color 0.3s ease;
    line-height: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 56px !important;
    width: 20px;
}

/* Responsive per login */
@media (max-width: 768px) {
    .login-container {
        padding: 2rem;
        max-width: 360px;
        margin: 20px;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
        max-width: 320px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .btn-login {
        padding: 16px 24px;
        font-size: 1rem;
    }
}

/* Easter Egg Popup Styles */
.easter-egg-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: easterEggFadeIn 0.5s ease-out;
}

.easter-egg-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    max-width: 500px;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(var(--color-primary-rgb), 0.2),
        0 8px 32px var(--color-glass-dark),
        0 2px 16px rgba(255, 255, 255, 0.8) inset;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: easterEggBounce 0.8s ease-out;
}

.easter-egg-content::before {
    content: '🎉';
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
    animation: easterEggRotate 2s ease-in-out infinite;
    filter: grayscale(0.3);
}

.easter-egg-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: easterEggGlow 2s ease-in-out infinite alternate;
}

.easter-egg-message {
    font-size: 1.2rem;
    color: var(--color-gray-500);
    margin-bottom: 30px;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.easter-egg-close {
    background: var(--color-glass-dark);
    border: 2px solid rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-primary);
    padding: 12px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.easter-egg-close:hover {
    background: rgba(var(--color-primary-rgb), 0.2);
    border-color: rgba(var(--color-primary-rgb), 0.5);
    color: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(var(--color-primary-rgb), 0.2);
}

/* Animazioni Easter Egg */
@keyframes easterEggFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes easterEggBounce {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes easterEggRotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

@keyframes easterEggGlow {
    0% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    100% {
        text-shadow: 
            0 2px 10px rgba(0, 0, 0, 0.1),
            0 0 20px rgba(var(--color-primary-rgb), 0.3);
    }
}

/* Effetto click sul logo */
.logo-title.clicked {
    animation: logoClick 0.2s ease-out;
}

@keyframes logoClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Personalizza il messaggio dell'easter egg qui */
.easter-egg-content::after {
    content: "🚀 Complimenti! Hai scoperto l'easter egg di Agatos! 🚀";
    display: none;
}

/* Responsive design per easter egg */
@media (max-width: 768px) {
    .easter-egg-content {
        padding: 40px 30px;
        max-width: 350px;
        margin: 20px;
    }
    
    .easter-egg-title {
        font-size: 2rem;
    }
    
    .easter-egg-message {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .easter-egg-content {
        padding: 30px 20px;
        max-width: 300px;
    }
    
    .easter-egg-title {
        font-size: 1.5rem;
    }
    
    .easter-egg-message {
        font-size: 0.9rem;
    }
}

/* Stats Section */
.stats-section {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
    animation: fadeIn 1s ease-out 0.4s both;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.stat-card:hover::before {
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent 100%);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
    display: block;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-number {
    color: #1F2937;
}

.stat-label {
    font-size: 0.8rem;
    color: #6B7280;
    font-weight: 400;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-label {
    color: var(--color-primary);
}

/* Responsive Design - Riorganizzato per chiarezza */
/* Desktop: 1 riga con 4 colonne */
@media (min-width: 1025px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px;
        max-width: 1000px;
        margin: 0 auto;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* Tablet: 2 righe con 2 colonne (2x2) */
@media (max-width: 1024px) and (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .stat-card {
        padding: 18px 12px;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

/* Mobile: 2 righe con 2 colonne (2x2) */
@media (max-width: 768px) {
    .stats-section {
        margin: 25px auto;
        padding: 0 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .stat-card {
        padding: 16px 10px;
        border-radius: 10px;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}

/* Mobile piccolo: 2 righe con 2 colonne (2x2) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .stat-card {
        padding: 14px 8px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
}

/* Statistiche nelle carte azienda e sede */
.azienda-stats, .sede-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(55, 65, 81, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(55, 65, 81, 0.08);
}

.azienda-stats .stat-card, .sede-stats .stat-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(55, 65, 81, 0.15);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.azienda-stats .stat-card:hover, .sede-stats .stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: rgba(55, 65, 81, 0.25);
    background: rgba(255, 255, 255, 0.95);
}

.azienda-stats .stat-number, .sede-stats .stat-number {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 2px;
}

.azienda-stats .stat-label, .sede-stats .stat-label {
    font-size: 0.7rem;
    color: #6B7280;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Responsive per statistiche nelle carte */
@media (max-width: 768px) {
    .azienda-stats, .sede-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .azienda-stats .stat-card, .sede-stats .stat-card {
        padding: 10px 6px;
    }
    
    .azienda-stats .stat-number, .sede-stats .stat-number {
        font-size: 1.2rem;
    }
    
    .azienda-stats .stat-label, .sede-stats .stat-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .azienda-stats, .sede-stats {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
    }
    
    .azienda-stats .stat-card, .sede-stats .stat-card {
        padding: 8px 4px;
    }
    
    .azienda-stats .stat-number, .sede-stats .stat-number {
        font-size: 1.1rem;
    }
}

/* Stili per la nuova interfaccia di creazione azienda */
.creation-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.creation-method-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.creation-method-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.creation-method-card h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1.2rem;
}

.creation-method-card p {
    margin: 0 0 20px 0;
    color: var(--color-gray-600);
    line-height: 1.5;
}

/* Upload area styles */
.upload-area {
    border: 3px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 15px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #007bff;
    background: #f8f9ff;
}

.upload-area.file-selected {
    border-color: var(--color-success);
    background: #f8fff9;
}

.upload-content p {
    margin: 0;
    color: var(--color-gray-600);
    font-size: 0.95rem;
}

.upload-link {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}

/* Method separator */
.method-separator {
    text-align: center;
    position: relative;
    margin: 10px 0;
}

.method-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
    z-index: 1;
}

.method-separator span {
    background: white;
    padding: 0 15px;
    color: var(--color-gray-600);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

/* Manual entry dropdown */
.manual-entry-dropdown {
    border: none;
    margin: 0;
}

.dropdown-trigger {
    background: #007bff;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin: 0;
}

.dropdown-trigger:hover {
    background: #0056b3;
}

.dropdown-trigger::-webkit-details-marker {
    display: none;
}

.manual-form-content {
    padding: 20px 0 0 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Analysis results styles */
.analysis-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.confidence-indicator {
    margin-top: 10px;
    font-size: 0.95rem;
}

.missing-fields-notice {
    margin-top: 10px;
    color: #856404;
    font-size: 0.9rem;
}

.form-help {
    color: var(--color-gray-600);
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.extracted-data h5 {
    margin: 0 0 15px 0;
    color: #495057;
}

.data-grid {
    display: grid;
    gap: 10px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid #dee2e6;
}

.data-item.complete {
    background: #f8fff9;
    border-left-color: var(--color-success);
}

.data-item.incomplete {
    background: #fff8f8;
    border-left-color: var(--color-danger);
}

.data-item label {
    font-weight: 500;
    margin: 0;
}

.data-item span {
    color: var(--color-gray-600);
    font-size: 0.9rem;
    max-width: 60%;
    text-align: right;
    word-break: break-word;
}

.missing-fields {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.missing-fields h5 {
    margin: 0 0 10px 0;
    color: #856404;
}

.missing-fields ul {
    margin: 0;
    padding-left: 20px;
    color: #856404;
}

/* Step buttons */
.step-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}

/* Form styles override */
.creation-method-card .form-group {
    margin-bottom: 15px;
}

.creation-method-card .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.creation-method-card .form-group input,
.creation-method-card .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.creation-method-card .form-group input:focus,
.creation-method-card .form-group select:focus {
    outline: none;
    border-color: #007bff;
}

/* Responsive design */
@media (max-width: 768px) {
    .creation-method-card {
        padding: 15px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .data-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .data-item span {
        max-width: 100%;
        text-align: left;
    }
    
    .step-buttons {
        flex-direction: column;
    }
}

/* Dark Mode Styles */
body.dark-theme .stat-number {
    color: #ffffff !important;
}

body.dark-theme .azienda-stats .stat-number, 
body.dark-theme .sede-stats .stat-number {
    color: #ffffff !important;
}

/* ===================================
   CHAT UNIFIED STYLES
   Sistema chat unificato per tutti i ruoli
   =================================== */

/* File preview prima dell'invio */
.chat-attachment-preview {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 2px solid;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Allegati nei messaggi - hover effects */
.chat-attachment {
    transition: all 0.2s ease;
}

.chat-attachment:not(.image-attachment):hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Immagini - effetto hover */
.chat-attachment.image-attachment img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

/* Modal overlay animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px); 
    }
    to { 
        opacity: 1;
        transform: translateY(0); 
    }
}

/* Responsive attachment display */
@media (max-width: 768px) {
    .chat-attachment.image-attachment img {
        max-width: 200px !important;
        max-height: 200px !important;
    }
}

/* Loading state per allegati */
.attachment-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.attachment-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Icone file con colori specifici */
.fa-file-pdf { color: #dc3545; }
.fa-file-word { color: #2b579a; }
.fa-file-excel { color: #217346; }
.fa-file-powerpoint { color: #d24726; }
.fa-file-image { color: #28a745; }

/* Dark mode support per allegati */
body.dark-theme .chat-attachment-preview {
    background: #2c3e50;
    border-color: #34495e;
}

body.dark-theme .chat-attachment:not(.image-attachment) {
    background: #2c3e50 !important;
    color: #ecf0f1;
}

