:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 2rem 0;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.menu-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    cursor: pointer;
}

.menu-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.menu-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.menu-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.menu-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    min-height: 120px;
    font-family: inherit;
}

/* Cards */
.card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

/* Scanner Video */
#scanner-video {
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    margin: 1rem auto;
    display: block;
}

/* Box Items List */
.items-list {
    list-style: none;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.item-info {
    flex: 1;
}

.item-article {
    font-weight: 600;
    color: var(--primary);
}

.item-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.item-quantity {
    font-weight: 600;
    margin-left: 1rem;
}

.item-actions {
    margin-left: 1rem;
}

/* Assembly Route */
.route-box {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.route-box-header {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.route-item {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* QR Code Display */
.qr-display {
    text-align: center;
    padding: 2rem;
}

.qr-display img {
    max-width: 300px;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

/* Status Messages */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid var(--success);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid var(--danger);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid var(--warning);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    border-top: 2px solid var(--border);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.5rem;
    }
}
