/* ═══ IMPORT: WECHSEL-BRÜCKE ═══
   Clean Enterprise SaaS, dunkel.

   🔴 Die App kennt --bg-card/--bg-input/--text-dim NICHT (die gibt es nur in
   den Standalone-Seiten). Ein undefiniertes var() ohne Fallback ergibt
   `transparent` — der Dialog war dadurch durchsichtig und der Inhalt
   dahinter las mit. Deshalb hier eigene Tokens, abgeleitet aus denen, die
   core.css wirklich hat. */

.imp-overlay {
    --bg-panel: #14141a;
    --bg-field: rgba(255, 255, 255, 0.04);
    --border-strong: rgba(255, 255, 255, 0.14);
}
[data-theme="light"] .imp-overlay {
    --bg-panel: #ffffff;
    --bg-field: rgba(7, 16, 35, 0.03);
    --border-strong: rgba(7, 16, 35, 0.16);
}

.imp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9200;
    background: rgba(0, 0, 0, 0.9);
    padding: 16px;
    justify-content: center;
    align-items: center;
}
.imp-overlay.open { display: flex; animation: impFade 0.18s ease; }
@keyframes impFade { from { opacity: 0; } to { opacity: 1; } }

.imp-box {
    width: 100%;
    max-width: 760px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
    animation: impPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes impPop { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }

/* ── Kopf ── */
.imp-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.imp-head-icon {
    width: 38px; height: 38px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--primary-dim);
    border: 1px solid var(--border);
    color: var(--primary);
}
.imp-head-icon svg { width: 19px; height: 19px; }
.imp-head-text { flex: 1; min-width: 0; }
.imp-head-text h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text-main); }
.imp-head-text p { margin: 2px 0 0; font-size: 0.76rem; color: var(--text-muted); }

.imp-dots { display: flex; gap: 5px; flex-shrink: 0; }
.imp-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--border);
    transition: background 0.2s;
}
.imp-dot.active { background: var(--primary); }

.imp-close {
    width: 32px; height: 32px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.imp-close svg { width: 15px; height: 15px; }
.imp-close:hover { color: var(--text-main); border-color: var(--border-strong); }

/* ── Körper ── */
.imp-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.imp-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

/* ── Schritt 1 ── */
.imp-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 30px 20px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s ease;
}
.imp-drop:hover, .imp-drop.dragover {
    border-color: var(--primary);
    background: var(--primary-dim);
}
.imp-drop-icon { width: 30px; height: 30px; color: var(--primary); margin-bottom: 6px; }
.imp-drop-main { font-size: 0.94rem; font-weight: 600; color: var(--text-main); }
.imp-drop-sub { font-size: 0.76rem; color: var(--text-muted); }

.imp-or {
    display: flex; align-items: center; gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.74rem;
}
.imp-or::before, .imp-or::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.imp-field { display: flex; flex-direction: column; gap: 7px; }
.imp-label {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-main);
}
.imp-textarea, .imp-select {
    width: 100%;
    padding: 9px 11px;
    background: var(--bg-field);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.15s ease;
}
.imp-textarea { resize: vertical; min-height: 84px; font-family: var(--font-mono); font-size: 0.78rem; }
.imp-textarea:focus, .imp-select:focus { border-color: var(--primary); }
.imp-select { cursor: pointer; }

.imp-hint {
    margin: 16px 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ── Schritt 2 ── */
.imp-file-info {
    margin: 0 0 14px;
    padding: 8px 11px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 0.76rem;
    color: var(--text-main);
    font-family: var(--font-mono);
}
.imp-map-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
    margin-bottom: 16px;
}
.imp-map-row { display: flex; flex-direction: column; gap: 5px; }
.imp-map-label { font-size: 0.75rem; color: var(--text-main); font-weight: 500; }
.imp-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Schritt 3 ── */
.imp-summary {
    padding: 11px 13px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 0.84rem;
    color: var(--text-main);
    margin-bottom: 10px;
}
.imp-summary strong { color: var(--text-main); }

.imp-select-row { display: flex; gap: 14px; margin-bottom: 8px; }
.imp-link {
    background: none; border: none; padding: 0;
    color: var(--primary);
    font-size: 0.76rem;
    font-family: var(--font-main);
    cursor: pointer;
}
.imp-link:hover { text-decoration: underline; }

.imp-table-wrap {
    max-height: 42vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.imp-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.imp-table th {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 8px 9px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.imp-table td {
    padding: 7px 9px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: top;
}
.imp-table tr:last-child td { border-bottom: none; }
.imp-table .imp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.imp-table .imp-num.pos { color: #4ade80; }
.imp-table .imp-num.neg { color: #f87171; }
.imp-note { color: var(--text-muted); }

.imp-row-off td { opacity: 0.4; }
.imp-row-bad td { color: #f87171; font-style: italic; }

.imp-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.66rem;
    background: var(--bg-field);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}
.imp-badge.warn {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.08);
}

/* ── Knöpfe ── */
.imp-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 16px; }
.imp-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}
.imp-btn-ghost { background: var(--bg-elevated); color: var(--text-main); }
.imp-btn-ghost:hover { color: var(--text-main); border-color: var(--border-strong); }
.imp-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.imp-btn-primary:hover { filter: brightness(1.08); }
.imp-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

/* Touch hat kein :hover — die Flaeche muss auch ohne erkennbar tippbar sein. */
@media (hover: none) {
    .imp-drop { border-color: var(--primary); }
    .imp-btn-ghost { color: var(--text-main); }
}

@media (max-width: 640px) {
    .imp-box { max-height: 96vh; }
    .imp-map-grid, .imp-row-2 { grid-template-columns: 1fr; }
    .imp-head-text p { display: none; }
    .imp-table-wrap { max-height: 38vh; }
    .imp-actions { flex-direction: column-reverse; }
    .imp-btn { width: 100%; }
}
