* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn:active {
    transform: translateY(0);
}

/* Dashboard */
.container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
}

.header h1 {
    color: #333;
    font-size: 28px;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

.btn-back {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
    margin-right: 10px;
}

.btn-back:hover {
    background: #5a6268;
}

/* Sections */
.upload-section,
.create-section,
.files-section,
.suppliers-section {
    margin-bottom: 40px;
}

.upload-section h2,
.create-section h2,
.files-section h2,
.suppliers-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Upload Form */
.upload-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
}

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

/* File History */
.file-history-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 10px;
    background: #e8f4f8;
    border-left: 4px solid #0288d1;
    border-radius: 3px;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

.file-group-header {
    background: #e3f2fd;
    font-weight: bold;
}

.file-group-header td {
    padding: 12px;
    border-bottom: 2px solid #90caf9;
}

.brand-label {
    background: #1976d2;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.file-row {
    background: white;
}

.file-row:hover {
    background: #f5f5f5;
}

.badge-old {
    display: inline-block;
    background: #ccc;
    color: #666;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.btn-small {
    display: inline-block;
    padding: 6px 12px;
    background: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #45a049;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table thead {
    background: #f8f9fa;
}

table th {
    padding: 12px;
    text-align: left;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #666;
}

table tr:hover {
    background: #f9f9f9;
}

table a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

table a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Badges */
.badge-latest {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* Notifiche */
.notification {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease-out;
    transition: opacity 0.3s ease-out;
}

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

.notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification-success strong {
    margin-right: 8px;
}

.notification-error strong {
    margin-right: 8px;
}

.notification-close {
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .login-box {
        padding: 20px;
    }

    table {
        font-size: 14px;
    }

    table th,
    table td {
        padding: 8px;
    }

    .header h1 {
        font-size: 20px;
    }

    .notification {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .notification-close {
        align-self: flex-end;
    }
}
