:root {
    --import-success: #22c55e;
    --import-success-glow: rgba(34, 197, 94, 0.18);
    --import-danger: #ef4444;
    --import-danger-glow: rgba(239, 68, 68, 0.18);
    --import-accent: #38bdf8;
    --import-border: rgba(255, 255, 255, 0.1);
    --import-panel: rgba(8, 16, 30, 0.78);
}

body.theme-light {
    --import-border: rgba(15, 23, 42, 0.12);
    --import-panel: rgba(255, 255, 255, 0.88);
}

body {
    font-family: 'Outfit', sans-serif;
}

.import-layout {
    display: grid;
    gap: 24px;
    padding-bottom: 40px;
}

.import-header {
    align-items: flex-start;
}

.page-subtitle {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.import-panel {
    padding: 24px;
}

.intro-panel {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 24px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    color: var(--accent-primary);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.intro-copy h2 {
    margin: 14px 0 10px;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.intro-copy p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.upload-actions {
    display: grid;
    gap: 14px;
}

.file-drop {
    min-height: 120px;
    display: grid;
    place-items: center;
    gap: 10px;
    border-radius: 18px;
    border: 1.5px dashed rgba(56, 189, 248, 0.38);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(34, 197, 94, 0.06));
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    padding: 16px;
}

.file-drop i {
    font-size: 2rem;
    color: var(--import-accent);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
}

.btn-success:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head h3 {
    margin: 0 0 8px;
}

.section-head p {
    margin: 0;
    color: var(--text-muted);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.rule-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--import-border);
    border-radius: 16px;
    background: var(--import-panel);
}

.rule-card span {
    color: var(--text-muted);
    line-height: 1.5;
}

.headers-box {
    border: 1px solid var(--import-border);
    border-radius: 16px;
    overflow: hidden;
}

.headers-title {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    font-weight: 700;
}

.headers-box pre {
    margin: 0;
    padding: 16px;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    display: grid;
    gap: 8px;
    padding: 22px;
}

.stat-card span {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.stat-card strong {
    font-size: 2rem;
}

.stat-card.ok {
    box-shadow: inset 0 0 0 1px var(--import-success-glow);
}

.stat-card.error {
    box-shadow: inset 0 0 0 1px var(--import-danger-glow);
}

.stat-card.accent {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.16);
}

.preview-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.preview-badge.ready {
    background: var(--import-success-glow);
    color: #86efac;
}

.preview-badge.has-errors {
    background: var(--import-danger-glow);
    color: #fca5a5;
}

.alert-box {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
    white-space: pre-wrap;
}

.hidden {
    display: none;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--import-border);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1380px;
}

.preview-table thead th {
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.88);
    color: #e2e8f0;
    text-align: left;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.theme-light .preview-table thead th,
body.theme-aurora-bloom .preview-table thead th,
body.theme-arctic-breeze .preview-table thead th {
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
}

.preview-table th,
.preview-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--import-border);
    vertical-align: top;
}

.preview-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.row-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.row-status.ok {
    background: var(--import-success-glow);
    color: #86efac;
}

.row-status.error {
    background: var(--import-danger-glow);
    color: #fca5a5;
}

.row-errors {
    margin: 0;
    padding-left: 18px;
    color: #fda4af;
    line-height: 1.45;
}

.row-errors.empty {
    padding-left: 0;
    list-style: none;
    color: #86efac;
}

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 28px 14px;
}

@media (max-width: 980px) {
    .intro-panel {
        grid-template-columns: 1fr;
    }

    .section-head {
        flex-direction: column;
    }
}
