/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE - UNIFICATO ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    animation: bodyColorFade linear forwards;
    animation-timeline: scroll();
    animation-range: 0% 100%;
}

.landing-page {
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px -12px rgba(102, 126, 234, 0.5);
}

.btn-pricing {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-pricing:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 10rem 0 6rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero .container {
    width: 100%;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto 4rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.stats-banner {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    max-width: 900px;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hero-cta {
    margin: 3rem auto;
    max-width: 600px;
}

.cta-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hero-demo {
    margin-top: 4rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}


.demo-window {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.demo-header {
    background: #f1f5f9;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.demo-dots {
    display: flex;
    gap: 6px;
}

.demo-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
}

.demo-title {
    font-weight: 600;
    color: var(--text-secondary);
}

.demo-content img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* ===== FEATURES SECTION ===== */
.features {
    padding: 6rem 0;
    background: var(--bg-color);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== PRICING SECTION ===== */
.pricing {
    padding: 6rem 0;
    background: var(--bg-secondary);
    text-align: center;
}

.pricing h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.pricing-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 3rem 2rem;
    max-width: 400px;
    margin: 0 auto;
    border: 2px solid var(--primary-color);
    position: relative;
}

.price-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
}

.price-amount {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.currency {
    font-size: 2rem;
    margin-right: 0.5rem;
}

.price-period {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.price-note {
    color: var(--danger-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.price-features {
    text-align: left;
    margin: 2rem 0;
}

.feature {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.guarantee {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== DEMO SECTION ===== */
.demo-section {
    padding: 6rem 0;
    background: var(--bg-color);
    text-align: center;
}

.demo-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.demo-login {
    background: var(--bg-secondary);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    max-width: 400px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.demo-login h3 {
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.demo-login input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.btn-demo {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-demo:hover {
    background: var(--primary-dark);
}

.demo-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4,
.footer-section h5 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}


/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Employee Info Section */
.employee-info {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.employee-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.employee-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Calculation Preview */
.calculation-preview {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

.calculation-preview h4 {
    margin: 0 0 0.75rem 0;
    color: #0369a1;
    font-size: 1rem;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0f2fe;
}

.calc-item:last-child {
    border-bottom: none;
    font-weight: 600;
    color: #0369a1;
    font-size: 1.1rem;
}

.calc-label {
    color: var(--text-secondary);
}

.calc-value {
    font-weight: 500;
}

/* Presence History */
.presence-history {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.presence-history h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.presence-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 4px solid #3b82f6;
    transition: var(--transition);
}

.presence-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.presence-info {
    flex: 1;
}

.presence-period {
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.presence-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.presence-type {
    color: #94a3b8;
    font-size: 0.8rem;
}

.presence-salary {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-right: 1rem;
}

/* Adjustments List */
.adjustments-list {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.adjustments-list h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.adjustment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.adjustment-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.adjustment-info {
    flex: 1;
}

.adjustment-type {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.adjustment-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.adjustment-period {
    color: #94a3b8;
    font-size: 0.8rem;
}

.adjustment-amount {
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 1rem;
}

.adjustment-amount.bonus {
    color: var(--accent-color);
}

.adjustment-amount.detrazione {
    color: var(--danger-color);
}

/* Delete Buttons */
.adjustment-delete,
.presence-delete {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.adjustment-delete:hover,
.presence-delete:hover {
    background: #dc2626;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

.no-adjustments,
.no-presence {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 2rem;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .stats-banner {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .nav {
        display: none;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 6rem 0 3rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .btn-hero {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}
@media (max-width: 768px) {
    .hero {
        padding: 8rem 0 4rem;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .stats-banner {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}


/* ===== DASHBOARD SPECIFIC STYLES ===== */

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header .logo {
    color: white;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.company-info {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.company-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.company-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.company-details p {
    margin: 0;
    opacity: 0.8;
    font-size: 14px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    padding-left: 35px;
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer .nav-item {
    color: rgba(255,255,255,0.8);
}

.sidebar-footer .nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 0;
}

.main-header {
    background: white;
    padding: 25px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.mobile-menu-btn {
    display: none;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

.header-left h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
}

/* Dashboard Sections */
.dashboard-section {
    padding: 30px;
}

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

.section-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.stat-content h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-content p {
    margin: 5px 0 10px 0;
    color: #7f8c8d;
    font-weight: 500;
}

.trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend.up {
    color: #27ae60;
}

.trend.down {
    color: #e74c3c;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

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

.card-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.card-header i {
    color: #667eea;
    font-size: 1.2rem;
}

.card-content {
    padding: 30px;
}

.quick-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.activity-item i {
    color: #667eea;
    font-size: 1.1rem;
}

.activity-item span {
    flex: 1;
    font-weight: 500;
}

.activity-item small {
    color: #7f8c8d;
    font-size: 12px;
}

/* Spinner Animation */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Modal Overlay for Employee Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f8f9fa;
}

.form-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.form-section h4 i {
    margin-right: 8px;
    color: #667eea;
}

.cost-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.cost-preview h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.cost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.vacation-info {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .dashboard-section {
        padding: 20px;
    }
    
    .main-header {
        padding: 20px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .cost-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MODAL SYSTEM - VERSIONE SEMPLICE E FUNZIONANTE ===== */

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

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

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close:hover {
    color: #1f2937;
    background: #e5e7eb;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

/* Stili per presenze */
.employee-info {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.employee-info h4 {
    margin: 0 0 0.5rem 0;
    color: #667eea;
    font-size: 1.1rem;
}

.employee-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.presence-history {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.presence-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.presence-info {
    flex: 1;
}

.presence-period {
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.presence-details {
    color: #6b7280;
    font-size: 0.9rem;
}

.presence-salary {
    font-weight: 700;
    font-size: 1.1rem;
    color: #10b981;
}

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

.no-presence {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* ==========================================
   VIDEO STYLES
   ========================================== */

.dashboard-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.demo-content {
    position: relative;
    overflow: hidden;
}

.video-expand-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 10;
}

.video-expand-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Modal Video Espanso */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.video-modal.hidden {
    display: none;
    opacity: 0;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
}

.expanded-video {
    width: 100%;
    height: auto;
    max-height: 90vh;
    border-radius: 8px;
}

.video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.video-modal-close:hover {
    background: white;
    color: black;
}

/* ==========================================
   SCROLL EFFECTS
   ========================================== */

.fade-in-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Animazione per le feature cards */
.feature-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.features.is-visible .feature-card {
    opacity: 1;
    transform: translateY(0);
}

.features.is-visible .feature-card:nth-child(1) {
    transition-delay: 0.1s;
}

.features.is-visible .feature-card:nth-child(2) {
    transition-delay: 0.2s;
}

.features.is-visible .feature-card:nth-child(3) {
    transition-delay: 0.3s;
}

.features.is-visible .feature-card:nth-child(4) {
    transition-delay: 0.4s;
}

.features.is-visible .feature-card:nth-child(5) {
    transition-delay: 0.5s;
}

.features.is-visible .feature-card:nth-child(6) {
    transition-delay: 0.6s;
}

/* Responsive Video */
@media (max-width: 768px) {
    .video-expand-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .video-modal-content {
        width: 95%;
    }
    
    .video-modal-close {
        top: -40px;
        padding: 8px 16px;
        font-size: 16px;
    }
}

/* ==========================================
   SCROLL ANIMATIONS CON SVG - AGGIUNGI QUESTO ALLA FINE
   ========================================== */

@keyframes stroke {
    from {
        stroke-dashoffset: 5414.29;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes colorFade {
    to {
        background-color: rgb(178, 203, 235);
    }
}

@keyframes reveal {
    from {
        clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
        opacity: 0;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        scale: 0.2;
    }
}

@keyframes revealText {
    from {
        clip-path: polygon(0 0, 0% 0, 0% 100%, 0 100%);
    }
}

/* Override body font per scroll section */
body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Hero Section come Page Header */
.page-hero {
    min-height: 100vh;
}

/* Scroll Section con SVG */
.scroll-section {
    container: inline-size;
    display: grid;
    position: relative;
    min-height: 2700px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding-bottom: 5rem;
}

.line-svg {
    grid-row: 1;
    grid-column: 1;
    height: calc(100% - 10rem);
    min-width: 300px;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
}

.anim-overview-stroke {
    stroke-dasharray: 5414.29;
    stroke-dashoffset: 5414.29;
    animation: stroke linear forwards;
    animation-timeline: scroll();
    animation-range: -10% 85%;
}

.scroll-section .container {
    grid-column: 1;
    grid-row: 1;
    margin: 0 auto;
    max-width: 1272px;
    z-index: 2;
    position: relative;
}

.scroll-heading {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    color: white;
    font-size: 62px;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin: 0;
    padding-top: 72px;
    position: relative;
    width: 70%;
    text-align: right;
    margin-left: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    animation: revealText linear both;
    animation-timeline: view();
    animation-range: 25% 60%;
}

/* Features Layout con Grid */
.features-layout {
    padding-top: 8rem;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
}

.feature-box {
    background-color: white;
    color: #333;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 1;
    scale: 1;
    animation: scaleIn linear both;
    animation-timeline: view();
    animation-range: 0% 40vh;
}

.feature-box h3 {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin: 1rem 0 1rem;
    color: #667eea;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.feature-box p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 1.5em;
    color: #666;
}

.feature-icon-large {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    margin-bottom: 1rem;
}

.btn-feature {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 99px;
    color: white;
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 42px;
    height: 42px;
    padding: 0 30px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.feature-image {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    display: block;
    height: auto;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: 10% 60%;
}

/* Grid Positions */
.box-1 {
    grid-column: 3 / span 3;
    grid-row: span 2;
}

.image-1 {
    grid-column: 1 / span 2;
    grid-row: 2 / span 2;
    margin-top: 100px;
}

.box-2 {
    grid-column: 2 / span 3;
    margin-top: 3rem;
    grid-row: span 2;
}

.image-2 {
    align-self: end;
    grid-column: 6 / span 1;
    grid-row: 5;
}

.box-3 {
    grid-column: 3 / span 3;
    margin-top: 8em;
}

.image-3 {
    grid-column: 1 / span 2;
    justify-self: end;
    margin-top: 3rem;
}

.box-4 {
    grid-column: 1 / span 3;
    margin-top: 12rem;
    margin-bottom: -5rem;
}

/* ==========================================
   RESPONSIVE PER SCROLL SECTION
   ========================================== */

@media (max-width: 1024px) {
    .features-layout {
        grid-template-columns: repeat(2, 1fr);
        padding-top: 4rem;
    }
    
    .box-1, .box-2, .box-3, .box-4 {
        grid-column: span 2;
        margin-top: 2rem;
    }
    
    .image-1, .image-2, .image-3 {
        grid-column: span 2;
        margin-top: 2rem;
        justify-self: center;
    }
    
    .scroll-heading {
        font-size: 42px;
        width: 100%;
        text-align: center;
    }
    
    .scroll-section {
        min-height: auto;
        padding-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    .features-layout {
        grid-template-columns: 1fr;
    }
    
    .box-1, .box-2, .box-3, .box-4,
    .image-1, .image-2, .image-3 {
        grid-column: 1;
        margin-top: 1.5rem;
    }
    
    .scroll-heading {
        font-size: 32px;
        padding-top: 40px;
    }
    
    .feature-box {
        padding: 2rem;
    }
    
    .feature-box h3 {
        font-size: 24px;
    }
    
    .line-svg {
        display: none; /* Nascondi SVG su mobile */
    }
}

@media (max-width: 480px) {
    .scroll-heading {
        font-size: 28px;
    }
    
    .feature-icon-large {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .feature-box {
        padding: 1.5rem;
    }
}

/* ==========================================
   SCROLL EFFECT SU TUTTA LA PAGINA
   ========================================== */

/* Background gradient animato durante lo scroll */
body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    animation: bodyColorFade linear forwards;
    animation-timeline: scroll();
    animation-range: 0% 100%;
}

@keyframes bodyColorFade {
    0% {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }
    25% {
        background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    }
    50% {
        background: linear-gradient(135deg, #ddd6fe 0%, #e9d5ff 100%);
    }
    75% {
        background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    }
    100% {
        background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    }
}

/* ==========================================
   HERO GRADIENT ANIMATED EFFECTS
   ========================================== */

/* Gradient Animato Soft sulla Hero Section */
.hero {
    background: linear-gradient(-45deg, #f8fafc, #e8f0fe, #f3e8ff, #fef3c7) !important;
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Orbs in Background */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    animation: floatOrbs 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatOrbs {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateY(-30px) scale(1.1);
        opacity: 0.8;
    }
}

/* Assicura che il contenuto sia sopra gli orbs */
.hero-content,
.hero-demo,
.stats-banner,
.hero-cta {
    position: relative;
    z-index: 1;
}

/* ==========================================
   PARALLAX & SCROLL ANIMATIONS
   ========================================== */

/* Parallax effect sugli elementi */
.hero-content,
.stats-banner,
.demo-window {
    animation: parallaxFloat linear both;
    animation-timeline: scroll();
    animation-range: 0% 50%;
}

@keyframes parallaxFloat {
    to {
        transform: translateY(-30px);
    }
}

/* Features cards con stagger effect migliorato */
.feature-card {
    animation: scaleInStagger linear both;
    animation-timeline: view();
    animation-range: 0% 40%;
}

@keyframes scaleInStagger {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Pricing card con effetto bounce */
.pricing-card {
    animation: bounceIn linear both;
    animation-timeline: view();
    animation-range: 0% 40%;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Demo section con slide in */
.demo-login {
    animation: slideInUp linear both;
    animation-timeline: view();
    animation-range: 0% 40%;
}

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

/* Header con blur progressivo */
.header {
    animation: headerBlur linear both;
    animation-timeline: scroll();
    animation-range: 0 100px;
}

@keyframes headerBlur {
    from {
        backdrop-filter: blur(0px);
        background: rgba(255, 255, 255, 0.7);
    }
    to {
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    }
}

/* Footer con fade in */
.footer {
    animation: fadeInFooter linear both;
    animation-timeline: view();
    animation-range: 0% 30%;
}

@keyframes fadeInFooter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================
   RESPONSIVE ANIMATIONS
   ========================================== */

/* Riduci animazioni su mobile per performance */
@media (max-width: 768px) {
    .hero {
        animation: gradientShift 20s ease infinite;
    }
    
    .hero::before {
        animation: none;
        opacity: 0.5;
    }
    
    body {
        animation: none;
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }
    
    .hero-content,
    .stats-banner,
    .demo-window {
        animation: none;
    }
}
