:root {
  --red: #ee0200;
  --red-2: #f20000;
  --red-soft: #fff1f0;
  --ink: #141414;
  --ink-2: #3b3b3b;
  --muted: #6f6f6f;
  --line: #e7e5e4;
  --bg: #f6f5f4;
  --card: #ffffff;
  --ok: #1f8a4c;
  --ok-soft: #eaf6ef;
  --amber: #c98a00;
  --slate: #8b8b8b;
  --radius: 14px;
  --font-head: "obviously", "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
a { color: inherit; }
code { background: #f1efee; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; text-decoration: none; }
.strong:hover { color: var(--red); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.ico { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 30px; height: 30px; }
[hidden] { display: none !important; }

/* layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 60px; }
.wrap.wide { max-width: 1360px; }
.topbar { background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; position: sticky; top: 0; z-index: 20; }
.topbar .muted { color: #bdbdbd; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar form { margin: 0; }
.topbar .btn.ghost { color: #fff; border-color: #3a3a3a; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.brand-text { display: inline-flex; align-items: center; gap: 6px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--red); position: relative; display: inline-block; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; background: #fff; border-radius: 2px; }
.brand-mark::before { top: 8px; }
.brand-mark::after { bottom: 8px; right: 10px; }
.brand.big .brand-mark { width: 44px; height: 44px; border-radius: 11px; }
.brand.big .brand-mark::before { top: 13px; left: 10px; right: 10px; height: 5px; }
.brand.big .brand-mark::after { bottom: 13px; left: 10px; right: 18px; height: 5px; }

.hero { margin: 8px 0 22px; }
.hero p { margin: 6px 0 0; max-width: 640px; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.empty { padding: 18px 0 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px var(--font-body); padding: 10px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: #cfcac7; background: #faf9f8; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #d90200; }
.btn.primary:disabled { background: #e8a9a8; border-color: #e8a9a8; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--red); }
.btn.busy { opacity: .7; pointer-events: none; }

/* flash */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); color: #155f35; }
.flash.erro { background: var(--red-soft); color: #9d0100; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; }
.login-card h1 { font-size: 22px; margin: 18px 0 6px; }
.login-card p { margin: 0 0 20px; font-size: 14px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.login-card input { margin-top: 6px; }

/* forms */
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=number], input[type=search], select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 14px var(--font-body); background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(238, 2, 0, .18); border-color: var(--red); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.fields label em { font-style: normal; color: var(--red); font-weight: 500; font-size: 11.5px; margin-left: 6px; }
.fields small { font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.45; }
.fields .span-2 { grid-column: span 2; }
@media (max-width: 700px) { .fields { grid-template-columns: 1fr; } .fields .span-2 { grid-column: auto; } }

.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; }

/* toggles */
.toggles { display: grid; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle input { display: none; }
.toggle span { width: 36px; height: 20px; background: #d9d6d3; border-radius: 20px; position: relative; flex: none; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--red); }
.toggle input:checked + span::after { left: 18px; }
.toggle.disabled { opacity: .55; cursor: not-allowed; }

.chips-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.chip-check input { display: none; }
.chip-check span { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 13px; cursor: pointer; }
.chip-check input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }

/* checklists */
.checklists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; align-items: start; }
@media (max-width: 700px) { .checklists { grid-template-columns: minmax(0, 1fr); } }
.checklist { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #fcfbfb; }
.checklist summary { list-style: none; cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checklist summary::-webkit-details-marker { display: none; }
.checklist .chev { transition: transform .15s; color: var(--muted); }
.checklist[open] .chev { transform: rotate(90deg); }
.checklist .count { background: var(--red); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.checklist .count:empty { display: none; }
.cl-body { padding: 0 12px 12px; }
.cl-search { margin-bottom: 8px; padding: 7px 10px !important; font-size: 13px !important; }
.cl-actions { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.cl-actions button { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.cl-list { max-height: 210px; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.cl-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 4px; border-radius: 6px; cursor: pointer; }
.cl-item:hover { background: #f3f1f0; }
.cl-item input { accent-color: var(--red); }
.cl-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

/* dropzone */
.dropzone { padding: 0; border: 2px dashed #d8d3d0; background: #fff; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--red); background: var(--red-soft); }
.dropzone.busy { opacity: .7; pointer-events: none; }
.drop-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 44px 20px; cursor: pointer; min-height: 100%; }
.drop-icon { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); margin-bottom: 6px; }

.kv { margin: 0; display: grid; gap: 10px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.kv dt { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv.compact { gap: 8px; margin: 16px 0; }
.inline-upload { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.inline-upload input[type=file] { font-size: 13px; flex: 1; min-width: 180px; }

/* table */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #f0eeed; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; text-align: right; }
.table.dense { font-size: 13px; }
.table.dense td { padding: 8px 10px; max-width: 260px; }
.table .note pre { white-space: pre-wrap; font: 12px/1.5 var(--font-body); margin: 6px 0 0; max-width: 420px; color: var(--ink-2); }
.table .note summary { cursor: pointer; color: var(--red); font-weight: 600; }

.pill { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; background: #efedec; color: var(--ink-2); font-weight: 600; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.info { background: #eef2ff; color: #3446a8; }

/* lote */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; word-break: break-word; }
.page-head p { margin: 6px 0 0; font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.back:hover { color: var(--red); }
.lote-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .lote-grid { grid-template-columns: minmax(0, 1fr); } .summary { order: -1; } .sticky { position: static; } }
@media (max-width: 700px) { .page-head { flex-direction: column; } .wrap { padding: 20px 14px 48px; } .big-num { font-size: 44px; } }
.summary { align-self: stretch; }
.sticky { position: sticky; top: 76px; }
.big-num { font-family: var(--font-head); font-size: 52px; line-height: 1; font-weight: 700; display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.big-num small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); }
.loading .big-num span { opacity: .45; transition: opacity .2s; }
.bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: #efedec; margin-top: 16px; }
.bar .seg { height: 100%; transition: width .3s; }
.seg.ok { background: var(--red); }
.seg.f, .dot.f { background: var(--ink); }
.seg.a, .dot.a { background: var(--amber); }
.seg.e, .dot.e { background: var(--slate); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.motivos { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 16px; display: grid; gap: 6px; }
.motivos:empty { display: none; }
.motivo { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.motivo b { font-variant-numeric: tabular-nums; }
.export-links { display: grid; gap: 8px; margin-top: 10px; }
#s-error { margin: 12px 0 0; }

.tabs { display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); margin: -4px 0 12px; padding-bottom: 10px; flex-wrap: wrap; }
.tab { border: 0; background: none; font: 600 14px var(--font-body); padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--ink); color: #fff; }
.tabs .muted { margin-left: auto; }

/* ---------- mapeamento ---------- */
.origin-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.origin-bar .pill:empty { display: none; }
.pill.dark { background: var(--ink); color: #fff; }
.pill.warn { background: #fff4db; color: #8a5a00; }
.warn-text { color: #b26b00; font-weight: 600; }
.hint.top { margin: -6px 0 12px; }
.fields.dest { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }

.rd-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 800px) { .rd-fields { grid-template-columns: minmax(0, 1fr); } }
.rd-field { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fcfbfb; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.rd-field.wide { grid-column: 1 / -1; }
.rd-field input, .rd-field select { font-size: 13.5px; padding: 8px 10px; }
.rd-field small { color: var(--muted); font-size: 12px; line-height: 1.45; display: block; }
.rf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rf-head strong { font-family: var(--font-head); font-size: 14px; }
.rf-status { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.rf-status.ok { background: var(--ok-soft); color: var(--ok); }
.rf-status.warn { background: #fff4db; color: #8a5a00; }
.rf-status.bad { background: var(--red-soft); color: var(--red); }
.rf-body { display: flex; flex-direction: column; gap: 8px; }
.rf-example { font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-example:empty { display: none; }

.seg-switch { display: inline-flex; background: #efedec; border-radius: 9px; padding: 3px; align-self: flex-start; }
.seg-switch button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font: 600 12.5px var(--font-body); color: var(--muted); cursor: pointer; }
.seg-switch button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.rule { display: flex; flex-direction: column; gap: 10px; }
.rule > label:not(.toggle), .grid4 label, .block-label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; }
.rule .toggle { font-size: 13px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
@media (max-width: 800px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.block-label { margin-bottom: 10px; }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more .chev { transition: transform .15s; }
details.more[open] .chev { transform: rotate(90deg); }

.collist { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cl-title { font-size: 12.5px; font-weight: 600; }
.collist ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.collist li { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 4px 4px 8px; font-size: 13px; min-width: 0; }
.collist li.unrec { border-color: #f0c96b; background: #fffaf0; }
.collist li .n { width: 18px; height: 18px; border-radius: 50%; background: #efedec; font-size: 11px; display: grid; place-items: center; flex: none; color: var(--muted); }
.collist li .c { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collist li button { border: 0; background: none; padding: 3px; border-radius: 6px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.collist li button:hover:not(:disabled) { background: #f1efee; color: var(--ink); }
.collist li button:disabled { opacity: .3; cursor: default; }
.ico.up { transform: rotate(-90deg); }
.ico.down { transform: rotate(90deg); }
.cl-empty { font-size: 12.5px; color: #8a5a00; background: #fff4db; border-radius: 8px; padding: 6px 10px; }
.collist select { color: var(--muted); }

.examples { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.examples h3 { font-size: 14px; }
.examples .hint { margin: 4px 0 10px; }
.opt { display: inline-block; font-size: 12px; padding: 1px 7px; margin: 2px 3px 2px 0; border-radius: 6px; background: #f1efee; color: var(--muted); }
.opt.on { background: var(--ink); color: #fff; font-weight: 600; }

.cols-table td { vertical-align: middle; }
.cols-table tr.flag td { background: #fffaf0; }
.cols-table tr.flag td:first-child { box-shadow: inset 3px 0 0 #f0a800; }
.cols-table tr.unused td { color: var(--muted); }
.cols-table .sample { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.cols-table select { font-size: 12.5px; padding: 6px 8px; min-width: 150px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #efedec; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: #fff4db; color: #8a5a00; }
.use { display: inline-block; font-size: 11.5px; background: #eef2ff; color: #3446a8; border-radius: 5px; padding: 1px 6px; margin: 1px 3px 1px 0; white-space: nowrap; }

.avisos { display: grid; gap: 6px; margin-bottom: 14px; }
.avisos:empty { display: none; }
.aviso { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; background: #fff4db; color: #6d4700; border-radius: 8px; padding: 8px 10px; }
.aviso .ico { color: #c98a00; margin-top: 1px; }

.add-filter { margin-top: 12px; max-width: 360px; }
.add-filter select { color: var(--muted); }
.cl-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-remove { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; display: grid; place-items: center; }
.cl-remove:hover { background: #f1efee; color: var(--red); }
.cl-actions { justify-content: space-between !important; align-items: center; }
.opt.more { background: none; font-weight: 600; }

/* ---------- passo a passo ---------- */
.wizard { max-width: 980px; margin: 0 auto; padding-bottom: 90px; }
.stepper { max-width: 980px; margin: 0 auto 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.st { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); min-width: 0; transition: border-color .15s, box-shadow .15s; }
.st:hover { border-color: #cfcac7; }
.st-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #efedec; color: var(--muted); font-weight: 700; font-size: 13px; }
.st-t { display: flex; flex-direction: column; min-width: 0; }
.st-t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-t small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.st.done .st-n { background: var(--ok-soft); color: var(--ok); }
.st.warn .st-n { background: #fff4db; color: #8a5a00; }
.st.warn small { color: #8a5a00; }
.st.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.st.active .st-n { background: var(--ink); color: #fff; }
@media (max-width: 700px) { .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; } .st { flex-direction: column; gap: 4px; padding: 8px 4px; text-align: center; } .st-t small { display: none; } .st-t b { font-size: 11.5px; white-space: normal; } }

.panel-title { font-size: 22px; margin-bottom: 4px; }
.panel-sub { color: var(--muted); margin: 0 0 18px; }
.sub-title { font-size: 15px; margin: 26px 0 12px; }
.panel .fields.dest { border-bottom: 0; padding-bottom: 0; margin: 16px 0 0; }
.rd-fields.main .rd-field { background: #fff; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.fact { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.fact b { font-family: var(--font-head); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fact span { color: var(--muted); font-size: 13px; }
.fact.warn { border-color: #f0c96b; background: #fffaf0; }
.fact.warn b { color: #8a5a00; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

.all-ok { display: flex; gap: 10px; align-items: center; background: var(--ok-soft); color: #155f35; border-radius: 10px; padding: 14px; font-weight: 600; margin-bottom: 14px; }
.flag-intro { display: flex; gap: 8px; align-items: center; color: #6d4700; font-weight: 600; margin-bottom: 10px; }
.flag-intro .ico { color: #c98a00; }
.flag-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid #f0c96b; background: #fffaf0; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.fr-name { display: flex; flex-direction: column; min-width: 0; }
.fr-name .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.fr-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fr-actions select { width: auto; font-size: 13px; padding: 6px 8px; }

details.adv { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
details.adv > summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary .chev { transition: transform .15s; }
details.adv[open] > summary .chev { transform: rotate(90deg); }
details.adv[open] > summary { margin-bottom: 14px; }

.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .rules { grid-template-columns: minmax(0, 1fr); } }
.rule-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rule-card legend { font-weight: 700; font-size: 14px; padding: 0 4px; font-family: var(--font-head); }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.radio:hover { background: #f6f4f3; }
.radio input { margin-top: 3px; accent-color: var(--red); flex: none; }
.radio span { display: flex; flex-direction: column; font-size: 13.5px; }
.radio small { color: var(--muted); font-size: 12px; }
.rule-ex { font-size: 12px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; overflow-wrap: anywhere; }

.review { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 800px) { .review { grid-template-columns: minmax(0, 1fr); } }
.review-side { display: flex; flex-direction: column; gap: 10px; }
.review-side .motivos { border-top: 0; padding-top: 0; margin-bottom: 4px; }

.wizard-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(0,0,0,.05);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(16px, calc((100vw - 980px) / 2)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.wb-info { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.wb-info b { font-family: var(--font-head); font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wb-warn { background: #fff4db; color: #8a5a00; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.wb-actions { display: flex; gap: 8px; }
.wb-actions .btn { min-width: 110px; }
.loading #wb-count { opacity: .45; }
.shake { animation: shake .4s; border-color: var(--red) !important; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* ---------- navegacao e paginas de configuracao ---------- */
.topbar { gap: 16px; }
.topnav { display: flex; gap: 4px; margin-right: auto; margin-left: 18px; }
.topnav a { color: #bdbdbd; text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.topnav a:hover { color: #fff; background: #242424; }
.topnav a.on { color: #fff; background: #2c2c2c; }
.user-link { text-decoration: none; font-size: 14px; }
.user-link:hover { color: #fff; }
@media (max-width: 640px) { .topnav { margin-left: 4px; } .topnav a { padding: 6px 7px; font-size: 13px; } .user-link { display: none; } }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.field-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.card.narrow { max-width: 460px; margin: 20px auto; }
.card.narrow h1 { font-size: 22px; }
.funis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.funil { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.funil ol { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #efedec; border-radius: 16px; padding: 4px 10px; font-size: 13px; }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 240px; box-shadow: 0 8px 24px rgba(0,0,0,.1); display: grid; gap: 6px; text-align: left; }
.menu-body .stack { margin: 0 0 6px; }

/* ---------- RD no lote ---------- */
.rd-sync { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.linkish { border: 0; background: none; color: var(--red); font: 600 13px var(--font-body); cursor: pointer; padding: 0; text-decoration: underline; }
.linkish:disabled { color: var(--muted); }
.resp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.resp-item { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 4px 6px; border-radius: 6px; cursor: pointer; min-width: 0; }
.resp-item:hover { background: #f6f4f3; }
.resp-item input { accent-color: var(--red); flex: none; }
.resp-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-group { margin-bottom: 14px; }
.cf-group h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0eeed; }
.cf-row span { display: flex; flex-direction: column; font-size: 13.5px; }
.cf-row small { color: var(--muted); font-size: 12px; }
.cf-row select { font-size: 13px; padding: 7px 9px; }
.req { font-style: normal; color: var(--red); font-size: 11.5px; font-weight: 600; }
@media (max-width: 600px) { .cf-row { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

.envio { display: flex; flex-direction: column; gap: 10px; }
.envio-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.envio-head h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; margin: 0; }
.envio-actions { display: flex; gap: 6px; }
.bar.big { height: 12px; margin-top: 0; }
.seg.err { background: var(--red); opacity: .45; }
.envio-counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; align-items: baseline; }
.ok-text { color: var(--ok); font-weight: 600; }
.err-text { color: #b40000; font-weight: 600; }
.badge.err { background: var(--red-soft); color: #9d0100; }
