:root {
  color-scheme: dark;
  --bg: #030d1d;
  --bg-soft: #06152b;
  --panel: #081d37;
  --panel-2: #0b2442;
  --line: #183c62;
  --line-soft: #112f50;
  --text: #f6f9ff;
  --muted: #91a8c5;
  --blue: #0b8cff;
  --cyan: #16c7f4;
  --green: #31cf63;
  --amber: #ffb313;
  --coral: #ff4b32;
  --red: #ff3158;
  --shadow: 0 20px 50px rgba(0, 6, 19, .3);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, label:focus-within { outline: 2px solid #22a7ff; outline-offset: 2px; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 188px; overflow: hidden;
  display: flex; flex-direction: column; background: linear-gradient(180deg, #071a35, #06162d 65%, #082246);
  border-right: 1px solid #0d3156;
}
.sidebar::before, .sidebar::after { content: ""; position: absolute; left: -65px; width: 310px; height: 110px; border-radius: 55% 45% 0 0; transform: rotate(-18deg); opacity: .9; }
.sidebar::before { bottom: 115px; background: linear-gradient(90deg, #097cff, #04bfca, #5dd932, #f4df20); clip-path: polygon(0 68%, 100% 10%, 100% 46%, 0 100%); }
.sidebar::after { bottom: 180px; background: linear-gradient(90deg, #fa3155, #7a1a80, #086ada); clip-path: polygon(0 40%, 100% 0, 100% 22%, 0 83%); }
.brand { position: relative; z-index: 1; height: 88px; display: flex; align-items: center; padding: 12px 13px; color: #fff; text-decoration: none; border-bottom: 1px solid #153858; }
.logo-composite { display: flex; align-items: center; gap: 2px; min-width: 0; }
.logo-crop { position: relative; display: block; flex: 0 0 auto; overflow: hidden; }
.logo-crop img { position: absolute; width: 70px; max-width: none; left: -10px; top: -9px; }
.logo-mark { width: 54px; height: 42px; }
.logo-mark.small { width: 45px; height: 38px; }
.logo-mark.small img { width: 62px; left: -9px; top: -8px; }
.brand-text { color: #fff; font-size: 23px; font-weight: 800; letter-spacing: -.8px; white-space: nowrap; }
.brand-color { background: linear-gradient(90deg, #ff3c2d 4%, #ffb413 44%, #42da48 70%, #1384ff); color: transparent; background-clip: text; -webkit-background-clip: text; }
.sidebar-nav { position: relative; z-index: 1; display: grid; gap: 6px; padding: 26px 10px; }
.nav-item { height: 49px; display: flex; align-items: center; gap: 17px; padding: 0 15px; border: 0; border-radius: 9px; color: #a8bed9; background: transparent; text-align: left; transition: .2s ease; }
.nav-item svg { width: 23px; height: 23px; color: #96c5fa; }
.nav-item:hover { color: #fff; background: rgba(25, 103, 184, .26); }
.nav-item.active { color: #3ab7ff; background: linear-gradient(90deg, #0c3c70, #0b3972); box-shadow: inset 4px 0 #0a9dff; }
.nav-item.active svg { color: #2cb4ff; }
.sidebar-card { position: relative; z-index: 2; margin: auto 10px 18px; padding: 13px 10px; display: flex; gap: 8px; align-items: flex-start; border: 1px solid #17436f; border-radius: 10px; background: rgba(4, 19, 42, .93); box-shadow: var(--shadow); }
.sidebar-card strong { font-size: 11px; }
.sidebar-card p { margin: 4px 0 0; color: #9db6d1; font-size: 10px; line-height: 1.7; }

.app-main { min-height: 100vh; margin-left: 188px; }
.topbar { height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 20px; padding: 0 20px; background: linear-gradient(110deg, #061a37 0%, #0b2547 52%, #0a1b36 100%); border-bottom: 1px solid #143653; }
.mobile-brand { display: none; }
.privacy-pill { color: #8daccc; font-size: 11px; margin-right: auto; }
.privacy-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #26d675; box-shadow: 0 0 10px #26d675; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; color: #bfd3e9; background: #0c294a; }
.icon-button:hover { border-color: #24547c; color: #fff; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #228cff, #2b54d8); box-shadow: 0 0 0 1px #468ce3; }

.progress { min-height: 86px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 12px 20px; border-bottom: 1px solid #0e2f50; background: #031226; }
.progress-step { position: relative; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px 20px 6px 2px; border: 0; color: var(--text); background: transparent; text-align: left; }
.progress-step > span:nth-child(2) { min-width: 0; display: grid; gap: 5px; }
.progress-step strong { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.progress-step small { overflow: hidden; color: #859eba; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.progress-step i { position: absolute; right: 8px; color: #66839f; font-size: 35px; font-style: normal; font-weight: 200; }
.progress-step.active::after { content: ""; position: absolute; inset: auto 28px -12px 0; height: 2px; background: linear-gradient(90deg, #008cff, transparent); }
.step-number, .mini-step { flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; box-shadow: inset 0 1px 2px rgba(255,255,255,.45), 0 6px 15px rgba(0,0,0,.25); }
.step-number { width: 48px; height: 48px; font-size: 20px; }
.mini-step { width: 36px; height: 36px; font-size: 16px; }
.blue { background: linear-gradient(145deg, #10b0ff, #075fe2); }
.amber { background: linear-gradient(145deg, #ffd027, #f39500); }
.coral { background: linear-gradient(145deg, #ff714e, #f32027); }
.green { background: linear-gradient(145deg, #9fe526, #08a853); }

.workspace { padding: 0 14px 14px; background: radial-gradient(circle at 60% 15%, rgba(0, 105, 187, .08), transparent 35%), var(--bg); }
.setup-grid { display: grid; grid-template-columns: 345px minmax(510px, 1fr) 405px; gap: 12px; padding-top: 0; }
.results-grid { display: grid; grid-template-columns: minmax(650px, 1fr) 430px; gap: 12px; margin-top: 12px; }
.card { min-width: 0; background: linear-gradient(150deg, rgba(10, 34, 65, .98), rgba(5, 24, 46, .98)); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 12px 34px rgba(0, 3, 13, .2); }
.setup-grid > .card { height: 390px; }
.results-grid > .card { height: 376px; }
.card-heading { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 9px; }
.card-heading h1, .card-heading h2 { margin: 1px 0 4px; font-size: 15px; line-height: 1.2; }
.card-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.heading-row { align-items: center; justify-content: space-between; }
.heading-group { min-width: 0; display: flex; align-items: flex-start; gap: 12px; }

.drop-zone { height: 113px; margin: 0 12px 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1.5px dashed #3c7eaf; border-radius: 9px; color: #bcd6ed; background: rgba(18, 56, 89, .48); transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: #28baff; background: rgba(15, 80, 129, .55); transform: translateY(-1px); }
.drop-zone svg { width: 35px; height: 35px; margin-bottom: 4px; color: #9acbee; }
.drop-zone strong { font-size: 11px; }
.drop-zone span { margin-top: 3px; color: #8ea9c5; font-size: 9px; }
.drop-zone small { margin-top: 7px; color: #a7c0da; font-size: 8px; }
.file-list { max-height: 198px; padding: 0 12px; overflow: auto; scrollbar-width: thin; scrollbar-color: #1f527e transparent; }
.empty-files { min-height: 76px; display: grid; place-content: center; text-align: center; color: #7791ad; }
.empty-files small { margin-top: 5px; font-size: 9px; }
.file-item { min-height: 53px; display: grid; grid-template-columns: 37px 1fr 25px; align-items: center; gap: 9px; margin-bottom: 6px; padding: 6px 7px; border: 1px solid #1a3e60; border-radius: 8px; background: #0c2947; }
.file-icon { width: 31px; height: 36px; display: grid; place-items: center; border-radius: 4px; color: #fff; font-size: 8px; font-weight: 800; background: linear-gradient(145deg, #24b15f, #078047); }
.file-icon.csv { background: linear-gradient(145deg, #ffb11d, #f16c06); }
.file-icon.pdf { background: linear-gradient(145deg, #ff5b5b, #ef182d); }
.file-icon.txt { background: linear-gradient(145deg, #30a7ff, #1766d7); }
.file-info { min-width: 0; display: grid; gap: 4px; }
.file-info strong { overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.file-info small { color: #91a8c0; font-size: 8px; }
.remove-file { width: 25px; height: 25px; padding: 0; border: 0; color: #9cb5cf; background: transparent; font-size: 18px; }
.remove-file:hover { color: #ff6680; }
.inline-status { min-height: 14px; margin: 2px 12px; color: #65d89a; font-size: 9px; }

.auto-badge { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 9px; border: 1px solid #1a75c6; border-radius: 7px; color: #acd8ff; background: #0c3b6e; font-size: 9px; }
.auto-badge:hover:not(:disabled) { color: #fff; border-color: #38a9ff; }
.auto-badge:disabled { cursor: not-allowed; opacity: .45; }
.auto-badge svg { width: 14px; height: 14px; }
.mapping-wrap { height: 285px; overflow: auto; scrollbar-width: thin; scrollbar-color: #205883 transparent; border-top: 1px solid #113556; border-bottom: 1px solid #113556; }
.mapping-table { display: grid; min-width: 520px; }
.map-row { display: grid; align-items: center; min-height: 38px; border-bottom: 1px solid #113557; }
.map-row:last-child { border-bottom: 0; }
.map-cell { min-width: 0; padding: 6px 9px; border-right: 1px solid #113557; color: #dae7f5; font-size: 9px; }
.map-cell:last-child { border-right: 0; }
.map-head { position: sticky; top: 0; z-index: 2; min-height: 32px; font-weight: 600; background: #0d3158; }
.map-head .map-cell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.map-standard { font-weight: 600; }
.map-standard small { margin-left: 4px; color: #7797b8; }
.mapping-table select, .control-label select, .compare-mode { width: 100%; min-width: 0; height: 29px; padding: 0 25px 0 8px; border: 1px solid #264f75; border-radius: 6px; color: #e8f1fb; background: #0d2a48; font-size: 9px; }
.empty-mapping::before { content: "Carga archivos para ver el mapeo automático de columnas"; height: 265px; display: grid; place-items: center; color: #7792ad; font-size: 10px; }
.mapping-footer { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; color: #afc3d8; font-size: 9px; }
.mapping-footer label, .mapping-footer span { display: flex; align-items: center; gap: 6px; }
.mapping-footer button { display: flex; align-items: center; gap: 6px; padding: 5px 7px; border: 0; border-radius: 5px; color: #17a7ff; background: transparent; font-size: 9px; }
.mapping-footer button:hover:not(:disabled) { background: #0d3358; }
.mapping-footer button:disabled { cursor: not-allowed; color: #5d7690; }
.mapping-footer svg { width: 14px; height: 14px; }

.compare-card { padding-bottom: 7px; }
.control-label { display: grid; grid-template-columns: 1fr 155px; align-items: center; gap: 8px; margin: 2px 12px 9px; color: #e0eaf5; font-size: 9px; font-weight: 600; }
.compare-title { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid #113655; border-bottom: 1px solid #113655; font-size: 9px; }
.compare-title label { color: #b1c2d4; font-size: 8px; font-weight: 400; }
input[type="checkbox"] { width: 14px; height: 14px; accent-color: #148df2; vertical-align: middle; }
.compare-fields { height: 181px; overflow: auto; padding: 5px 12px; scrollbar-width: thin; scrollbar-color: #205883 transparent; }
.compare-field { display: grid; grid-template-columns: 18px 1fr 145px; align-items: center; gap: 7px; min-height: 32px; color: #ccdaea; font-size: 9px; }
.compare-button { width: calc(100% - 24px); height: 42px; margin: 3px 12px 0; display: flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 9px; color: #fff; font-weight: 800; background: linear-gradient(105deg, #ff1e4e, #ff6b17 58%, #ffd817); box-shadow: 0 7px 20px rgba(255, 87, 22, .15); }
.compare-button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.compare-button:disabled { cursor: not-allowed; opacity: .4; }
.compare-button svg { width: 16px; height: 16px; fill: currentColor; }

.results-heading { min-height: 59px; padding-bottom: 8px; }
.result-tools { position: relative; display: flex; gap: 7px; }
.search-box { width: 225px; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid #2c5277; border-radius: 7px; background: #071c34; }
.search-box svg { flex: 0 0 auto; width: 15px; height: 15px; color: #8eabc8; }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: #fff; background: transparent; font-size: 9px; }
.search-box input::placeholder { color: #718ba6; }
.filter-button { display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #284f74; border-radius: 7px; color: #c4d3e4; background: #0b2745; font-size: 9px; }
.filter-button svg { width: 14px; height: 14px; }
.filter-popover { position: absolute; z-index: 8; top: 41px; right: 0; width: 210px; padding: 11px; border: 1px solid #285478; border-radius: 9px; background: #0a2340; box-shadow: 0 14px 35px rgba(0,0,0,.42); }
.filter-popover label { display: grid; gap: 6px; color: #9eb5cb; font-size: 9px; }
.filter-popover select { width: 100%; height: 32px; padding: 0 8px; border: 1px solid #315a7e; border-radius: 6px; color: #ecf5ff; background: #0d2d4d; font-size: 9px; }
.filter-popover button { width: 100%; margin-top: 9px; padding: 7px; border: 1px solid #2a5376; border-radius: 6px; color: #bcd0e3; background: #102e4d; font-size: 9px; }
.status-tabs { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 4px 12px; border-top: 1px solid #0e2f4d; }
.status-tab { height: 28px; padding: 0 12px; border: 1px solid #284b6e; border-radius: 8px; color: #b9cce0; background: #0a213c; font-size: 9px; }
.status-tab span { margin-left: 4px; padding: 2px 5px; border-radius: 5px; background: #33526f; }
.status-tab.active { color: #fff; border-color: #83a6c8; background: #244463; }
.status-tab.exact { color: #31df86; border-color: #067d52; }
.status-tab.possible { color: #ffd21d; border-color: #9c7600; }
.status-tab.exclusive { color: #40aaff; border-color: #075b9c; }
.status-tab.conflict { color: #ff6280; border-color: #92263f; }
.data-table-wrap { height: 228px; overflow: auto; border-top: 1px solid #113658; border-bottom: 1px solid #113658; scrollbar-width: thin; scrollbar-color: #205883 transparent; }
.data-table { width: 100%; min-width: 890px; border-collapse: collapse; }
.data-table th, .data-table td { height: 34px; padding: 5px 9px; border-right: 1px solid #0e2d4b; border-bottom: 1px solid #0d2d4c; text-align: left; font-size: 8.5px; white-space: nowrap; }
.data-table th { position: sticky; top: 0; z-index: 2; height: 30px; color: #bdd0e4; background: #0c2b4d; font-weight: 600; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover, .data-table tbody tr.selected { background: #0d3155; }
.data-table td:last-child, .data-table th:last-child { text-align: center; }
.status-chip { display: inline-flex; min-width: 60px; justify-content: center; padding: 4px 8px; border-radius: 12px; color: #fff; font-size: 8px; font-weight: 700; }
.status-chip.Exacto { background: linear-gradient(90deg, #0fbb54, #06a74e); }
.status-chip.Posible { color: #142333; background: #ffc71b; }
.status-chip.Conflicto { background: #e52a4d; }
.source-dots { display: flex; gap: 4px; }
.source-dot { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 3px; color: #fff; font-size: 6px; font-weight: 800; background: #0ea65b; }
.source-dot:nth-child(2) { background: #f79408; }
.source-dot:nth-child(3) { background: #ed3046; }
.row-action { border: 0; color: #b3c7dc; background: transparent; font-size: 16px; }
.empty-row td { height: 192px; text-align: center !important; color: #718aa4; }
.empty-row td > * { margin: 3px auto; display: block; }
.empty-row svg { width: 30px; height: 30px; }
.empty-row strong { color: #a2b7cd; font-size: 10px; }
.empty-row span { font-size: 9px; }
.table-footer { height: 45px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; color: #91a7be; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination button, .pagination b { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #183f66; border-radius: 6px; color: #adc1d5; background: #0b2746; }
.pagination b { color: #fff; background: #0d7fdf; }

.detail-card { display: flex; flex-direction: column; }
.detail-heading { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border-bottom: 1px solid #153956; font-size: 10px; }
.detail-heading > div { display: flex; align-items: center; gap: 8px; }
.detail-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #70d628, #07965b); }
.detail-icon svg { width: 18px; height: 18px; }
.group-number { padding: 6px 8px; border: 1px solid #285073; border-radius: 6px; color: #9fb3c8; font-size: 8px; }
.detail-tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: 34px; border-bottom: 1px solid #163a5c; }
.detail-tabs button { border: 0; border-bottom: 2px solid transparent; color: #8da5be; background: transparent; font-size: 8px; }
.detail-tabs button.active { color: #fff; border-color: #138eff; background: #0c4684; }
.detail-content { flex: 1; min-height: 0; overflow: auto; padding: 9px 11px; scrollbar-width: thin; scrollbar-color: #205883 transparent; }
.detail-empty { height: 100%; display: grid; place-content: center; justify-items: center; color: #7590ab; text-align: center; }
.detail-empty svg { width: 32px; height: 32px; margin-bottom: 8px; }
.detail-empty strong { color: #adbed0; font-size: 10px; }
.detail-empty p { max-width: 255px; margin: 6px 0 0; font-size: 9px; line-height: 1.5; }
.detail-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.detail-summary h3 { overflow: hidden; margin: 0; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.detail-summary small { display: block; margin-top: 4px; color: #7f9ab6; font-size: 8px; }
.detail-source { display: grid; grid-template-columns: 31px 92px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid #123552; font-size: 8px; }
.detail-source .file-icon { width: 27px; height: 32px; }
.detail-source strong { overflow: hidden; padding-top: 3px; white-space: nowrap; text-overflow: ellipsis; }
.detail-fields { display: grid; grid-template-columns: 62px 1fr; gap: 3px 5px; color: #d2dfed; }
.detail-fields span:nth-child(odd) { color: #8da5bc; }
.match-label { align-self: center; padding: 4px 6px; border: 1px solid #078150; border-radius: 5px; color: #25dc7a; background: #063e35; font-size: 7px; }
.history-card { display: grid; gap: 0; border: 1px solid #173d5f; border-radius: 8px; overflow: hidden; }
.history-card > div { display: grid; grid-template-columns: 105px 1fr; gap: 10px; padding: 9px 10px; border-bottom: 1px solid #143653; font-size: 8px; }
.history-card > div:last-child { border-bottom: 0; }
.history-card span { color: #819ab3; }
.history-card b { color: #d8e5f2; font-weight: 500; }
.export-bar { min-height: 48px; display: flex; justify-content: flex-end; gap: 7px; padding: 7px 10px; border-top: 1px solid #153958; }
.export-bar button { display: flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid #285174; border-radius: 7px; color: #c6d7e9; background: #0b2b4b; font-size: 8px; }
.export-bar button:disabled { cursor: not-allowed; opacity: .35; }
.export-bar .primary-export { border-color: #0c74c7; color: #fff; background: #0877d4; }
.export-bar svg { width: 13px; height: 13px; }

/* Flujo enfocado: una decisión por pantalla */
.workspace { min-height: calc(100vh - 148px); padding: 22px 24px 86px; }
.flow-screen { display: none; width: min(1320px, 100%); margin: 0 auto; animation: screen-in .24s ease; }
.flow-screen.active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stage-intro { display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: start; margin: 0 0 18px; }
.stage-intro > span { display: inline-flex; justify-content: center; padding: 7px 9px; border: 1px solid #1d5f92; border-radius: 999px; color: #67caff; background: #082948; font-size: 9px; font-weight: 700; }
.stage-intro h1 { margin: 0 0 6px; font-size: clamp(20px, 2vw, 28px); letter-spacing: -.5px; }
.stage-intro p { max-width: 840px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.stage-intro.compact { margin-bottom: 12px; }
.upload-layout { display: grid; grid-template-columns: minmax(520px, 1.35fr) minmax(300px, .65fr); gap: 16px; }
.upload-layout > .card { min-height: 430px; }
.upload-card .drop-zone { height: 148px; }
.upload-card .file-list { max-height: 190px; }
.guidance-card { padding: 34px; background: radial-gradient(circle at 90% 10%, rgba(22, 199, 244, .15), transparent 35%), linear-gradient(150deg, #0a2443, #07182e); }
.guidance-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 22px; border: 1px solid #2477a8; border-radius: 16px; color: #5dd7ff; background: #0b355b; }
.guidance-icon svg { width: 28px; height: 28px; }
.guidance-card h2 { margin: 0 0 12px; font-size: 18px; }
.guidance-card p { margin: 0; color: #a9c0d8; line-height: 1.7; }
.guidance-card ul { display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; color: #c9daeb; }
.guidance-card li { position: relative; padding-left: 22px; }
.guidance-card li::before { content: "✓"; position: absolute; left: 0; color: #35d987; font-weight: 800; }
.stage-card { min-height: 465px; }
.stage-card .mapping-wrap { height: 340px; }
.stage-card .empty-mapping::before { height: 320px; }
.compare-layout { display: grid; grid-template-columns: minmax(600px, 1fr) 330px; gap: 16px; }
.compare-card.stage-card { min-height: 490px; padding-bottom: 12px; }
.compare-card .control-label { grid-template-columns: 1fr 280px; margin-top: 5px; }
.holistic-note { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; margin: 0 12px 10px; padding: 10px 12px; border: 1px solid #1e5b88; border-radius: 8px; color: #bcd8ee; background: #082c4e; }
.holistic-note svg { width: 20px; height: 20px; margin-top: 1px; color: #50cbff; }
.holistic-note div { display: grid; gap: 4px; }
.holistic-note strong { color: #eef8ff; font-size: 10px; }
.holistic-note span { font-size: 9px; line-height: 1.45; }
.compare-card .compare-fields { height: 190px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.score-card { padding: 25px; }
.score-card h2 { margin: 0 0 18px; font-size: 16px; }
.score-card > div { display: grid; gap: 5px; padding: 14px 0; border-top: 1px solid #163b5b; }
.score-card b { color: #eef6ff; font-size: 10px; }
.score-card span { color: #91aac3; font-size: 9px; line-height: 1.45; }
.flow-screen .results-grid { grid-template-columns: minmax(650px, 1fr) 400px; margin-top: 0; }
.flow-screen .results-grid > .card { height: 510px; }
.flow-screen .data-table-wrap { height: 348px; }
.export-card { min-height: 360px; display: grid; grid-template-columns: 220px 1fr; gap: 38px; align-items: center; padding: 50px; }
.export-illustration { width: 170px; height: 170px; display: grid; place-items: center; border: 1px solid #1d679b; border-radius: 40px; color: #60d1ff; background: radial-gradient(circle, #0d4777, #071c36 68%); box-shadow: inset 0 0 40px rgba(27, 162, 255, .1); }
.export-illustration svg { width: 70px; height: 70px; }
.export-card h2 { margin: 0 0 8px; font-size: 23px; }
.export-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.export-options { display: flex; gap: 12px; margin-top: 28px; }
.export-options button { min-width: 210px; display: flex; align-items: center; gap: 13px; padding: 14px 18px; border: 1px solid #285174; border-radius: 10px; color: #d6e7f8; background: #0b2b4b; text-align: left; }
.export-options button:disabled { cursor: not-allowed; opacity: .4; }
.export-options .primary-export { border-color: #0c79d1; color: #fff; background: #0877d4; }
.export-options svg { flex: 0 0 auto; width: 24px; height: 24px; }
.export-options span { display: grid; gap: 4px; }
.export-options small { color: #8fb4d3; font-size: 9px; }
.export-options .primary-export small { color: #cae6ff; }
.flow-actions { position: fixed; z-index: 12; right: 24px; bottom: 16px; left: 212px; min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; border: 1px solid #1a456d; border-radius: 12px; background: rgba(5, 22, 43, .93); box-shadow: 0 16px 38px rgba(0,0,0,.35); backdrop-filter: blur(12px); }
.flow-actions button { min-width: 120px; height: 38px; padding: 0 15px; border: 1px solid #28547b; border-radius: 8px; color: #c7d9ea; background: #0b2b4c; }
.flow-actions button:disabled { cursor: not-allowed; opacity: .38; }
.flow-actions .flow-next { border: 0; color: #fff; font-weight: 700; background: linear-gradient(100deg, #087be2, #12a9ef); }
.flow-actions span { color: #7f9bb8; font-size: 9px; text-align: center; }
.status-chip.Diferente { background: #1289ed; }

.preview-dialog { width: min(1050px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); padding: 0; border: 1px solid #2c587e; border-radius: 13px; color: var(--text); background: #071b34; box-shadow: 0 30px 90px rgba(0,0,0,.65); }
.preview-dialog::backdrop { background: rgba(0, 7, 20, .72); backdrop-filter: blur(4px); }
.preview-dialog-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-bottom: 1px solid #214665; }
.preview-dialog-head > div { display: grid; gap: 4px; }
.preview-dialog-head small { color: var(--muted); font-size: 9px; }
.preview-dialog-head button { width: 34px; height: 34px; border: 1px solid #2d5375; border-radius: 7px; color: #b9cde0; background: #0d2d4c; font-size: 22px; }
.preview-table-wrap { max-height: 620px; overflow: auto; scrollbar-width: thin; scrollbar-color: #205883 transparent; }
.preview-table { width: 100%; border-collapse: collapse; }
.preview-table th, .preview-table td { padding: 9px 11px; border-right: 1px solid #143653; border-bottom: 1px solid #143653; text-align: left; font-size: 9px; white-space: nowrap; }
.preview-table th { position: sticky; top: 0; color: #d7e5f3; background: #0d3155; }

body.light { color-scheme: light; --bg: #eaf2fa; --panel: #fff; --panel-2: #f7fbff; --line: #b8cee2; --line-soft: #d9e5ef; --text: #10283f; --muted: #58718a; }
body.light .app-main, body.light .workspace { background: #eaf2fa; }
body.light .card { background: #fff; }
body.light .progress { background: #f5f9fd; }
body.light .progress-step, body.light .card-heading h1, body.light .card-heading h2 { color: #10283f; }
body.light .mapping-table select, body.light .control-label select, body.light .compare-mode, body.light .search-box, body.light .filter-button { color: #183550; background: #eff6fc; }
body.light .drop-zone { color: #385d7d; background: #f2f7fc; }
body.light .file-item, body.light .status-tab, body.light .export-bar button, body.light .pagination button { color: #23445f; background: #f2f7fc; }
body.light .map-head, body.light .data-table th { color: #173a58; background: #dcecf9; }
body.light .map-cell, body.light .map-row, body.light .mapping-wrap, body.light .compare-title, body.light .data-table-wrap, body.light .data-table th, body.light .data-table td, body.light .detail-heading, body.light .detail-tabs, body.light .detail-source, body.light .export-bar { border-color: #d4e2ee; }
body.light .mapping-footer, body.light .compare-field, body.light .control-label, body.light .data-table td, body.light .detail-fields { color: #294862; }
body.light .history-card, body.light .history-card > div { border-color: #d4e2ee; }
body.light .history-card b { color: #21445f; }
body.light .status-tab.active { color: #fff; background: #2b608d; }
body.light .data-table tbody tr:hover, body.light .data-table tbody tr.selected { color: #173a58; background: #e3f1fc; }
body.light .search-box input { color: #183550; }
body.light .filter-popover, body.light .preview-dialog { color: #17334d; background: #fff; }
body.light .filter-popover select, body.light .filter-popover button, body.light .preview-dialog-head button { color: #21445f; background: #eef5fb; }
body.light .preview-table th { color: #173a58; background: #dcecf9; }
body.light .preview-table th, body.light .preview-table td, body.light .preview-dialog-head { border-color: #d4e2ee; }

@media (max-width: 1380px) {
  .setup-grid { grid-template-columns: 310px minmax(450px, 1fr) 355px; }
  .results-grid { grid-template-columns: minmax(600px, 1fr) 380px; }
  .progress-step { gap: 8px; }
  .step-number { width: 42px; height: 42px; }
  .control-label { grid-template-columns: 1fr 130px; }
  .compare-field { grid-template-columns: 18px 1fr 126px; }
}

@media (max-width: 1150px) {
  .sidebar { width: 74px; }
  .brand { padding: 9px; }
  .brand .brand-text, .nav-item span, .sidebar-card { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .app-main { margin-left: 74px; }
  .setup-grid { grid-template-columns: 300px 1fr; }
  .setup-grid > .compare-card { height: auto; min-height: 350px; grid-column: 1 / -1; }
  .compare-fields { height: auto; display: grid; grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
  .results-grid > .card { height: 390px; }
  .upload-layout, .compare-layout { grid-template-columns: 1fr; }
  .guidance-card, .score-card { min-height: auto; }
  .flow-screen .results-grid > .card { height: 470px; }
  .flow-actions { left: 98px; }
}

@media (max-width: 850px) {
  .sidebar { display: none; }
  .app-main { margin-left: 0; }
  .topbar { position: sticky; top: 0; z-index: 20; height: 58px; }
  .mobile-brand { display: flex; align-items: center; margin-right: auto; }
  .mobile-brand .logo-mark { width: 48px; }
  .mobile-brand .brand-text { font-size: 19px; }
  .privacy-pill { display: none; }
  .progress { grid-template-columns: repeat(5, 1fr); position: sticky; top: 58px; z-index: 19; min-height: 68px; padding: 8px; overflow-x: auto; }
  .progress-step { justify-content: center; padding: 4px; }
  .progress-step > span:nth-child(2), .progress-step i { display: none; }
  .progress-step.active::after { inset: auto 6px -8px; }
  .step-number { width: 39px; height: 39px; }
  .workspace { padding: 10px; }
  .setup-grid, .results-grid { display: grid; grid-template-columns: 1fr; }
  .setup-grid > .card, .results-grid > .card { height: auto; min-height: 380px; }
  .setup-grid > .compare-card { grid-column: auto; }
  .mapping-wrap { height: 290px; }
  .results-heading { align-items: flex-start; gap: 10px; }
  .result-tools { width: 100%; }
  .search-box { flex: 1; width: auto; }
  .status-tabs { justify-content: flex-start; overflow-x: auto; }
  .status-tab { flex: 0 0 auto; }
  .data-table-wrap { height: 270px; }
  .detail-card { min-height: 390px !important; }
  .workspace { padding: 16px 12px 86px; }
  .stage-intro { grid-template-columns: 1fr; gap: 10px; }
  .stage-intro > span { width: max-content; }
  .upload-layout > .card { min-height: auto; }
  .flow-actions { right: 10px; bottom: 10px; left: 10px; }
  .flow-actions span { display: none; }
  .export-card { grid-template-columns: 1fr; padding: 30px; text-align: center; }
  .export-illustration { margin: 0 auto; }
  .export-options { justify-content: center; }
}

@media (max-width: 500px) {
  .topbar { padding: 0 12px; }
  .top-actions .icon-button:nth-child(2) { display: none; }
  .setup-grid > .card { min-height: 420px; }
  .card-heading.heading-row { align-items: flex-start; flex-direction: column; }
  .auto-badge { margin-left: 48px; }
  .mapping-wrap { height: 300px; }
  .compare-fields { grid-template-columns: 1fr; height: 220px; display: block; }
  .control-label { grid-template-columns: 1fr; }
  .result-tools { display: none; }
  .results-card { min-height: 440px !important; }
  .results-heading { min-height: 62px; }
  .compare-card .control-label { grid-template-columns: 1fr; }
  .compare-card .compare-fields { display: block; height: 230px; }
  .export-options { flex-direction: column; }
  .flow-actions button { min-width: 105px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
