﻿:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --soft: #f7faff;
  --text: #081631;
  --muted: #64748b;
  --line: #dce4f0;
  --line-strong: #c8d3e5;
  --primary: #1555d1;
  --primary-dark: #0d3b95;
  --danger: #e11d48;
  --success: #059669;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(1820px, calc(100% - 40px));
  margin: 20px auto;
}

.app-hero {
  min-height: 112px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf1ff;
  color: var(--primary);
  font-weight: 900;
}

.hero-copy p {
  margin: 0 0 4px;
  color: #4778e6;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.hero-copy span,
.hero-metric span {
  color: var(--muted);
  font-size: 13px;
}

.hero-metric {
  text-align: right;
}

.hero-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 22px;
}

.workspace-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(620px, 800px) minmax(740px, 1fr);
  gap: 22px;
  align-items: start;
}

.panel,
.preview-panel,
.feature-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.config-panel { padding: 20px; }

.upload-form {
  display: grid;
  gap: 16px;
}

.step-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.step-head h2 {
  margin: 0;
  font-size: 17px;
}

.step-head p {
  margin: 5px 0 0 44px;
  color: var(--muted);
  font-size: 13px;
}

.step-head-actions {
  justify-content: space-between;
  align-items: flex-start;
}

.step-head-actions > div {
  display: block;
}

.step-head-actions .step-badge,
.step-head-actions h2 {
  display: inline-grid;
  vertical-align: middle;
}

.step-badge {
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ff;
  color: var(--primary);
  font-weight: 900;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr 154px;
  gap: 12px;
  align-items: end;
}

.file-shell {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.file-plus {
  display: grid;
  place-items: center;
  height: 100%;
  color: #b7c3d7;
  border-right: 1px solid var(--line);
}

input[type="file"] {
  width: 100%;
  border: 0;
  padding: 10px;
  color: var(--text);
}

.percent-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #263b61;
  font-size: 13px;
  font-weight: 800;
}

.percent-field {
  position: relative;
}

.percent-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 42px 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 15px;
}

.percent-field span {
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: var(--muted);
  font-weight: 800;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--primary-dark);
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

button:hover { background: #082d74; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.link-button {
  min-height: auto;
  padding: 6px 0;
  background: transparent;
  color: var(--primary);
}

.link-button:hover { background: transparent; color: var(--primary-dark); }

.variables-card { padding-bottom: 18px; }

.variables-list {
  display: grid;
  gap: 10px;
}

.variable-row {
  display: grid;
  grid-template-columns: 36px minmax(220px, 1fr) 220px 120px 38px;
  gap: 10px;
  align-items: center;
}

.drag-dot { display: none; }

.variable-row strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.variable-row input,
.variable-row select,
.search-box input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
}

.variable-row input,
.variable-row select { padding: 8px 12px; }

input:focus,
select:focus {
  outline: 3px solid rgba(21, 85, 209, 0.13);
  border-color: #87a8ef;
}

.remove-variable {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid #ffd0d8;
  background: #fffafa;
  color: var(--danger);
  font-size: 20px;
}

.remove-variable:hover { background: #fff1f3; }

.hint-box {
  margin-top: 18px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: #f2f7ff;
  color: #32517f;
  font-size: 13px;
}

.hint-box strong { color: var(--primary); }

.status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #effaf5;
  color: #176148;
  font-size: 13px;
}

.status.error {
  background: #fff1f3;
  color: var(--danger);
}

.result-actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.result-actions .empresa-field {
  flex: 0 0 auto;
  min-width: 220px;
}

.result-actions .empresa-field label {
  margin-bottom: 6px;
  color: var(--muted);
}

.empresa-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Push the secondary download actions away from the delivery group */
#downloadButton { margin-left: auto; }

.outline-button {
  border: 1px solid #abc0ef;
  background: #ffffff;
  color: var(--primary-dark);
}

.outline-button:hover { background: #edf3ff; }

.result-actions span {
  align-self: center;
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
}

.preview-column {
  display: grid;
  gap: 20px;
}

.preview-panel { padding: 18px; }

.preview-head {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.preview-head h2 {
  margin: 0;
  font-size: 18px;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.search-box input {
  border: 0;
  border-radius: 0;
  padding: 0 12px;
}

.search-box span {
  display: grid;
  place-items: center;
  color: #52647d;
  border-left: 1px solid var(--line);
}

.preview-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed #c8d5e8;
  border-radius: 10px;
  color: var(--muted);
  background: #fbfcff;
}

.table-wrap {
  width: 100%;
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3fb;
  color: #112a5b;
  font-weight: 900;
}

tr:hover td { background: #f3f7ff; }
tr:last-child td { border-bottom: 0; }

.preview-pagination {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #52647d;
  font-size: 13px;
}

.preview-pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-pagination button {
  min-height: 34px;
  padding: 0 12px;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 18px 22px;
  background: #eef5ff;
}

.feature-strip div {
  display: grid;
  gap: 3px;
}

.feature-strip strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.feature-strip span {
  color: #2d4368;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1420px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .table-wrap { max-height: none; }
}

@media (max-width: 820px) {
  .shell { width: min(100% - 20px, 1160px); margin: 10px auto; }
  .app-hero,
  .workspace-grid,
  .preview-head,
  .feature-strip,
  .upload-row,
  .percent-row,
  .variable-row {
  display: grid;
  grid-template-columns: 36px minmax(220px, 1fr) 220px 120px 38px;
  gap: 10px;
  align-items: center;
}
  .hero-metric { text-align: left; }
  .config-panel,
  .preview-panel,
  .step-card { padding: 14px; }
  button,
  .remove-variable { width: 100%; }
  .preview-pagination,
  .preview-pagination-actions { align-items: stretch; flex-direction: column; }
}




.flow-card {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.flow-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.flow-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2f7;
  color: #64748b;
  font-weight: 900;
}

.flow-step strong {
  color: var(--text);
  font-size: 12px;
}

.flow-step small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.flow-step.active span { background: #eaf1ff; color: var(--primary); }
.flow-step.done span { background: #dcfce7; color: var(--success); }
.flow-step.error span { background: #ffe4e6; color: var(--danger); }
.flow-step.done { border-color: #bbf7d0; background: #f0fdf4; }
.flow-step.error { border-color: #fecdd3; background: #fff1f3; }

@media (max-width: 820px) {
  .flow-card { grid-template-columns: 1fr; }
}
