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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    line-height: 1.5;
}

/* Nav */
.nav {
    background: #1a2332;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-brand {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}
.nav-link {
    color: #8899aa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: #fff; }
.nav-status {
    margin-left: auto;
    color: #5a9;
    font-size: 13px;
}

/* Container */
.container {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.card h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #1a2332;
}
.card p.subtitle {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Upload area */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-area:hover { border-color: #4A90D9; background: #f8fbff; }
.upload-area.dragover { border-color: #4A90D9; background: #eef5ff; }
.upload-area p { color: #888; }
.upload-area .filename { color: #1a2332; font-weight: 600; }
input[type="file"] { display: none; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: #4A90D9; color: #fff; }
.btn-primary:hover { background: #3a7bc8; }
.btn-primary:disabled { background: #b0c4de; cursor: not-allowed; }
.btn-secondary { background: #e8ecf0; color: #333; }
.btn-secondary:hover { background: #d8dce0; }
.btn-success { background: #3daa6d; color: #fff; }
.btn-success:hover { background: #2d9a5d; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: #e25555; color: #fff; }
.btn-danger:hover { background: #d04545; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #444;
}
select, input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}
select:focus, input[type="number"]:focus {
    outline: none;
    border-color: #4A90D9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

/* Order table */
.order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.order-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid #eee;
}
.order-table td {
    padding: 6px 10px;
    vertical-align: middle;
}
.order-table .row-num {
    width: 40px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Client info bar */
.client-info {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: #f0f7ff;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.client-info .label { color: #666; }
.client-info .value { font-weight: 600; color: #1a2332; }

/* Results */
.results-section { margin-top: 32px; }
.results-section h3 {
    font-size: 17px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.results-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f5f7fa;
    font-weight: 500;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #e0e3e8;
}
.results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.results-table tr:hover { background: #fafbfc; }

/* Priority indicators */
.priority-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}
.priority-high { background: #e25555; }
.priority-medium { background: #f0a030; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.tag-missing { background: #fde8e8; color: #c03030; }
.tag-low-qty { background: #fff3e0; color: #b07020; }
.tag-yes { background: #e6f4ea; color: #2d7a3a; }
.tag-no { background: #f5f5f5; color: #888; }

.n4-list {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Summary stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-item {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a2332;
}
.stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Spinner */
.spinner {
    display: none;
    text-align: center;
    padding: 32px;
    color: #4A90D9;
}
.spinner.active { display: block; }
.spinner::after {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e0e3e8;
    border-top-color: #4A90D9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Flash messages */
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.flash-success { background: #e6f4ea; color: #2d7a3a; }
.flash-error { background: #fde8e8; color: #c03030; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .container { margin: 16px auto; }
    .card { padding: 20px; }
    .client-info { flex-direction: column; gap: 8px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
