* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

header {
    background: #ffffff;
    color: #2d3748;
    padding: 30px 40px;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo {
    height: 50px;
    width: auto;
}

.header-text {
    flex: 1;
}

header h1 {
    font-size: 2em;
    margin-bottom: 5px;
    font-weight: 700;
    color: #3730a3;
    letter-spacing: -0.5px;
}

header p {
    font-size: 1em;
    color: #64748b;
    font-weight: 400;
}

.tabs {
    display: flex;
    background: #fafbfc;
    border-bottom: 2px solid #e2e8f0;
}

.tab {
    flex: 1;
    padding: 18px 20px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
    border: none;
    background: transparent;
    color: #64748b;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: #f1f5f9;
    color: #3730a3;
}

.tab.active {
    background: white;
    color: #3730a3;
    border-bottom: 3px solid #3730a3;
}

.content {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-section {
    background: #fafbfc;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
}

.upload-section h2 {
    color: #3730a3;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 700;
}

.file-input-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.file-input-group {
    flex: 1;
    min-width: 250px;
}

.file-input-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

input[type="file"]:hover {
    border-color: #3730a3;
}

button {
    background: #3730a3;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(55, 48, 163, 0.25);
}

button:hover {
    background: #312e81;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(55, 48, 163, 0.35);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.chart-container h3 {
    color: #3730a3;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-trend {
    font-size: 0.75em;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
}

.chart-trend.up {
    background: #c6f6d5;
    color: #22543d;
}

.chart-trend.down {
    background: #fed7d7;
    color: #c53030;
}

.chart-trend.same {
    background: #e2e8f0;
    color: #4a5568;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: linear-gradient(135deg, #3730a3 0%, #4338ca 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(55, 48, 163, 0.25);
}

.stat-card h4 {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 2.5em;
    font-weight: 700;
}

.stat-card .trend {
    font-size: 0.9em;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.stat-card .trend.positive {
    background: rgba(255, 255, 255, 0.2);
    color: #c6f6d5;
}

.stat-card .trend.negative {
    background: rgba(255, 255, 255, 0.2);
    color: #fed7d7;
}

.stat-card .trend.neutral {
    background: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3730a3;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #c53030;
}

.success {
    background: #c6f6d5;
    color: #22543d;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #22543d;
}

.filters-section {
    background: #fafbfc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
}

.date-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.date-filters label {
    font-weight: 600;
    color: #4a5568;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filters label[for="month-selector"] {
    font-size: 1.1em;
    font-weight: 700;
    color: #3730a3;
}

.date-filters input[type="date"] {
    padding: 10px 15px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.date-filters input[type="date"]:focus {
    outline: none;
    border-color: #3730a3;
    box-shadow: 0 0 0 3px rgba(55, 48, 163, 0.1);
}

/* Stili per input month - Design moderno e professionale */
.date-filters input[type="month"] {
    padding: 14px 20px;
    padding-left: 45px;
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    color: #2d3748;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 200px;
    position: relative;
}

/* Icona calendario simulata con pseudo-elemento */
.date-filters input[type="month"]::before {
    content: '📅';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    pointer-events: none;
}

.date-filters input[type="month"]:hover {
    border-color: #3730a3;
    background: linear-gradient(135deg, #ffffff 0%, #edf2f7 100%);
    box-shadow: 0 4px 8px rgba(55, 48, 163, 0.15);
    transform: translateY(-1px);
}

.date-filters input[type="month"]:focus {
    outline: none;
    border-color: #3730a3;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(55, 48, 163, 0.1), 0 4px 12px rgba(55, 48, 163, 0.2);
    transform: translateY(-1px);
}

.date-filters input[type="month"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(55, 48, 163, 0.2);
}

/* Stili specifici per Chrome/Edge */
.date-filters input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.date-filters input[type="month"]::-webkit-calendar-picker-indicator:hover {
    background: rgba(55, 48, 163, 0.1);
}


.btn-primary {
    padding: 10px 20px;
    background: #3730a3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #312e81;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(55, 48, 163, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.gantt-placeholder {
    text-align: center;
    padding: 100px 20px;
    color: #4a5568;
    background: #f7fafc;
    border-radius: 15px;
    border: 2px dashed #cbd5e0;
}

.gantt-placeholder h3 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #2d3748;
}

.gantt-placeholder p {
    font-size: 1.2em;
    opacity: 0.8;
}

.team-assign-btn {
    background: #edf2f7;
    color: #4a5568;
    padding: 10px 20px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.team-assign-btn:hover {
    background: #e2e8f0;
    border-color: #a0aec0;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.member-item:hover {
    background: #edf2f7;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.member-name {
    flex: 1;
    font-weight: 600;
    color: #2d3748;
}

.member-stats {
    font-size: 0.9em;
    color: #718096;
}

.team-select {
    padding: 8px 12px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    color: #4a5568;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.team-select:focus {
    outline: none;
    border-color: #667eea;
}

.team-select option[value="dev"] {
    color: #3182ce;
}

.team-select option[value="des"] {
    color: #805ad5;
}

.exclude-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.exclude-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.exclude-label input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    opacity: 0.6;
}

.config-saved {
    display: inline-block;
    background: #c6f6d5;
    color: #22543d;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    margin-left: 10px;
    animation: fadeIn 0.3s;
}

/* Responsive per Header */
@media (max-width: 768px) {
    header {
        padding: 20px 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-logo {
        height: 40px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header p {
        font-size: 0.9em;
    }

    .tab {
        padding: 12px 10px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .header-logo {
        height: 35px;
    }

    header h1 {
        font-size: 1.3em;
    }
}
