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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    margin-bottom: 20px;
    color: #34495e;
}

.upload-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.file-inputs {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.file-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-input label {
    font-weight: 600;
    color: #555;
}

.file-input input[type="file"] {
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.3s;
}

.file-input input[type="file"]:hover {
    border-color: #3498db;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

#processBtn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

.results-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.export-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.restock-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.restock-table th,
.restock-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.restock-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.restock-table tr:hover {
    background: #f8f9fa;
}

.machine-tag {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
}

.update-btn {
    background: #f39c12;
    font-size: 14px;
    padding: 8px 16px;
    margin-top: 8px;
}

.update-btn:hover {
    background: #e67e22;
}

.status {
    color: #27ae60;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.success {
    background: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .upload-section,
    .results-section {
        padding: 20px;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-buttons button {
        width: 100%;
    }
    
    .restock-table {
        font-size: 14px;
    }
    
    .restock-table th,
    .restock-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .restock-table {
        font-size: 12px;
    }
    
    .restock-table th,
    .restock-table td {
        padding: 6px;
    }
}

.nav-buttons {
    margin-bottom: 20px;
    text-align: center;
}

.nav-buttons button {
    padding: 10px 20px;
    margin: 0 5px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
}

.nav-buttons button.active {
    background: #007bff;
    color: white;
}

.deficit-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.deficit-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    justify-content: space-between;
}

.deficit-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
}

.qty-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 4px;
}

.save-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.machine-deficit {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.machine-deficit label {
    min-width: 50px;
    font-size: 12px;
}

.total-deficit {
    font-weight: bold;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.deficit-controls {
    flex-direction: column;
    align-items: flex-start;
}

.clear-all-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    font-weight: bold;
}

.clear-all-btn:hover {
    background: #c82333;
}