:root {
    --primary: #0056b3;
    --primary-hover: #004494;
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #212529;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 40px 20px;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.large-container {
    max-width: 1000px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    margin-top: 0;
    font-size: 24px;
    color: var(--primary);
}

header p {
    color: var(--text-muted);
}

.upload-box {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 50px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.upload-box.dragover {
    background: #eef2f5;
    border-color: var(--primary);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-box h2 {
    font-size: 18px;
    margin: 0 0 5px;
}

.upload-box p {
    color: var(--text-muted);
    margin: 0 0 20px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    width: 100%;
    font-size: 16px;
    padding: 12px;
}

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

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.outline-btn {
    color: var(--primary);
    border-color: var(--primary);
}

.options {
    margin-bottom: 20px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

#selected-file {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    background: #eef2f5;
    padding: 10px;
    border-radius: 6px;
}

.spinner {
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

#loading {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

.error-alert, .warning-alert {
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 14px;
}

.error-alert {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.warning-alert {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    margin-bottom: 20px;
}

.warning-alert ul {
    margin: 5px 0 0;
    padding-left: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    background: #fafafa;
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f4f6f8;
    color: var(--text-muted);
    font-weight: 600;
}

.conf-bar-bg {
    width: 100%;
    background: #e9ecef;
    height: 6px;
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.conf-bar-fill {
    height: 100%;
    background: var(--success);
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge.auto_mapped { background: #d1e7dd; color: #0f5132; }
.badge.suggested { background: #fff3cd; color: #664d03; }
.badge.unmapped { background: #f8d7da; color: #842029; }

.method {
    font-size: 12px;
    color: var(--text-muted);
}
