:root {
  --ink: #eaf0f6;
  --muted: #8795a7;
  --panel: #111922;
  --panel-2: #16212c;
  --line: #273444;
  --acid: #c8ff4a;
  --cyan: #56d8e5;
  --blue: #6e91ff;
  --red: #ff6d7a;
  --amber: #f9c75c;
  --navy: #091018;
}

* { box-sizing: border-box; }
html { background: var(--navy); }
body { margin: 0; background: var(--navy); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; background: radial-gradient(circle at 78% -10%, rgba(72, 133, 168, .14), transparent 32%), var(--navy); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--line); background: rgba(7, 13, 20, .88); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--acid); color: #0a1300; box-shadow: 0 0 0 5px rgba(200,255,74,.08); font-weight: 900; letter-spacing: -.08em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: #667488; font-size: 8px; letter-spacing: .18em; }
.steps { display: grid; gap: 8px; }
.step { width: 100%; display: flex; gap: 12px; align-items: center; border: 1px solid transparent; border-radius: 13px; padding: 12px; background: transparent; text-align: left; cursor: pointer; transition: .2s ease; }
.step:hover { background: rgba(255,255,255,.035); }
.step.active { border-color: rgba(200,255,74,.2); background: rgba(200,255,74,.07); }
.step.complete { border-color: rgba(200,255,74,.18); background: rgba(200,255,74,.035); }
.step-number { width: 30px; height: 30px; border: 1px solid #354356; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.step.active .step-number { border-color: var(--acid); background: var(--acid); color: #0d1800; }
.step.complete .step-number { color: var(--acid); border-color: rgba(200,255,74,.35); }
.step.active.complete .step-number { color: #0d1800; }
.step strong, .step small { display: block; }
.step strong { font-size: 13px; }
.step small { margin-top: 4px; color: #6f7d8f; font-size: 11px; }
.sidebar-status { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.02); }
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: 11px; }
.sidebar-status small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 5px rgba(200,255,74,.08); }

.workspace { min-width: 0; padding: 36px clamp(24px, 4vw, 64px) 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.eyebrow, .kicker { margin: 0; color: var(--acid); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(26px, 2.5vw, 38px); line-height: 1.05; letter-spacing: -.04em; white-space: nowrap; }
h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.ghost-button, .export-button { border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px; background: rgba(255,255,255,.025); color: #bbc5d1; font-size: 12px; cursor: pointer; }
.danger-button:not(:disabled) { border-color: rgba(255,107,107,.32); color: #ff9a9a; }
.ghost-button:disabled { opacity: .42; cursor: not-allowed; }
.avatar { width: 40px; height: 40px; border: 1px solid #425066; border-radius: 50%; background: #172231; font-size: 12px; font-weight: 800; }

.view-tabs { display: flex; gap: 4px; width: fit-content; margin-bottom: 12px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.view-tab { border: 0; border-radius: 8px; padding: 8px 14px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.view-tab.active { background: rgba(200,255,74,.1); color: var(--acid); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-areas: "main run"; gap: 18px; align-items: start; }
.main-view { grid-area: main; min-width: 0; }
.setup-panel, .results-section { width: 100%; min-width: 0; }
.run-card { grid-area: run; }
.panel, .run-card, .results-section { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(22,33,44,.93), rgba(13,21,30,.96)); box-shadow: 0 24px 70px rgba(0,0,0,.14); }
.panel { border-radius: 20px; padding: 22px; }
.wizard-page[hidden] { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.reset-run-button { padding: 6px 10px; }
.ready-pill { padding: 6px 9px; border-radius: 999px; background: rgba(200,255,74,.09); color: var(--acid); font-size: 10px; font-weight: 800; }
.ready-pill.muted { background: rgba(255,255,255,.045); color: var(--muted); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.upload-card { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 15px; border: 1px dashed #3a4858; border-radius: 15px; background: rgba(255,255,255,.022); cursor: pointer; transition: .2s ease; }
.upload-card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.upload-card.selected { border-style: solid; border-color: rgba(200,255,74,.34); background: rgba(200,255,74,.035); }
.upload-card input { position: absolute; opacity: 0; pointer-events: none; }
.file-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.file-icon.excel { background: rgba(200,255,74,.11); color: var(--acid); }
.file-icon.xml { background: rgba(86,216,229,.1); color: var(--cyan); }
.upload-copy { min-width: 0; }
.upload-copy strong, .upload-copy small { display: block; }
.upload-copy strong { font-size: 12px; }
.upload-copy small { overflow: hidden; margin-top: 5px; color: #aeb9c7; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.change-link { color: var(--cyan); font-size: 10px; font-weight: 700; }
.config-strip { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.configuration-strip { grid-template-columns: 1fr 1fr; }
.config-strip label > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.preset-actions { display: flex; justify-content: flex-start; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(39,52,68,.65); }
.mapping-toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 14px; align-items: end; margin-top: 16px; }
.mapping-selector > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.mapping-toolbar .preset-actions { margin: 0; padding: 0; border: 0; }
select, textarea, input[type="text"], .mapping-row input:not([type="checkbox"]) { width: 100%; border: 1px solid #344254; border-radius: 10px; padding: 10px 11px; background: #0d1620; color: #dbe3eb; outline: none; font-size: 11px; }
select:focus, input:focus { border-color: var(--cyan); }
.mapping-details { margin-top: 14px; border-top: 1px solid var(--line); }
.mapping-details summary { display: flex; justify-content: space-between; padding: 16px 2px 2px; cursor: pointer; font-size: 12px; font-weight: 700; }
.mapping-details summary small { color: var(--muted); font-weight: 400; }
.mapping-table { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wizard-page[data-step-page="2"] .mapping-table { max-height: calc(100vh - 425px); min-height: 240px; overflow: auto; }
.wizard-page[data-step-page="2"] .mapping-header { position: sticky; top: 0; z-index: 3; }
.mapping-row { display: grid; grid-template-columns: 1.15fr 1fr .85fr 1fr 50px; gap: 10px; align-items: center; min-height: 46px; padding: 7px 10px; border-top: 1px solid var(--line); font-size: 10px; }
.mapping-row:first-child { border-top: 0; }
.mapping-row.mapping-header { min-height: 34px; background: rgba(255,255,255,.025); color: #77869a; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.mapping-row select, .mapping-row input:not([type="checkbox"]) { padding: 7px 8px; }
.mapping-row input[type="checkbox"] { accent-color: var(--acid); }
.mapping-source-summary { color: var(--cyan); font-size: 10px; }
.mapping-special { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 2px 0 7px; padding: 12px; border-radius: 10px; background: rgba(79,211,255,.035); }
.mapping-special label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.mapping-special textarea { min-height: 82px; resize: vertical; font-family: Consolas, "Courier New", monospace; line-height: 1.5; }
.concat-editor { grid-template-columns: 2fr 1fr; }
.concat-fields { display: flex; flex-wrap: wrap; gap: 6px; max-height: 130px; overflow: auto; }
.concat-fields label { display: flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: #b9c5d2; }
.concat-options { display: grid; gap: 9px; align-content: start; }
.concat-options label:last-child { display: flex; align-items: center; gap: 7px; }
.filter-list { display: grid; gap: 8px; margin-top: 12px; }
.wizard-page[data-step-page="3"] .filter-list { max-height: calc(100vh - 390px); overflow: auto; }
.filter-row { display: grid; grid-template-columns: 28px 1.2fr 1fr 1fr; gap: 9px; align-items: center; }
.filter-row input[type="checkbox"] { accent-color: var(--acid); }
.filter-row select, .filter-row input:not([type="checkbox"]) { min-width: 0; }
.page-summary { max-width: 320px; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: right; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.wizard-actions-end { justify-content: flex-end; }
.wizard-button { width: auto; min-width: 190px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.run-card { border-radius: 20px; padding: 22px; text-align: center; }
.run-card .kicker { display: block; text-align: left; }
.ring { --progress: 0%; width: 146px; height: 146px; margin: 24px auto; padding: 9px; border-radius: 50%; background: conic-gradient(var(--acid) var(--progress), #263442 0); }
.ring > div { width: 100%; height: 100%; display: grid; place-content: center; border-radius: 50%; background: #101923; }
.ring strong, .ring small { display: block; }
.ring strong { font-size: 31px; letter-spacing: -.04em; }
.ring small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.run-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.run-meta span { padding: 9px; border-radius: 10px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 9px; }
.run-meta strong { display: block; margin-top: 3px; color: var(--ink); font-size: 15px; }
.primary-button { width: 100%; display: flex; justify-content: space-between; border: 0; border-radius: 12px; padding: 13px 15px; background: var(--acid); color: #101800; font-size: 12px; font-weight: 900; cursor: pointer; box-shadow: 0 12px 30px rgba(173,255,43,.12); }
.primary-button:disabled { opacity: .7; cursor: wait; }
.run-card #startButton:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.restart-button { width: 100%; margin-top: 9px; display: flex; justify-content: space-between; }
.restart-button:disabled { opacity: .42; cursor: not-allowed; }
.microcopy { margin: 12px 4px 0; color: #69778a; font-size: 9px; line-height: 1.5; }

.results-section { border-radius: 20px; padding: 22px; }
.results-head { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; }
.metrics { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.metric { padding: 7px 9px; border-radius: 9px; background: rgba(255,255,255,.03); color: var(--muted); font-size: 9px; }
.metric strong { margin-right: 3px; color: var(--ink); font-size: 12px; }
.metric.new strong { color: var(--acid); }.metric.existing strong { color: var(--blue); }.metric.filtered strong { color: var(--amber); }.metric.error strong { color: var(--red); }
.export-button { color: var(--acid); border-color: rgba(200,255,74,.25); }
.export-button:disabled { opacity: .35; }
.result-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.import-footer { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.import-footer strong, .import-footer small { display: block; }
.import-footer strong { margin-top: 7px; font-size: 13px; }
.import-footer small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.import-action { width: min(310px, 100%); flex: 0 0 auto; }
.import-action:disabled { opacity: .42; cursor: not-allowed; }
.result-table { margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.result-row { display: grid; grid-template-columns: 55px 1fr 1fr 110px 1.5fr 70px; align-items: center; min-height: 48px; padding: 0 14px; border-top: 1px solid var(--line); font-size: 11px; animation: row-in .28s ease both; }
.result-row:first-child { border-top: 0; }
.result-row:not(.result-header) { cursor: pointer; }
.result-row:not(.result-header):hover, .result-row:not(.result-header):focus { background: rgba(79,211,255,.035); outline: none; }
.result-header { min-height: 38px; background: rgba(255,255,255,.025); color: #758498; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.result-row button { border: 0; border-radius: 8px; padding: 7px; background: rgba(200,255,74,.08); color: var(--acid); font-size: 9px; cursor: pointer; }
.result-row button:disabled { background: transparent; color: #4d5a69; }
.row-export { border-radius: 8px; padding: 7px; background: rgba(200,255,74,.08); color: var(--acid); font-size: 9px; text-align: center; text-decoration: none; }
.row-export.pending { background: transparent; color: #657285; cursor: not-allowed; }
.no-action { color: #4d5a69; text-align: center; }
.mono { font-family: Consolas, "Courier New", monospace; }.subtle { color: var(--muted); }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; }
.status-dot.new { background: var(--acid); }.status-dot.existing { background: var(--blue); }.status-dot.error { background: var(--red); }.status-dot.filtered { background: var(--amber); }
.empty-state { min-height: 185px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
.empty-state strong { margin-top: 9px; color: #c9d2dc; font-size: 12px; }.empty-state p { margin: 6px 0 0; font-size: 10px; }
.radar { width: 32px; height: 32px; border: 1px solid #3c4a5b; border-radius: 50%; box-shadow: 0 0 0 8px rgba(255,255,255,.018), 0 0 0 16px rgba(255,255,255,.01); position: relative; }
.radar::after { content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--acid); left: 20px; top: 7px; }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }

.detail-dialog { width: min(1120px, calc(100vw - 40px)); max-height: calc(100vh - 50px); border: 1px solid #334153; border-radius: 18px; padding: 0; background: #101923; color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.62); }
.detail-dialog::backdrop { background: rgba(3,8,13,.78); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin-top: 4px; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.detail-meta { padding: 12px 22px; color: var(--muted); font-size: 11px; }
.detail-table { margin: 0 22px 22px; border: 1px solid var(--line); border-radius: 11px; overflow: auto; }
.detail-row { display: grid; grid-template-columns: 1fr 1.35fr .9fr 1fr 1.35fr; min-width: 850px; border-top: 1px solid var(--line); }
.detail-row:first-child { border-top: 0; }
.detail-row > span { padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 10px; }
.detail-header { background: rgba(255,255,255,.03); color: #77869a; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.detail-empty { padding: 26px; color: var(--muted); text-align: center; }

.privacy-note { padding: 18px 4px 0; color: #566476; font-size: 9px; text-align: right; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(420px, calc(100vw - 48px)); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; background: #16212c; color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.35); font-size: 11px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.success { border-color: rgba(200,255,74,.35); }.toast.error { border-color: rgba(255,109,122,.45); color: #ffd5d9; }

.top-actions { display: flex; align-items: center; gap: 9px; }
.top-actions form { margin: 0; }
.user-name { color: var(--muted); font-size: 10px; }
.account-link { display: inline-flex; align-items: center; text-decoration: none; }
.auth-page, .admin-page { min-height: 100vh; background: radial-gradient(circle at 75% 10%, rgba(79,211,255,.08), transparent 32%), #0b1219; color: var(--ink); }
.auth-page { display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); border: 1px solid var(--line); border-radius: 22px; padding: 32px; background: rgba(16,25,35,.96); box-shadow: 0 30px 90px rgba(0,0,0,.4); }
.auth-brand { margin-bottom: 32px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.auth-card h1 { margin: 8px 0 0; }
.auth-copy { color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form label span, .user-create-form label span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.auth-form input, .user-create-form input, .user-create-form select, .inline-form input { width: 100%; }
.form-message { margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 11px; }
.form-message.error { border-color: rgba(255,109,122,.45); color: #ffd5d9; }
.form-message.success { border-color: rgba(200,255,74,.35); color: var(--acid); }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 70px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.admin-head h1 { margin-top: 7px; }
.admin-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: rgba(16,25,35,.94); }
.admin-panel h2 { margin: 0 0 18px; }
.user-create-form { display: grid; grid-template-columns: 1fr 1.35fr 1fr .75fr auto; gap: 12px; align-items: end; }
.user-create-form .primary-button { min-width: 170px; }
.user-list { display: grid; gap: 9px; }
.user-row { display: grid; grid-template-columns: minmax(220px,1fr) minmax(300px,.9fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.user-row strong, .user-row small { display: block; }
.user-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }

@media (max-width: 900px) { .user-create-form { grid-template-columns: 1fr 1fr; }.user-row { grid-template-columns: 1fr; }.inline-form { grid-template-columns: 1fr auto; } }

@media (max-width: 1050px) { .content-grid { grid-template-columns: 1fr; grid-template-areas: "main" "run"; }.run-card { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; text-align: left; }.run-card .kicker, .ring, .run-meta, .primary-button, .restart-button, .microcopy { margin: 0; }.ring { width: 92px; height: 92px; }.ring strong { font-size: 22px; }.run-meta { min-width: 180px; }.primary-button, .restart-button { grid-column: 1 / -1; }.microcopy { grid-column: 1 / -1; } }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; }.sidebar { position: static; height: auto; padding: 18px; }.brand { padding-bottom: 16px; }.steps { grid-template-columns: repeat(5, 1fr); }.step { justify-content: center; padding: 8px; }.step > span:last-child, .sidebar-status { display: none; }.workspace { padding: 24px 16px 48px; }.top-actions { display: none; }h1 { font-size: clamp(22px, 7vw, 30px); white-space: normal; }.panel-head { gap: 12px; }.panel-head-actions { align-items: flex-end; flex-direction: column; }.upload-grid, .config-strip, .mapping-toolbar { grid-template-columns: 1fr; }.preset-actions { flex-wrap: wrap; }.wizard-actions { align-items: stretch; flex-direction: column-reverse; }.wizard-actions-end { flex-direction: column; }.wizard-button { width: 100%; }.page-summary { text-align: right; }.mapping-row { grid-template-columns: 1fr 1fr; }.mapping-row > :nth-child(5) { justify-self: start; }.mapping-special, .concat-editor { grid-template-columns: 1fr; }.filter-row { grid-template-columns: 28px 1fr; }.results-head { grid-template-columns: 1fr; }.metrics, .result-actions { justify-content: flex-start; }.import-footer { align-items: stretch; flex-direction: column; }.import-action { width: 100%; }.result-row { grid-template-columns: 42px 1fr 95px; gap: 8px; padding: 8px 10px; }.result-row > :nth-child(3), .result-row > :nth-child(5), .result-row > :nth-child(6) { display: none; } }
