/* Importar histórico (arquivo) — aba de /migrar-conversas.html (03/10/2026) */
.page-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-base); border-radius: var(--r-pill); margin-bottom: 18px; width: fit-content; max-width: 100%; }
.page-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 13px; border-radius: var(--r-pill); color: var(--text-secondary); font-weight: 600; text-decoration: none; }
.page-tabs a.active { background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--shadow-sm); }

#pane-importar { max-width: 980px; }
.ih-card { background: var(--bg-elevated); border: 0.5px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 14px; min-width: 0; }
.ih-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 10px; }
.ih-card h3 .n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ih-card p.ih-ajuda { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 12px; }
.ih-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ih-row > * { min-width: 0; }
.ih-btn { display: inline-flex !important; align-items: center; gap: 8px; }
.ih-drop { border: 1.5px dashed var(--border); border-radius: var(--r-md); padding: 18px; text-align: center; cursor: pointer; color: var(--text-secondary); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ih-drop i { font-size: 26px; opacity: .7; }
.ih-drop.over, .ih-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.ih-drop .ih-files { font-size: 12.5px; color: var(--text-primary); font-weight: 600; word-break: break-word; }
.ih-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ih-kpi { background: var(--bg-base); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.ih-kpi .l { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.ih-kpi .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.ih-kpi .s { font-size: 11.5px; color: var(--text-tertiary); }
.ih-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(52,199,89,.14); color: #1f8f3e; font-weight: 600; }
.ih-warn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(255,149,0,.15); color: #b36200; font-weight: 600; }
.ih-sub { font-weight: 600; font-size: 12px; color: var(--text-secondary); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.ih-fonte { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg-base); margin-bottom: 6px; font-size: 13px; cursor: pointer; }
.ih-fonte input { width: 16px; height: 16px; flex-shrink: 0; }
.ih-fonte .d { color: var(--text-tertiary); font-size: 12px; margin-left: auto; text-align: right; }
.ih-map { display: flex; flex-direction: column; gap: 6px; }
.ih-map-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 90px minmax(0, 1.2fr); gap: 10px; align-items: center; padding: 6px 10px; border-radius: var(--r-sm); background: var(--bg-base); font-size: 13px; }
.ih-map-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ih-map-row .q { color: var(--text-tertiary); font-size: 12px; text-align: right; }
.ih-map-row select { width: 100%; font-size: 12.5px; padding: 6px 8px; }
.ih-map-row .como { font-size: 10.5px; color: var(--text-tertiary); display: block; }
.ih-opt { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-secondary); margin: 8px 0; cursor: pointer; line-height: 1.45; }
.ih-opt input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.ih-bar { height: 12px; border-radius: 6px; background: var(--bg-base); overflow: hidden; margin: 10px 0 8px; }
.ih-bar > div { height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.ih-prog { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-secondary); }
.ih-prog b { color: var(--text-primary); }
.ih-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.ih-hist { font-size: 12.5px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }
.ih-hist div { display: flex; flex-wrap: wrap; gap: 6px; }

/* Modal de confirmação: fecha só por X, Cancelar ou Esc */
.ih-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 18px; }
.ih-modal-bg.show { display: flex; }
.ih-modal { background: var(--bg-elevated); border-radius: var(--r-lg); width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.ih-modal .hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 0.5px solid var(--divider); }
.ih-modal .hd h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0; }
.ih-modal .hd .x { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 8px; cursor: pointer; color: var(--text-secondary); font-size: 17px; flex-shrink: 0; }
.ih-modal .hd .x:hover { background: var(--bg-hover); }
.ih-modal .bd { padding: 16px 18px; overflow-y: auto; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.ih-modal .bd ul { margin: 8px 0 0; padding-left: 18px; }
.ih-modal .ft { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px; border-top: 0.5px solid var(--divider); }

@media (max-width: 600px) {
    .ih-card { padding: 14px; }
    .ih-map-row { grid-template-columns: minmax(0, 1fr) auto; }
    .ih-map-row select { grid-column: 1 / -1; }
    .ih-fonte { flex-wrap: wrap; }
    .ih-fonte .d { margin-left: 26px; text-align: left; width: 100%; }
    .ih-actions .ui-btn { flex: 1 1 auto; justify-content: center; }
    .ih-modal-bg { align-items: flex-end; padding: 0; }
    .ih-modal { border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: calc(100dvh - 24px); }
    .ih-modal .ft { position: sticky; bottom: 0; background: var(--bg-elevated); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
